Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQ] Support Polymorphic Annotations for JSONB #12343

Open
jonsalvas opened this issue May 11, 2022 · 0 comments
Open

[REQ] Support Polymorphic Annotations for JSONB #12343

jonsalvas opened this issue May 11, 2022 · 0 comments

Comments

@jonsalvas
Copy link

Is your feature request related to a problem? Please describe.

According to the official communication of EF, JSONB now supports polymorphism: https://projects.eclipse.org/projects/ee4j.jsonb/releases/3.0.0

There is not much documentation about it, but I found the following example:

@JsonbTypeInfo({      
  @JsonbSubtype(alias = "dog", type = Dog.class)     
  @JsonbSubtype(alias = "cat", type = Cat.class)})
interface Animal {} 

class Dog implements Animal {    
  public String isDog = true;
}
class Cat implements Animal {   
   public String isCat = true;
}

The behaviour seems quite similar to the existing @JsonTypeInfo Annotation of Jackson. We really need this feature in order to use polymorphic DTO's with JSONB. Alternatively we could use Jackson, but unfortunately the microprofile Generator does not support it (yet).

Describe the solution you'd like

As you already implemented a type info annotation for Jackson (see https://github.com/OpenAPITools/openapi-generator/blob/60dcf8613f6b75b606757c4a991fe018ad10ee99/modules/openapi-generator/src/main/resources/kotlin-spring/typeInfoAnnotation.mustache) it would be great to have the same for JSONB.

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

No branches or pull requests

1 participant