You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to add example in an API response without losing Schema #2479
I have the same issue when migrating from Springfox. It seems like in order to get the default schema on Springfox, the @content must either not be defined, or defined with all attributes without any defaults generated.
I was also hoping that useReturnSchema=true would be taken into account, but it has no effect as well.
If this is somehow an expected behavior due to OpeanAPI specs (or in general a breaking change), can you at least consider a config property which would allow this?
In project I'm part of, we try to minimise the amount of manual API doc definitions for internal APIs and this one seems like a good candidate for an intuitive default behavior - unless I'm missing the issue here, of course.
Activity
How to add example response with json output unit test
r4soft commentedon Jan 24, 2024
Hello,
I have the same issue when migrating from Springfox. It seems like in order to get the default schema on Springfox, the @content must either not be defined, or defined with all attributes without any defaults generated.
I was also hoping that
useReturnSchema=truewould be taken into account, but it has no effect as well.If this is somehow an expected behavior due to OpeanAPI specs (or in general a breaking change), can you at least consider a config property which would allow this?
In project I'm part of, we try to minimise the amount of manual API doc definitions for internal APIs and this one seems like a good candidate for an intuitive default behavior - unless I'm missing the issue here, of course.
Regards
bnasslahsen commentedon Mar 2, 2024
@ianwallen,
As long a you added the
@Contentannotation, it will be used for reference.You need to complete it with your Schema response, for example: