JSON wrapper object not mapped to proper OpenAPI model
See original GitHub issueWhen a class is annotated with
@com.fasterxml.jackson.annotation.JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME, include = com.fasterxml.jackson.annotation.JsonTypeInfo.As.WRAPPER_OBJECT)
it is being serialized as an object, rather than a simple string. The OpenAPI model for such a class is represented as a simple value.
See example attached to issue #2862.
Serialized:
{"ExampleSubType":"VALUE1"}
Model:
Example:
type: object
ExampleSubType:
type: string
allOf:
- $ref: '#/components/schemas/Example'
enum:
- VALUE1
- VALUE2
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:7 (1 by maintainers)
Top Results From Across the Web
java - Jackson with JSON: Unrecognized field, not marked as ...
I keep getting this error and "wrapper" returns null . I am not sure what's missing. Can someone help please? org.codehaus.jackson.map.exc.
Read more >Unrecognized field, not marked as ignorable - JSON Parsing ...
If you look carefully, the "person" field points to a JSON array and not an object, which means it cannot be mapped to...
Read more >More Jackson Annotations - Baeldung
This article covers some lesser-known JSON processing annotations provided by Jackson.
Read more >OpenAPI Specification v3.1.0 | Introduction, Definitions, & More
When properly defined via OpenAPI, a consumer can understand and ... Models are defined using the Schema Object, which is a superset of...
Read more >Jackson JSON Request and Response Mapping in Spring Boot
Jackson JSON ObjectMapper · Convert the incoming JSON Request Body to Java Object of your method @RequestBody argument. Generally used in POST ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
any progress on this issue?
@dazraf there is indeed somebody reading, and nope, development has not stopped; as always contributions are more than welcome though…
That said a partial implementation has been implemented in #3921, available in latest snapshot and next release.