Closed frasch1712 closed 7 years ago
@frasch1712 I don't think the custom error model is supported at the moment. May I know if you've cycle to contribute the enhancement?
cc @cbornet
I investigated a bit in it and think it is only a small change in the mustache template. So I will try to contribute the enhancement.
And just for the record -- the problem is that the template uses returnType
property, which gets resolved in the higher (operation) context, and thus gives really an operation return type, Product in the example above; instead the template should use baseType
, which is a property of the response.
So, a bug in the api.mustache
. I have fixed locally, will wait until the pull request by @frasch1712 gets accepted into the upstream.
@ok11 I don't see any PR from @frasch1712 : https://github.com/swagger-api/swagger-codegen/pulls/frasch1712
For the time being, I would suggest you to file one for review. Thanks.
I have this same issue. Is there any progress on it? Or maybe a workaround?
Hi, first of all congrats on this amazing project! Now on to the issue, just a couple of comments:
@ApiResponse
objects, both containing code 200; I think this point was not raised in the issue so far but it would be nice if it were fixed too@ebautistabar
are there plans to merge #4801 for the next release?
Yes, we want to merge it. Did you have a chance to test the first? Does it work for you?
when setting a 200 response and a default response in the yaml file, the generator creates just 2 @ApiResponse objects, both containing code 200; I think this point was not raised in the issue so far but it would be nice if it were fixed too
I would recommend opening a new issue for tracking so as to more easily draw attention from the community.
@wing328 I have tested the PR and it seems to solve the issue described by @frasch1712.
I will open a new issue to describe the other problem.
Would it be possible to merge #4801 so that I will have a possibility to provide another fix of another issue I spotted around the same feature, before v2.3.0
milestone (so that this version will contain the 2 fixes)?
@gcernier-amadeus I'll try to merge it later today after resolving the merge conflicts.
Closed via #4801. Thanks for the fix by @gcernier-amadeus
Please pull the latest master to give it a try.
Description
Swagger Spring Boot Code generation ignores different schema references in responses.
Actually the following is generated:
I would expect the following "response = Error.class for code = 400" (see below for the yaml definition):
Swagger-codegen version
master branch
Swagger declaration file content or url
Declaration in yaml (extract):
Command line used for generation
java -Dmodels -Dapis -jar swagger-codegen-cli.jar generate -i swagger.yaml -l spring
additional config: