Skip to content
1

Naming convention for API paths, query parameters, variables etc. #4650

oddstr13 asked this question in Ideas
Naming convention for API paths, query parameters, variables etc. #4650
Dec 3, 2020 · 4 answers

I personally think that PascalCase doesn't look good in the API, and would strongly prefer snake_case instead (no SCREAMING_SNAKE_CASE please).

It just feels weird to have (potentially) case sensitive parts of an URL (considering the host part is case insensitive), and it feels out of place in JSON keys too.

Replies

1

I think it makes sense to use PascalCase because most of the API currently is. Altough I would prefer snake_case. This should definitely be considered for the API rewrite.

1 reply
@oddstr13

oddstr13 Dec 15, 2020
Collaborator Author

This is intended as a discussion about what we want the API to look like for v11+ (and also for new API endpoints before that time, so we don't have to rewrite them).

1

@crobibero
crobibero Dec 3, 2020
Collaborator

Routes, QueryParameters, and Json keys should already be case insentive. snake_case isn't currently supported by the Json library, and is not the standard for C#

(I only speak for 10.7+)

1 reply
@oddstr13

oddstr13 Dec 15, 2020
Collaborator Author

I don't think what's standard or convention in C# itself matters much for how the APIs should look externally, but no support for it in the JSON library would be a concern if it isn't relatively straight forward to implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
💡
Ideas
3 participants
Beta