traewelling
traewelling copied to clipboard
API: Inconsistent use of camel and snake case in request body
To simplify the use of automatic key encoding strategies, a standardised use of either camel or snake case for keys in the request body would make sense. Currently, for example, camel case is used in the /trains/checkin
endpoint, but snake case is used in the new /report
endpoint.
In long term I would have a look at the API Guidelines from Zalando which recommend kebab-case. (idea from @HerrLevin)
https://opensource.zalando.com/restful-api-guidelines/
Oh, sorry. You mean the keys. I don't know if there is a recommendation, but I personally prefer camelCase here. We can discuss that here.
As all other endpoints use keys in camel case and the report endpoint is not yet widely used, I would recommend changing the key from this endpoint to camel case as well.