Skip to content

Swagger unable to make exemplary requests to prefixed Gitea instance #3499

Closed
@0rzech

Description

@0rzech
  • Gitea version (or commit ref): 1.3.2
  • Git version: Not relevant
  • Operating system: Not relevant
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
    • Not relevant
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No, because it's installed in its own domain
    • Not relevant
  • Log gist: Not relevant

Description

When Gitea is not installed in its own domain (eg. git.example.com), but is prefixed instead (eg. example.com/git), the Swagger UI is unable to make exemplary curl requests.

URLs to swagger.v1.json itself are valid - explore field has https://example.com/git/swagger.v1.json value and the same address is under [ Base URL: /api/v1 ] line.

Nevertheless, Swagger UI tries to make requests to https://example.com/api/v1/ endpoint, ignoring the /git prefix. This results with 404.

Maybe swagger.v1.json could be changed to template containing line

"basePath": "{{AppSubUrl}}/api/v1",

instead of

"basePath": "/api/v1",

so AppSubURL is not ignored, or something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions