Skip to content

java.lang.Exception: Please provide an operationId #62

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

Open
kavedaa opened this issue Jan 10, 2018 · 3 comments
Open

java.lang.Exception: Please provide an operationId #62

kavedaa opened this issue Jan 10, 2018 · 3 comments

Comments

@kavedaa
Copy link

kavedaa commented Jan 10, 2018

I get the following error when running swaggerClientCodeGen on a (3rd-party generated) yaml file:

[error] (*:swaggerClientCodeGen) java.lang.Exception: Please provide an operationId in ...

As far as I can tell from the specification, operationId is not marked as "Required":

https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#operationObject

@fralken
Copy link
Owner

fralken commented Jan 11, 2018

We use the operationId as the method name in the controller, that's why it must be present.

@kavedaa
Copy link
Author

kavedaa commented Jan 11, 2018

Yes, I understand the motivation, but I think that in the context of open standards and interoperability the plugin would be useful to more people if it actually adhered to the specification.

In this case you could for instance fall back to generating a method name from the path, or synthesizing it like operation1, operation2 etc.

That said I would like to add that I still find the plugin very useful, so thanks for creating it and open sourcing it!

@fralken
Copy link
Owner

fralken commented Jan 12, 2018

Thanks. Indeed we could better respect the specification and provide defaults for non mandatory specifications such as this one (and the successful response of #61). We can implement this in future. In the meantime if you would like to contribute with a PR on this, it would be highly appreciated :)

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

2 participants