Uploaded image for project: 'WildFly WIP'
  1. WildFly WIP
  2. WFWIP-695

MicroProfile OpenAPI generation and multiple deployments: .externalDocs discordant values are not sourced from microprofile-config-smallrye properties

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Blocker Blocker
    • MP OpenAPI
    • None
    • Hide

      1. Build the WildFly snapshot based on the feature branch:

      • git clone git@github.com:pferraro/wildfly.git
      • cd wildfly
      • git checkout openapi
      • mvn clean install -DskipTests

      2. Run the tests

      • git clone git@github.com:fabiobrz/eap-microprofile-test-suite.git
      • cd eap-microprofile-test-suite
      • git checkout issue-344.mp-openapi-multi-war
      • mvn clean verify -pl microprofile-open-api -am -Djboss.dist=<WILDFLY_SNAPSHOT_BUILD_DIRECTORY> -Dtest=ProcessingRulesWithResolvedConflictsTest
      Show
      1. Build the WildFly snapshot based on the feature branch: git clone git@github.com:pferraro/wildfly.git cd wildfly git checkout openapi mvn clean install -DskipTests 2. Run the tests git clone git@github.com:fabiobrz/eap-microprofile-test-suite.git cd eap-microprofile-test-suite git checkout issue-344.mp-openapi-multi-war mvn clean verify -pl microprofile-open-api -am -Djboss.dist=<WILDFLY_SNAPSHOT_BUILD_DIRECTORY> -Dtest=ProcessingRulesWithResolvedConflictsTest
    • User Experience

      Two deployments configure discordant values for externalDocs, i.e.: one of them has it defined by a static openapi.yaml file, while the other uses a OASModelReader custom instance to initialize the OpenAPI model with a custom value for externalDocs and also deploys a REST resource class which is annotated with @ExternalDocumentation.
      This results in the final OpenAPI documentation to have an empty externalDocs element, because of discordant values.

      According to the feature implementation documentation, such conflict should be resolved by sourcing the value from properties set in the microprofile-config-smallrye subsystem, but this does not happen, despite the following server configuration seems to be valid at runtime:

      <subsystem xmlns="urn:wildfly:microprofile-config-smallrye:2.0">
                  <config-source name="props">
                      <property name="mp.openapi.extensions.server.default-server.host.default-local.externalDocs.url" value="http://system-property-based-local-service-router-external-docs.org"/>
                      <property name="mp.openapi.extensions.server.default-server.host.default-local.externalDocs.description" value="System property based Local Service Router external documentation"/>
                  </config-source>
              </subsystem>
      

              pferraro@redhat.com Paul Ferraro
              fburzigo@redhat.com Fabio Burzigotti
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: