VertNet / webapp

VertNet web application
8 stars 7 forks source link

Fix value types in API response? #639

Closed sckott closed 5 years ago

sckott commented 7 years ago

Possible to fix value types in API response? e.g.

{
   "haslifestage": "0",
   "month": "06",
   "decimallongitude": "-105.5012",
   "startdayofyear": "174",
   "networks": "MaNIS,VertNet,Arctos",
   "vntype": "specimen",
   "title": "CUMV Mammal Collection (Arctos)",
   "accessrights": "http://vertnet.org/resources/norms.html",
   "kingdom": "Animalia",
   "verbatimcoordinatesystem": "decimal degrees",
   "dctype": "PhysicalObject",
   "iptrecordid": "http://arctos.database.museum/guid/CUMV:Mamm:20114?seid=2116135",
   "day": "22"
}

most numeric values are characters instead, although I do see some numerics that are returned as numerics (just the rank field i think)

tucotuco commented 5 years ago

Hi Scott,

This is ancient business for which I just found an unsent response. Sorry about the delay. The behavior you are seeing reflects the native data types in the App Engine index. You can see the full suite of data types beginning at the following line of code:

https://github.com/VertNet/dwc-indexer/blob/master/index_utils.py#L141

The data types were set to make sure that no incoming data were lost, even if they did not comply with pre-conceived notions of the data types that ought to be in those fields.

sckott commented 5 years ago

okay