[ https://issues.apache.org/jira/browse/NIFI-4328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16144188#comment-16144188 ]
Matt Gilman commented on NIFI-4328: ----------------------------------- I totally agree with the asset here. I'm wondering if the particular version of swagger we're currently using does not handle recursive models well. Will need to investigate updating the swagger dependency and ensure it's still compatible with the swagger-maven-plugin. When this was initially added, there were some compatibility issues as Swagger just releasing the 2.0 specification and a lot of the tooling was still catching up. > Invalid swagger.json generated from > ControllerServiceReferencingComponentDTO#referencingCompoents > ------------------------------------------------------------------------------------------------- > > Key: NIFI-4328 > URL: https://issues.apache.org/jira/browse/NIFI-4328 > Project: Apache NiFi > Issue Type: Bug > Affects Versions: 1.3.0, 1.4.0 > Reporter: Michael Werle > > The referencingComponents field in > {{nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ControllerServiceReferencingComponentDTO.java}} > field generates the following lines in swagger.json: > {code:javascript} > "ControllerServiceReferencingComponentDTO" : { > "properties" : { > //... (omitted for brevity) > "referencingComponents" : { > "description" : "If the referencing component represents a > controller service, these are the components that reference it.", > "$ref" : "#/definitions/Set" > } > } > } > {code} > Which causes this invalid object definition: > {code:javascript} > "Set" : { > "properties" : { > "empty" : { > "type" : "boolean", > "default" : false > } > } > } > {code} > It is not clear how to fix the annotation, but the generated swagger.json > should be: > {code:javascript} > "ControllerServiceReferencingComponentDTO" : { > "properties" : { > //... (omitted for brevity) > "referencingComponents" : { > "type" : "array", > "description" : "If the referencing component represents a > controller service, these are the components that reference it.", > "uniqueItems" : true, > "items" : { > "$ref" : > "#/definitions/ControllerServiceReferencingComponentEntity" > } > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)