Skip to content

Conversation

@AllanZhengYP
Copy link
Contributor

@AllanZhengYP AllanZhengYP commented Apr 24, 2020

This PR is WIP

Fix a bug introduced in #158. By default the parsed endpoint will have a default path: /, which will then incorrectly override the path from operation model. By this change, the default endpoint or endpoint supplied from client constructor can only override the hostname, protocol, and port part of the request. Whereas path and query will always be generated from the model. This behavior will also be align with V2 SDK.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@AllanZhengYP AllanZhengYP force-pushed the fix-request-defaults branch from 6a7575f to 294948e Compare April 24, 2020 00:49
HttpProtocolGeneratorUtils.writeHostPrefix(context, operation);
}

writer.write("const endpoint = {...context.endpoint, path: undefined, query: undefined};");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add comments to these lines explaining why the indirection is necessary?

@AllanZhengYP AllanZhengYP changed the title fix: not to override path and query from serializer [WIP]fix: not to override path and query from serializer Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants