You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any Path that has x- anywhere in the path name does not show up in the Swagger UI. The path does still work in the service if you make a request to it.
The stripVendorExtensions function looks for vendor extensions with the regex /\x-(.*)/ . This regex matches key names with x- positioned anywhere in the text, and removes them.
I presume that this function is run after the routes are configured (since the endpoint still works), but before the reponse content is assembled for the request from the UI to fetch swagger.json.
Solution
The OpenAPI specification says that vendor extensions are properties that start withx-, so this behavior is a bug.
The regex should be changed to this: /^\x-(.*)/
The added caret at the start causes the regex to only match keys that begin with x-, rather than matching them anywhere in the string
The text was updated successfully, but these errors were encountered:
Bug Description
Any Path that has
x-
anywhere in the path name does not show up in the Swagger UI. The path does still work in the service if you make a request to it.Example:
Cause
The stripVendorExtensions function looks for vendor extensions with the regex
/\x-(.*)/
. This regex matches key names withx-
positioned anywhere in the text, and removes them.I presume that this function is run after the routes are configured (since the endpoint still works), but before the reponse content is assembled for the request from the UI to fetch swagger.json.
Solution
The OpenAPI specification says that vendor extensions are properties that start with
x-
, so this behavior is a bug.The regex should be changed to this:
/^\x-(.*)/
The added caret at the start causes the regex to only match keys that begin with
x-
, rather than matching them anywhere in the stringThe text was updated successfully, but these errors were encountered: