`path-segment-plural` built in rule
See original GitHub issueIs your feature request related to a problem? Please describe.
Path items are often named in the plural: /customers
.
Describe the solution you’d like
lint:
rules:
path-segment-plural: error
Path items are often named in the plural: /customers
.
This should ignore path parameters and take the segment prior if the path parameter is there… example:
Path items: /customers/{customerId}
… the rule should identify there is a path parameter and remove the /{customerId}
from that before evaluating if it is plural (ends in an s).
Describe alternatives you’ve considered
It is similar to #394. It could be path-includes-pattern
?
Additional context none
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
`path-segment-plural` built in rule · Issue #395 - GitHub
Path items are often named in the plural: /customers . This should ignore path parameters and take the segment prior if the path...
Read more >path-segment-plural - Redocly
RESTful API design often uses resources in path segments and those resources are typically plural. For example, "customers" instead of ...
Read more >Intl.PluralRules - JavaScript - MDN Web Docs
Chrome Edge
PluralRules Full support. Chrome63. Toggle history Full support. Edge18. Tog...
PluralRules() constructor Full support. Chrome63. Toggle history Full support. Edge18. Tog...
resolvedOptions Full support....
Read more >PluralRules (ICU4J 72.1)
Rules are constructed from a text description, consisting of a series of keywords and ... Parses a plural rules description and returns a...
Read more >Plural forms (GNU gettext utilities)
Once again people fell into the trap of believing the rules their language is using are universal. ... The form how plural forms...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, I feel like this is still a valid use-case way to often, e.g.
While it could be refactored to
PUT /invoice-abandonments
orPUT invoice-payments
I believe it would make API worse.This is a completely different discussion though not related to the rule itself.
@andriyl making sure you see the updates here ^.
That’s very good. (Although that example is still a violation in my view… this happens with command-like APIs which are generally avoided.)