Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

oneOf Polymorphism Broken #333

Open
cjllanwarne opened this issue Aug 15, 2022 · 1 comment
Open

oneOf Polymorphism Broken #333

cjllanwarne opened this issue Aug 15, 2022 · 1 comment
Labels

Comments

@cjllanwarne
Copy link

Describe the bug

To Reproduce:

Generate the oneOf example given in the openapi docs here: https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/

Expected Behavior:

The example inputs should work.

Actual Behavior:

An error is thrown in the service:

Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Could not resolve subtype of [simple type, class [...].PetsBody]: missing type id property 'type'; nested exception is com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve subtype of [simple type, class [...].PetsBody]: missing type id property 'type'<EOL> at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 4, column: 1]]

Environment

Plugin version: 2.19.2
Swagger Codegen version: 2.19.2
Gradle version:
Java version: 17
OS:

@cjllanwarne cjllanwarne changed the title oneOf Molymorphism Broken oneOf Polymorphism Broken Aug 15, 2022
@ianthetechie
Copy link

I just hit this as well :/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants