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

[develop 2.0] nickname generator fails with Path Parts #274

Closed
fehguy opened this issue Sep 23, 2014 · 10 comments
Closed

[develop 2.0] nickname generator fails with Path Parts #274

fehguy opened this issue Sep 23, 2014 · 10 comments

Comments

@fehguy
Copy link
Contributor

fehguy commented Sep 23, 2014

When an operationId is not specified, the codegen logic makes invalid method names when path params are present

fehguy added a commit that referenced this issue Sep 24, 2014
@fehguy fehguy closed this as completed Sep 24, 2014
@maxlinc
Copy link

maxlinc commented Sep 24, 2014

Quick question, because it relates to OAI/OpenAPI-Specification#29. I want to try and match the swagger-codegen behavior in other projects if possible. I tried to test it out but I'm having trouble figuring out how to run samples on the develop_2.0 branch.

It looks like you're generating method names based on the path + http method. So GET /foo/bar would become something like fooBar_get. What happens if the path is just GET /? Would the method name be _get?

@fehguy
Copy link
Contributor Author

fehguy commented Sep 26, 2014

looks like we need special handling of this.

#279

@earth2marsh
Copy link

Could this have regressed, possibly? Importing a description with path params but no operationid is causing complaints about unsupported characters.

@fehguy
Copy link
Contributor Author

fehguy commented Apr 8, 2015

@earth2marsh can you please share a sample?

@webron
Copy link
Contributor

webron commented Apr 9, 2015

@earth2marsh - that's because you have a typo there. You use operationid instead of operationId. Change that and you should be good.

@earth2marsh
Copy link

Sorry, it looks like I linked to the wrong revision of that spec where I had later added the operationid to test it. :facepalm

@webron try this: https://gist.githubusercontent.com/earth2marsh/db8ab2ffcb4895e78d14/raw/0241924f47061a5f6668874651926779a781df9f/apm.json

If you bring that into swagger-codegen, then you should see the error as it tries to use the brace char to create the operationId.

@webron
Copy link
Contributor

webron commented Apr 11, 2015

@earth2marsh - do you get errors for a specific language? Just tried running it with the java client generator and didn't get any errors. However, I'm not sure that's the sample you wanted to share because in your original post you mentioned the path params seem to be causing the issue and the sample has no path parameters.

@earth2marsh
Copy link

@webron I'm not sure what happened here—I must have had some wires crossed somewhere. You're totally right that my sample doesn't actually cover the issue I described, and I can't seem to reproduce my original issue. My apologies for the wild goose chase! I'm going to go back to the start again and see if I can make this happen predictably.

@webron
Copy link
Contributor

webron commented Apr 16, 2015

@earth2marsh - no worries, it's better to check on issues that can't be reproduced thanto not be aware of ones that can :)

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

No branches or pull requests

4 participants