scottyeung opened a new issue, #35464:
URL: https://github.com/apache/superset/issues/35464

   ### Bug description
   
   ## Description
   When using Apache Superset 6.0.0rc2, the Swagger UI shows a fetch error:
   
   ```
   Fetch error
   NOT FOUND /api/v1/_openapi
   ```
   
   This happens after setting the `SUPERSET_APP_ROOT` variable in 
`superset_config.py` to a custom root path (e.g., `/analytics`).
   
   ## Steps to Reproduce
   1. Set `SUPERSET_APP_ROOT` in `superset_config.py`, for example:
   SUPERSET_APP_ROOT = "/analytics"
   
   2. Restart Superset server.
   3. Open Swagger UI, typically at `http://<host>:<port>/swagger/v1`.
   4. Observe that the Swagger UI fails to load the OpenAPI specification with 
the above fetch error.
   
   ## Expected Behavior
   Swagger UI should load OpenAPI specification from the correct prefixed path, 
including the `SUPERSET_APP_ROOT` prefix. For example, if `SUPERSET_APP_ROOT = 
"/analytics"`, Swagger should fetch `/analytics/api/v1/_openapi`.
   
   ## Actual Behavior
   Swagger UI attempts to fetch the OpenAPI spec from `/api/v1/_openapi` 
without the prefix, causing a 404 NOT FOUND error.
   
   ## Additional Information
   - The root path prefix set by `SUPERSET_APP_ROOT` modifies all API endpoints.
   - Swagger UI configuration needs adjustment to respect this root path prefix.
   - The problem is known to affect custom root path and Swagger integration.
   - Restarting Superset and reinitializing with `superset init` does not fix 
the issue alone.
   - Proxy or reverse proxy configurations (e.g., Nginx) may also need matching 
prefix adjustments.
   
   ## Possible Workarounds
   - Adjust Swagger UI base path configuration to include the root prefix.
   - Use full prefixed URLs when accessing API endpoints directly.
   - Check relevant GitHub issues on prefix routing and Swagger UI integration.
   
   ## Environment
   - Apache Superset version: 6.0.0rc2
   - Deployment method: Docker
   
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   5.0.0
   
   ### Python version
   
   3.10
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [x] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to