Skip to content
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

Request member collision #2792

Merged
merged 2 commits into from
Dec 14, 2023
Merged

Request member collision #2792

merged 2 commits into from
Dec 14, 2023

Conversation

sbiscigl
Copy link
Contributor

Description of changes:

Duplicate of a existing PR with a bug fix on top. Original PR

From the original PR

We do this beacuse the C++ SDK has a design flaw: Model fields and request fields are mixed
in a single object. Practically this means that if a request has a field called headers, the SDK will
generate a method called GetHeaders, which clashes with the GetHeaders method to get access to the
HTTP request headers.
This method will substitute headers for headerValues so we end up with a GetHeaderValues
method. This is still going to be confusing for the end user but it's the best I can think of right now.

From that PR we had a conversation and noticed serveral things. First we changed the PR to capture more member values that might collide on request objects, and realized that api gateway has a entire custom generator to get around what the issue was. So making a general case can remove this customization in the future and prevent further customizations.

This also revealed a current bug where location name was not getting set correctly for the renaming of shapes in json services, that revealed deserialization of GetGeneratedPolicyResult.cpp was actually broken because of the rename.

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

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

@sbiscigl sbiscigl marked this pull request as ready for review December 14, 2023 21:17
@sbiscigl sbiscigl merged commit 3ed4bd1 into main Dec 14, 2023
4 checks passed
@sbiscigl sbiscigl deleted the request-member-collision branch December 14, 2023 21:17
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.

3 participants