Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2017.2.0
    • Component/s: None
    • Labels:
      None

      Description

      If an JAX-RS application provides a custom path for restful apis with @ApplicationPath("myapi") there is no possibility to set the corresponding "basePath" property in the swagger.json.

      Example:
      How it is
      My restful -> /example/test
      BasePath -> myapi
      Combined -> localhost:8080/myapi/example/test

      How swagger displays it
      My restful -> /example/test
      BasePath -> /
      Combined -> localhost:8080/example/test

      { "swagger" : "2.0", "basePath" : "/" <-- this must be editable }

      Result from this bug is, that the swagger request are not working due to invalid URLs.

      Dont confuse the "basePath" property which is inside the swagger.json with the path where the swagger.json lays. The swagger.json is at the correct path "/myapi/swagger.json". Meant by this ticket is the property inside the file.

      From my point of view the "setContextRoot" is intended to solve this but doesnt work:

      SwaggerArchive archive = deployment.as(SwaggerArchive.class);
          archive.setTitle("Wildfly Swarm Swagger Example");
          archive.setVersion("1.0.0");
          archive.setContextRoot("myapi");
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  harrol Harro Lissenberg
                  Reporter:
                  pcbaecker Philipp Baecker
                • Votes:
                  3 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: