-
Notifications
You must be signed in to change notification settings - Fork 17
feat(guidelines): avoid digits in camelCase #99
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
Merged
BirgitBader
merged 9 commits into
otto-de:main
from
maxedenharter0507:camelcase-wo-digits
Jan 15, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1b73191
Avoid digits in camelCase
maxedenharter0507 85c813c
Fix ruleIds
maxedenharter0507 a92b4a5
Update api-guidelines/global/json/naming-conventions/rules/should-use…
maxedenharter0507 74e998f
Update decisions/0003-should-avoid-digits-in-camel-case.md
maxedenharter0507 d1e4efc
Update api-guidelines/rest/resources/naming-conventions/rules/must-us…
maxedenharter0507 5fbf89c
Update decisions/0003-should-avoid-digits-in-camel-case.md
maxedenharter0507 339a105
Add some feedback from communities
maxedenharter0507 de48a12
Update api-guidelines/global/json/naming-conventions/rules/should-use…
maxedenharter0507 7011a5b
Update api-guidelines/rest/resources/naming-conventions/rules/must-us…
maxedenharter0507 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # [0003] Avoid digits in camel case | ||
|
|
||
| - Status: `accepted` | ||
| - Decided by: <[email protected]>, <[email protected]>, <[email protected]>, API Community, AsyncAPI Community | ||
| - Date: 2025-08-26 | ||
|
|
||
| ## Context | ||
|
|
||
| Several rules in the OTTO API guidelines refer to using camel case for naming properties, parameters, and other identifiers in APIs. | ||
| The guidelines do not explicitly address the use of digits in camel case names, but our linter does not allow digits in camel case names. | ||
|
|
||
| ## Options | ||
|
|
||
| ### Option 1 | ||
|
|
||
| Allow digits in camel case names, e.g. `item1`, `top100LoveSongs`, as there is no explicit rule against it. | ||
|
|
||
| Example: | ||
|
|
||
| ```yaml | ||
| top100LoveSongs: | ||
| type: array | ||
| items: | ||
| type: string | ||
| description: The title of a love song. | ||
| example: | ||
| - "A Wonderful Song" | ||
| - "Another Awesome Love Song" | ||
| - ... | ||
| ``` | ||
|
|
||
| ### Option 2 | ||
|
|
||
| Do not allow digits in camel case names. | ||
|
|
||
| Example: | ||
|
|
||
| ```yaml | ||
| popularLoveSongs: | ||
| type: array | ||
| description: Contains the 100 most popular love songs. | ||
| items: | ||
| type: string | ||
| description: The title of a love song. | ||
| minItems: 100 | ||
| maxItems: 100 | ||
| example: | ||
| - "A Wonderful Song" | ||
| - "Another Awesome Love Song" | ||
| - ... | ||
| ``` | ||
|
|
||
| ## Decision | ||
|
|
||
| Option 2 is chosen, as there is no known use case for digits in camel case names, and the OpenAPI specification provides features to describe ranges and array length if needed. | ||
| The linter rule is already in place and has been used in several APIs without issues. | ||
| This decision ensures more consistent naming conventions across all APIs and avoids potential compiling issues, if property names are starting with a digit, like in Java. | ||
|
|
||
| ## Consequences | ||
|
|
||
| Existing guidelines referencing camel case names need to be updated to explicitly state that digits should be avoided. | ||
|
|
||
| [rule-R000022]: ../api-guidelines/rest/resources/naming-conventions/rules/must-use-camelcase-for-query-parameters.md | ||
| [rule-R004010]: ../api-guidelines/global/json/naming-conventions/rules/should-use-camel-case-for-property-names.md | ||
|
|
||
|
|
||
|
|
||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.