Search code examples
swaggerswagger-editor

Swagger Local Editor change Service host/port


I want to use the Swagger editor to test my REST service deployed with Grizzly. My service is on a different port (8081) then the Swagger editor (8080). How can I tell the editor (local or online) to use another port?

Thanks


Solution

  • Found the answer, haven't tested it yet:

    Under the swagger object, there's a fixed field called host:

    The host (name or ip) serving the API. This MUST be the host only and does not include the scheme nor sub-paths. It MAY include a port. If the host is not included, the host serving the documentation is to be used (including the port). The host does not support path templating.

    taken from: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md