java - How to ignore class properties in Swagger -
my question simple, there way how ignore property in classes defined library or framework (for example, org.springframework.core.io.resource
)? can anotate fields @jsonignore
in own classes si there way how same in case can't change theclass itself?
i want because returning responseentity<resource>
and swagger-ui shows me nested fields of resource like
"url": { "authority": "string", "content": {}, "defaultport": 0, "file": "string", "host": "string", .... }
i using springfox spring mvc (no spring boot), both of them newest versions. don't annotate fields right now, leave work swagger.
its not clear if want ignore type or want ignore properties on it?
if want latter i.e. modify representations of classes cannot control using mixins in jackson should solve problem. not want do. guess want serialize how supposed to, want rendered differently in swagger service description.
so in particular case, recommend creating an alternate type rule as described here substitutes responseentity<resource<t>
t
t's in service. example in link collection<t>
, should lead in right direction.
Comments
Post a Comment