GRESB / api-docs

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

partner_id and year have incorrect datatype in docs #86

Closed joeyhorst closed 2 years ago

joeyhorst commented 2 years ago

Flagged by a user, so haven't checked myself.

naincygoyal commented 2 years ago

@joeyhorst do we have any standard format of partners_id because I simply gave 123456789 and reponse got created with no error. Besides I am able to provide a value as an integer. However , under response it is getting converted into String.

Request Response Screenshot ![image](https://user-images.githubusercontent.com/97026424/156586326-3b034433-5f32-40ba-aff9-ed6c04ecf4b6.png)

I am not sure whether it should accept an integer or throw an error ?

Date is working fine , when I passed as a string , it has thrown an error in honey badger - https://app.honeybadger.io/projects/80734/faults/84341031#notice-comments

But when I am giving any invalid year during this scenario its not throwing any error only asset is not getting created , ideally it should throw an error if year is not valid.

Invalid Year ![image](https://user-images.githubusercontent.com/97026424/156587690-d74d56d6-771b-4439-b0bc-3922f179ba2e.png)
joeyhorst commented 2 years ago

The partners_id is a string and accepts anything basically (also an integer). As such we need to specify in the docs that it is a string.

For year we need to specify that it is a 4 digit integer. We don't check and expect the user to fill in the right integer. It is also specified in the api-docs that you can only submit data for the last 5 years (2021, 2020, 2019, 2018, 2017).

What you need to check for the date are values like wat_data_from from http://gresb.github.io/api-docs/#data-dictionary. I'm not sure what the date format should be but the user mentioned it expected an integer.

naincygoyal commented 2 years ago

@joeyhorst That I checked it was accepting only date not integer.

naincygoyal commented 2 years ago

The partners_id is a string and accepts anything basically (also an integer). As such we need to specify in the docs that it is a string.

For year we need to specify that it is a 4 digit integer. We don't check and expect the user to fill in the right integer. It is also specified in the api-docs that you can only submit data for the last 5 years (2021, 2020, 2019, 2018, 2017).

What you need to check for the date are values like wat_data_from from http://gresb.github.io/api-docs/#data-dictionary. I'm not sure what the date format should be but the user mentioned it expected an integer.

@joeyhorst Yes I agree its an integer so String accepts it but actually string accepts the value in enclosed double quotes so thought to double whether its fine or not.