-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Prevent escaping html in path params? #1637
Comments
take a look here: You'll have to undo that commit. It's not a configuration, but we could make it so with a PR if you'd like to tackle it. |
sorry for a late comment but we had the same problem and I want to share the solution. |
were you able to solve this issue? |
This should no longer be an issue with the new UI. |
I have downloaded swagger-ui-3.4.4, but I am still running into this problem. |
@webron can correct me as he loves to do, but I think what you're after is illegal in the OAS specification. Allowing a forward slash in your path parameter will effectively create a new operation (in the OAS world) and make your request indeterministic. So I don't expect that you'll get this addressed in swagger-ui. I think in the 2.x branch there was a hack that allowed people to do this--it did make the behavior illegal wrt the spec though. |
I dont necessarily need user to input a slash ; I would have a text that goes like this on the textbox by default; Where the accountName value can be changed by the user to query the specific ones. At the moment, when I hit the execute button, this text box value translates to %7Bparam0%3A%7B'accountName'%3A'sample'%7D Any workarounds will be really helpful |
@SriramZafin it would be better if you filed a new ticket, following the issue template to provide the details. |
Created this ticket , please have a look |
I'm using swagger via the built in threescale (api service provider) stuff, so I'm not sure which ui version that maps to. I'm telling my code to generate swagger 2.0.
I've got a REST entry point that takes an "itemID" parameter and that ID has forward slash (/) characters in it. It looks something like this: 2015/09/30/14/41/18/681/mfq15U. I've defined the @path regex to interpret that as one param, not a bunch of little ones.
The problem is when I use the Swagger UI and put 2015/09/30/14/41/18/681/mfq15U into the "itemId" text box then click "Try it out!", it html escapes all the / characters and ends up creating an invalid request that looks like:
Whereas I need it to look like this:
Is there some way I can configure swagger UI to not escape those characters?
The text was updated successfully, but these errors were encountered: