Closed michael-gillett closed 4 years ago
One option would be to break out the big guns https://www.npmjs.com/package/pluralize
eek, apologies. having a look now
fixed in 1.4.5 - 46fe0ed50fa71854d73e154b080a054cf02cecf5
@michael-gillett i rethought this and used the pluralize() module. thanks for the link - /v1/people looks better than /v1/persons ;-P
hmm am hoping i didn't introduce any breaking API changes by doing this...
@liveandrew might make sense to make an announcement on #dev-api about this? Let me know if you want me to take care of it
yes please nicolas, that would be great
btw i think it affects relatively few resources, that's certainly my hope
Overview
If you have GET and MULTIGET operations on a resource that ends in "s" the generated swagger has the same
operationId
for both actions while violates a constraint of swagger.Did some quick digging in the code and the issue appears to be the pluralizeName function in src/names.ts
It returns the name unaltered if it already ends in "s" which leads to this issue.
Reproduce
The
operationId
in the generated swagger will be"Get status"
for both operations