#73 The API documentation is inaccurate
Closed: Fixed 6 years ago Opened 6 years ago by puiterwijk.

The API documentation for adding a new waiver is inaccurate. I will break the problems down in request and response.

Request:

"result_id": "1",

This is indeed accepted, but kinda silly, I would expect an int.

"waived": "false"

This is where we come into the plain incorrect documentation. Sending waived as 'false' creates a waiver with u'waived': True, (because the python string 'false' gets interpreted as a boolean true).

Response:

"result_id": "1",

The API does not return a string. It returns u'result_id': 3,.

"waived": "false"

The API does not return a string. It returns u'waived': True (and this was with request waived='false').


Thanks for spotting these errors @puiterwijk. #78 fixes the docs themselves. I guess ultimately we need some tests covering the docs, same as greenwave#41. And maybe we need better validation on the request bodies to avoid the "false" vs. false confusion.

Metadata Update from @dcallagh:
- Issue assigned to dcallagh
- Issue close_status updated to: Fixed
- Issue set to the milestone: 0.3
- Issue status updated to: Closed (was: Open)

6 years ago

Login to comment on this ticket.

Metadata