-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix how path variables are escaped for Swagger #5246
Conversation
According to the internal slack thread, the translation of the following string should be, Source: /Batchs(Material=''{Material}'',Batch=''{Batch}''): Expected:, "/Batchs\(Material='(?<Material>[^\/]+)',Batch='(?<Batch>[^\/]+)'\)$" Actual:, "/Batchs\\(Material=''(?<Material>[^\\/]+)'',Batch=''(?<Batch>[^\\/]+)''\\)$" |
@marckong this was an issue with the UI, I fixed it. Can you please review? Thanks |
Source: Expected:, Actual:, |
paths in swagger are not correctly escaped and won't be correct. You can try with following swagger: openapi: 3.0.0 info: title: SampleAPI version: "1.0" tags: - description: Sample API name: Sample Echo API paths: /healthcheck/$echo: get: parameters: - in: query name: message required: true schema: type: string description: The echo message responses: "200": description: An echo message. summary: Return a echo message. operationId: getEcho tags: - Generate echo message /batchs(Material='{Material}',Batch='{Batch}'): get: parameters: - in: path name: Material required: true schema: type: string description: The echo message - in: path name: Batch required: true schema: type: string description: The echo message responses: "200": description: An echo message. summary: Return a echo message. operationId: getBatch tags: - Generate echo message servers: - url: https://httpbin.org/anything
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is minimal. I tested out all the examples except those that don't meet openapi spec requirements, which failed to generate deck (happen in the develop branch too)
changelog(Fixes): Fixed an issue where Path variables weren't properly escaped for Swagger specs
paths in swagger are not correctly escaped and won't be correct. You can try with following swagger: