swagger-core icon indicating copy to clipboard operation
swagger-core copied to clipboard

Missing JsonView annotation interpreted wrong

Open Plunts opened this issue 3 years ago • 0 comments

The JsonView annotation is interpreted slightly wrong: fields which are not annotated with it are actually not serialized if a view is specified, they are only included in the default serialization. This is described in this blogpost and I'm using this behaviour in my own code. The original MR for this (#2662) stated it differently, namely that it's always included.

The affected method is here: https://github.com/swagger-api/swagger-core/blob/bae7c5cad477887888d97c8c6081a850d535b397/modules/swagger-core/src/main/java/io/swagger/v3/core/jackson/ModelResolver.java#L2183

Plunts avatar Feb 22 '22 12:02 Plunts