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

fix(go-runtime): enums are not encoded/decoded correctly #2585

Merged
merged 3 commits into from
Feb 17, 2021

Conversation

eladb
Copy link
Contributor

@eladb eladb commented Feb 17, 2021

Enum values are represented in the jsii kernel as { "$jsii.enum": "fqn/member" }, so we need to marshal/unmarshall them based on this encoding.

Change the type registry to capture a mapping between FQN to enum member consts and type to enum FQNs.

Fixes #2534
Co-authored-by: Romain Marcadier rmuller@amazon.com


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Enum values are represented in the jsii kernel as `{ "$jsii.enum": "fqn/member" }`, so we need to marshal/unmarshall them based on this encoding.

Change the type registry to capture a mapping between FQN to enum member consts and type to enum FQNs.
@mergify
Copy link
Contributor

mergify bot commented Feb 17, 2021

The title of this Pull Request does not conform with [Conventional Commits] guidelines. It will need to be adjusted before the PR can be merged.
[Conventional Commits]: https://www.conventionalcommits.org

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Feb 17, 2021
@eladb eladb changed the title fix(go): enums are not encoded/decoded correctly fix(go-runtime): enums are not encoded/decoded correctly Feb 17, 2021
@RomainMuller RomainMuller added bug This issue is a bug. effort/small Small work item – less than a day of effort language/go Regarding GoLang bindings module/runtime Issues affecting the `jsii-runtime` labels Feb 17, 2021
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-6Jw05QLuWWwe
  • Commit ID: d0ae6aa
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Feb 17, 2021

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

@mergify mergify bot added the pr/ready-to-merge This PR is ready to be merged. label Feb 17, 2021
@mergify mergify bot merged commit 4731aeb into main Feb 17, 2021
@mergify mergify bot deleted the benisrae/fix-enums branch February 17, 2021 12:08
@mergify
Copy link
Contributor

mergify bot commented Feb 17, 2021

Merging (with squash)...

This was referenced Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. contribution/core This is a PR that came from AWS. effort/small Small work item – less than a day of effort language/go Regarding GoLang bindings module/runtime Issues affecting the `jsii-runtime`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

go: enums not working - Expected enum value, got "<string>"
3 participants