Skip to content

JS Bundle fetch URL is not Context-path aware #3108

@JayShankar-Vetlyf

Description

@JayShankar-Vetlyf

Describe the bug

In a Spring-boot application , if the server is running with context path /context, then the JS Bundle URL path is malformed i.e. it doesn't include the context path & hence it doesn't load properly.

To Reproduce
Steps to reproduce the behavior:

  • What version of spring-boot you are using? - JAVA : 17 , spring-boot : 3.5.6
  • What modules and versions of springdoc-openapi are you using? - springdoc-openapi-starter-webmvc-scalar : 2.8.13
  • What is the actual and the expected result using OpenAPI Description (yml or json)? - The Scalar API URL doesn;t load due to incorrect JS fetch path
  • Provide with a sample code (HelloController) or Test that reproduces the problem - My configuration is:
# Documentation configuration
springdoc:
  api-docs:
    path: /api-docs
  swagger-ui:
    path: /swagger-ui.html
    operationsSorter: method
    tagsSorter: alpha
  show-actuator: false

scalar:
  enabled: ${SCALAR_DOCS_ENABLED:true}
  url: /api-docs
  path: /docs

Expected behavior

  • The JS Path URL should be resolved correctly (i.e. it should include /context in the URL

Screenshots

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    incompleteincomplete description: Make sure you Provide a Minimal, Reproducible Example - with HelloController

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions