beeminder / apidocs

Beeminder API Reference
Other
3 stars 4 forks source link

POST /users/u/goals/g/datapoints/create_all.json, incorrect return type #20

Closed phdoerfler closed 3 years ago

phdoerfler commented 4 years ago

See #9 for previous work on this subject.

POST /users/u/goals/g/datapoints/create_all.json is still incorrectly documenting the return type. Based on my last observation, it

{
  "errors" : [
  ],
  "successes" : [
  ]
}

The docs incorrectly state:

Returns A list of successfully created Datapoints. Or, in the case of any errors, you will receive an object with two lists, successes, and errors.

dreeves commented 3 years ago

Got a use case for how the status quo is bad or annoying?

We could kind of make the argument that the documentation is fastidiously correct. Submitting an empty list of datapoints is an error, so it returns the JSON object, as advertised. Confusingly, that JSON object doesn't actually tell you what the error was. That's because the structure of the JSON object is to list all the submitted datapoints that succeeded and all the datapoints that failed. With no datapoints submitted, those lists are naturally both empty!

PS: Sorry to sit on this for so long! Tentatively closing now but a use case could easily change my mind!