GRESB / api-docs

http://gresb.github.io/api-docs/
3 stars 0 forks source link

Differentiate between string and numeric datatypes #151

Closed GokceBaykan closed 7 months ago

GokceBaykan commented 12 months ago

Postman collection should be revised to change strings to number when the field expects number as datatype. This will eliminate the confusion arising among API users.

joeyhorst commented 11 months ago

Does this happen for the /responses endpoints or /assets? You have examples of where this happens? In general all values are stored as string in the /responses endpoints.

GokceBaykan commented 11 months ago

Most recent question was for portfolio level, but it was also asked for asset level before. My concern is that, while the portal accepts string through the response, we are sometimes actually expecting a number as answer. So if the question is asking about area certified, and API users submit "No area certified" instead of "0", the validation in the UI will complain "'No area certified' is not a number". For this my idea was to remove the quotation marks from the variable answer in the body of the requests in our collection, for wherever response expects a number. Because it seems the confusion is coming from that. But I also get that it is effort to differentiate these while the endpoint itself stores them all as strings.

joeyhorst commented 11 months ago

We do share type in http://gresb.github.io/api-docs/#asset-data-dictionary. So it seems that it's mostly adjusting the request example jsons to correctly reflect these data types.

For the /responses endpoints we first have to determine if any data is stored in a different type than string.

joeyhorst commented 7 months ago

conclusion, responses endpoint doesn't has any validation, as such it won't inform the user what the required data type should be