Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-19925

openapi-java not showing full url server

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Information Provided
    • 3.20.5
    • None
    • camel-openapi-java
    • None
    • Apache Camel : 3.20.5

      SpringBoot: 2.7.12

      JBoss Eap 7.4

    • Unknown

    Description

      I am trying to migrate API documentation from Swagger2.x to OpenApi 3.

      The documentation works fine except the url server and scheme, in the url it shows only the base path .

      Here is the API documentation in Swagger:

       

      {
          "swagger""2.0",
          "info": {
              "version""1.0.0",
              "title": "title"
          },    
          "host": "localhost:8080",
          "basePath": "/root-context/api",
          "schemes": [
              "http",
              "https"    
           ],
          "paths": { 
      ....}

       

       

      While In OpenAPI:

       

      {
          "openapi""3.0.2",
          "info": {
             "title": "title",
             "version""1.0.0"
          },
          "servers": [
              {
                  "url": "/root-context/api"
              }
          ],
          "paths": { 
               ....
          }

       

       

      Rest Cofiguration:

       

       restConfiguration()
                      .component(camelComponent)
                      .enableCORS(apiEnableCors)
                      .corsHeaderProperty("Access-Control-Allow-Methods", "POST")
                      .port(env.getProperty("server.port", "8080"))
                      .contextPath(contextPath)
                      .apiContextPath(apiDocsPath)
                      .apiProperty("schemes", "http,https")
                      .apiProperty("api.title", apiDocsTitle)
                      .apiProperty("api.version", apiDocsVersion)
                      .apiProperty("cors", apiEnableCors.toString())
                      .bindingMode(RestBindingMode.json)
                      .dataFormatProperty("prettyPrint", "true");
          }
       

      Attachments

        Issue Links

          Activity

            People

              klease78 Karen Lease
              rami15 Rami
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: