-
Notifications
You must be signed in to change notification settings - Fork 51
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: Fix quote issue in path pattern #4634
Conversation
@@ -15,7 +15,7 @@ import { serializeSchema } from './schema'; | |||
export function serializeOperation(operation: OpenApiOperation): string { | |||
const requestBuilderParams = [ | |||
`'${operation.method}'`, | |||
`'${operation.pathPattern}'` | |||
`"${operation.pathPattern}"` |
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.
Let me check if I understood this correctly:
- there exist APIs that expect params to be passed like this:
example.com/api/entities('5')/something
- because we used single quotes for the string, the generated code looked like this
'test('{id}')'
, which is syntactically incorrect?
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.
Yes, correct
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.
The ideas some API providers have... 😒
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.
lgtm, as far as I can tell. Have you manually run this on the API the author of the issue found the problem on?
Yes, it generates successfully now. |
Closes SAP/cloud-sdk-backlog#4572
Fixes error in generating open api client. Api having path format
/path('{param}')/{id}
result in syntax error when client is generated. Generation fails with:ErrorWithCause: Could not write file...