Skip to content

Swagger doc.json has hard coded host to localhost:8034 #238

@defunctl

Description

@defunctl

Describe the bug
I am testing running the API through a reverse proxy domain using the microservice docker images, however the Swagger host seems to be hard coded, e.g. in doc.json:

{
  "schemes": [],
  "swagger": "2.0",
  "info": {
    "description": "",
    "title": "Peekaping API",
    "contact": {},
    "version": "0.0.44"
  },
  "host": "localhost:8034",
  "basePath": "/api/v1",
  "paths": {
...

This means I can't actually run requests through myapiurl.com/swagger/index.html because it tries to connect to localhost:8034 instead of myapiurl.com.

Database

  • postgresql

To Reproduce
Steps to reproduce the behavior:

  1. Have the API proxying through a domain, eg. https://myapiurl.com.
  2. Visit https://myapiurl.com/swagger/index.html
  3. See the base URL does not match domain.
  4. Visit https://myapiurl.com/swagger/doc.json
  5. See the host property is hard coded: "host": "localhost:8034",

Expected behavior
The Swagger Base URL should match the domain so requests can be sent using the Swagger UI to the domain instead of http://localhost:8034

Screenshots
Image

Desktop (please complete the following information):

  • OS: Linux
  • Browser: Brave
  • Version: 1.84 / Chromium 142.0.7444.176

Additional context
None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions