Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Anchor Links for Section Navigation in Stoplight Elements #2765

Open
sohitkumar opened this issue Jan 30, 2025 · 0 comments
Open

Comments

@sohitkumar
Copy link

sohitkumar commented Jan 30, 2025

Description:
In my project, when rendering an API documentation page using the Stoplight Element component, I encounter an issue when clicking on the section links (e.g., "Request", "Response", "Body"). The anchor link displayed on hover is incorrect.

Steps to Reproduce:

  1. Render an API documentation page with sections like Request, Response, and Body using Stoplight Elements.
  2. Click on any section link like "Request" or "Response".
  3. Notice that when hovering over "Request", the URL changes to http://localhost:4206/#Request, instead of the expected URL structure: http://localhost:4206/documentation/platform/http-apis/operations/get-todos#Request.
  4. This is in contrast to the working behavior on the Stoplight Elements demo project (https://elements-demo.stoplight.io/operations/get-todos#Request), where the section link navigation works as expected.

Expected Behavior:
The section links should generate the correct anchor URL, similar to the behavior observed in the demo project:
http://localhost:4206/documentation/platform/http-apis/operations/get-todos#Request.

Actual Behavior:
Currently, the anchor links are incorrect, resulting in URLs like http://localhost:4206/#Request.

"paths": { "/a/appx/todos": { "get": { "summary": "List Todos", "responses": { "200": { "description": "Returns a list of Todos", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Todos" } }, "examples": { "List of Todos": { "$ref": "#/components/examples/multiple-todos" } } } } }, "403": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } }, "operationId": "get-todos", "description": "Returns a list of todos\n\n*Markdown is supported in descriptions. Add information here for users to get accustomed to endpoints*", "parameters": [ { "$ref": "#/components/parameters/limit" } ], "security": [] } } }

Image

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant