traewelling icon indicating copy to clipboard operation
traewelling copied to clipboard

API: Inconsistent use of camel and snake case in request body

Open marhei opened this issue 9 months ago • 3 comments

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.

marhei avatar May 08 '24 13:05 marhei

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/

MrKrisKrisu avatar May 08 '24 21:05 MrKrisKrisu

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.

MrKrisKrisu avatar May 08 '24 21:05 MrKrisKrisu

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.

marhei avatar May 08 '24 21:05 marhei