Closed MarvinVaillant closed 3 months ago
Hi @MarvinVaillant , thanks for reaching out!
Embedding HTML in API specification files, such as OpenAPI files, is generally considered a bad practice - API specs should focus on describing the API’s functionality, endpoints, parameters, and responses, while HTML, on the other hand, deals with presentation and user interaction.
The id attribute is removed from the h3 element, due to Developer Portal's restrictions - introducing an element with an 'id' attribute may interfere with the Developer Portal's logic. Hence, we only allow a few attributes that may be needed for styles.
Can you please share why you need something like this? Is there anything that we can improve about the API Details widget that may help in your situation?
Hey @malincrist, thanks for the response.
Some of our API specs contain extensive descriptions. That's why we often use links to other sections of the description or create table of contents. Is there any other way we could achieve this?
In this case, I believe you should be able to achieve this behavior with custom widgets. (more info here) You could implement a widget to replace the default API: Details widget. Hope this helps!
Please log managed portal issues to Azure support team using Support + Help link in Azure portal and select Problem Type = Developer portal.
Please log managed portal issues to Azure support team using Support + Help link in Azure portal and select Problem Type = Developer portal.
Bug description
Using internal HTML links for navigation within an OpenAPI spec leads "No operation selected." message in
api-details
/operation-details
widgets.Reproduction steps
api-list (Dropdown)
widge, aapi-details
widget andoperation-details
widgetoperation-details
widget is "No operation selected"api-details
widget is "the specific api does not exist"Expected behavior
Clicking on internal links scrolls the page to the referenced heading.
Is your portal managed or self-hosted?
Managed
Environment
Additional context
Seems like currently URI fragment (part behind the
#
) is used to select specified api and operation. After selecting an API the URI look likehttps://<domain>/<path>#api=test-api&operation=test-operation
. Once we click on the link in the OpenAPI spec, the URI looks like thishttps://<domain>/<path>#overview
.Also the following screenshot shows that the![image](https://github.com/Azure/api-management-developer-portal/assets/146710076/425b68f1-5bc9-4912-9598-2af0ac8a4fb2)
id
attribute is removed from theh3
element and therefore link cannot work.