forked from loafle/openapi-generator-original
Do not add schema / class name mapping where custom mapping exists (#14984)
* fix #13150 Do not add schema / class name mapping where custom mapping exists * update test spec * improve import * fix import for mapped models * fix python * code clean up * fix dart client import * fix dart:core import * better import * add tests --------- Co-authored-by: Bernie Schelberg <bernard.schelberg@mywave.ai>
This commit is contained in:
@@ -1507,6 +1507,9 @@ components:
|
||||
- $ref: '#/components/schemas/Cat_allOf'
|
||||
Animal:
|
||||
discriminator:
|
||||
mapping:
|
||||
DOG: '#/components/schemas/Dog'
|
||||
CAT: '#/components/schemas/Cat'
|
||||
propertyName: className
|
||||
properties:
|
||||
className:
|
||||
|
||||
@@ -23,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import org.openapitools.client.model.Cat;
|
||||
import org.openapitools.client.model.Dog;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
@@ -42,8 +40,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
)
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
|
||||
@JsonSubTypes({
|
||||
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
|
||||
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
|
||||
@JsonSubTypes.Type(value = Cat.class, name = "CAT"),
|
||||
@JsonSubTypes.Type(value = Dog.class, name = "DOG"),
|
||||
})
|
||||
|
||||
public class Animal {
|
||||
|
||||
Reference in New Issue
Block a user