From 949e8582bc208bb491946481b043a87a173c96d5 Mon Sep 17 00:00:00 2001 From: Ruben van Staveren Date: Tue, 12 Dec 2023 14:49:53 +0100 Subject: [PATCH] documentation fixes --- app/main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/main.py b/app/main.py index 7e007dd..d7651ee 100644 --- a/app/main.py +++ b/app/main.py @@ -14,6 +14,9 @@ GEOLITE2_ASN_DB = '/usr/local/share/GeoIP/GeoLite2-ASN.mmdb' GEOLITE2_CITY_DB = '/usr/local/share/GeoIP/GeoLite2-City.mmdb' class IPAddressParam(BaseModel): + ''' + Payload entry as used in POST + ''' ip: Union[IPv6Address,IPv4Address] class Locality(BaseModel): @@ -39,6 +42,9 @@ class GeoLocation(BaseModel): async def root_post(ipaddresses: Annotated[list[IPAddressParam], Body(title="The IPAddresses to geolocate")] ) -> list[GeoLocation]: + ''' + Return GeoLocation item(s) for a list of IPAddressParam objects + ''' geolocations = [] with (geoip2.database.Reader(GEOLITE2_ASN_DB) as reader_asn, geoip2.database.Reader(GEOLITE2_CITY_DB) as reader_city):