[ https://issues.apache.org/jira/browse/CAMEL-18066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17533624#comment-17533624 ]
Johnathan Ingram edited comment on CAMEL-18066 at 5/9/22 5:53 AM: ------------------------------------------------------------------ Hi I have done a pull request #7568 for both 18065 and 18066 It keeps on failing on *main pr build / checkstyle* I have run which {{mvn clean install -Psourcecheck}} passes on my local machine Would you be able to have a look and see why this is failing. Then do these commits get merged into the 3.14 LTS line, so will these commits be available in the 3.14.3? was (Author: JIRAUSER283740): Hi I have done a pull request #7568 for both 18065 and 18066 It keeps on failing on *main pr build / checkstyle* I have run which {{mvn clean install -Psourcecheck}} passes on my local machine Would you be able to have a look and see why this is failing. > OpenApi Specification Generator: Add support for discriminator for xOf > ---------------------------------------------------------------------- > > Key: CAMEL-18066 > URL: https://issues.apache.org/jira/browse/CAMEL-18066 > Project: Camel > Issue Type: Improvement > Components: camel-openapi-java > Affects Versions: 3.14.2 > Reporter: Johnathan Ingram > Priority: Minor > > Add support for the OpenApi spec 'discriminator' allowing for explicit > selection of a schema type based on a property value. > [https://redocly.com/docs/resources/discriminator/] > > This class > {code:java} > @Schema(oneOf = { XOfFormA.class, XOfFormB.class }, > discriminatorProperty = "code", > discriminatorMapping = { > @DiscriminatorMapping(value = "a-123", schema = > XOfFormA.class), > @DiscriminatorMapping(value = "b-456", schema = > XOfFormB.class) }) > public interface OneOfForm { > // The discriminator explicitly declares which property you can inspect > to determine the object type. > // The discriminator must apply to the same level of the schema it is > declared in (common mistake when using nested objects). > } {code} > will generate > {code:java} > "components" : { > "schemas" : { > "OneOfForm" : { > "oneOf" : [ { > "$ref" : "#/components/schemas/XOfFormA" > }, { > "$ref" : "#/components/schemas/XOfFormB" > } ], > "discriminator" : { > "propertyName" : "code", > "mapping" : { > "a-123" : > "#/components/schemas/org.apache.camel.openapi.model.XOfFormA", > "b-456" : > "#/components/schemas/org.apache.camel.openapi.model.XOfFormB" > } > }, > ...{code} > -- This message was sent by Atlassian Jira (v8.20.7#820007)