-
Notifications
You must be signed in to change notification settings - Fork 17
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
Bd/fix path param ordering #100
Bd/fix path param ordering #100
Conversation
Generate changelog in
|
src/commands/generate/__tests__/resources/services/outOfOrderPathService.ts
Show resolved
Hide resolved
@@ -222,3 +229,13 @@ function mediaType(conjureType?: IType) { | |||
} | |||
return "MediaType.APPLICATION_JSON"; | |||
} | |||
|
|||
function parsePathParamsFromPath(httpPath: string): string[] { |
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.
perhaps we could use a regex like https://github.com/palantir/conjure-typescript-runtime/blob/develop/packages/conjure-client/src/fetchBridge/fetchBridge.ts#L166 to extract the path params?
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.
so I could replace this method with
[... httpPath.matchAll(/\{([^:\}]+)([:]*[^\}]*)\}/g)].map(x => x[1])
but not convinced that's easier to read
@ferozco could you help fix the changelog? I don't have the ability to edit the bot's comment |
Fixes #99
Possible downsides?
Fix isn't super pretty.
Part of me wonders whether this should actually end up being a conjure-ir spec change - whereby we assert in the IR the ordering matches up.
I'm also not super happy with the munging I have to do to make the special
{thing:.+}
style path params work. Such path parameters don't show up in the conjure docs (at least not in https://palantir.github.io/conjure/#/docs/spec/conjure_definitions?id=path-parameters) but are part of the test suite.