Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fields in API are in snake_case instead of camelCase: is this intentional #56

Open
stevenbal opened this issue Feb 20, 2025 · 1 comment
Assignees
Labels
question Further information is requested triage

Comments

@stevenbal
Copy link
Contributor

Product versie / Product version

latest / 0.0.4

Omschrijf het probleem / Describe the bug

I noticed this just now, our other registration components use camelCase afaik, was it intentional to use snake_case for Open Producten?
Image

Stappen om te reproduceren / Steps to reproduce

No response

Verwacht gedrag / Expected behavior

No response

@alextreme
Copy link
Member

@Floris272 please discuss this next week with the Open Producten team

Based on the guidelines: https://gitdocumentatie.logius.nl/publicatie/api/adr/
And a naming convention document that it refers to: https://docs.geostandaarden.nl/api/API-Strategie-mod-naming-conventions/#path-segments

Do note that this is about path naming and not field naming, Geostandaarden doesn't state anything about field-naming.

First, in order to avoid compatibility issues with web servers and frameworks that do not handle case sensitivity of URI's well, the use of spinal-case path segments is preferred over camelCase. Also, it is a more common implementation choice for path segments than snake_case.
/naming/path-case: Use spinal-case for path segments
In case path segments include compound words, the individual words are written in lower case and may be separated with hyphens.

So Geostandaarden mentions to avoid camelCase for paths. I'd like to follow this aspect of the recommendation (also because it's ugly imho)

Regarding spinal-case versus snake_case, they mention that spinal-case is chosen because it is more common. But again, this is for paths/resources and not fields.

Based on n=2 the Stripe and Twitter APIs I checked and both of these use snake_case for fields. So my opinion is to leave the naming of Open Producten fields as is, but this opinion isn't strongly held

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested triage
Projects
None yet
Development

No branches or pull requests

3 participants