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

Initialisms are missed when used in mixed-case pluralization #2522

Open
displague opened this issue Feb 20, 2021 · 4 comments
Open

Initialisms are missed when used in mixed-case pluralization #2522

displague opened this issue Feb 20, 2021 · 4 comments

Comments

@displague
Copy link

displague commented Feb 20, 2021

Problem statement

When specifying Initialisms, these initialisms should be aware of mixed-case use in plurals (or have an option to define plurals or enable plural safe behavior):

VLANs, IPs, should be treated as vlans, ips.

What is generated today is /v_l_a_ns/ and vla_ns_client.go

Swagger specification

https://github.com/t0mk/gometal/blob/6e58208/equinix-metal.patched.json

Steps to reproduce

https://github.com/t0mk/gometal/blob/6e58208/Makefile#L29-L35

https://github.com/t0mk/gometal/tree/6e58208/client/v_l_a_ns

Environment

swagger version: 2.0
go-swagger version: 0.26.1
go version: 1.15 / 1.16

@fredbi
Copy link
Contributor

fredbi commented Feb 21, 2021

Similar to go-openapi/swag#46

@fredbi
Copy link
Contributor

fredbi commented Feb 21, 2021

As a workaround, you can add you pluralized forms as extra initialisms to the command line options.

@gregmarr
Copy link
Contributor

The function for adding more initialisms converts the provided string to uppercase, so that won't help here.

@displague
Copy link
Author

Indeed. I have vlan and vlans in my initialialisms lists (see the Makefile link above) and the results in a v_l_a_ns client directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants