-
Notifications
You must be signed in to change notification settings - Fork 32
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
java.lang.Exception: cannot determine Ok result type for addPet #61
Comments
From the specification: "it is expected from the documentation to cover a successful operation response and any known errors" That's why we raise an exception when a successful response is not defined. |
I see, but the last paragraph in that spec section says: "The Responses Object MUST contain at least one response code, and it SHOULD be the response for a successful operation call." So it depends on how to interpret "should". In my understanding "must" means "absolute requirement" and "should" means "not an absolute requirement but please do it anyway". So I don't think the presence of a success code could be depended on. And at least, as seen, the Swagger example doesn't implement it that way. |
Btw, here are the standard definitions of "must" and "should": http://www.ietf.org/rfc/rfc2119.txt |
Yes, that's true. But we have to generate code from the swagger definition, so we chose to make the successful response definition mandatory, rather than provide a default implementation in case the definition is missing. |
When I run
swaggerClientCodeGen
on the YAML from the PetStore example in the online Swagger Editor:https://editor.swagger.io
I get the following error:
Is this due to a bug in the plugin or an error in the source document?
The text was updated successfully, but these errors were encountered: