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(codegen): Fix code generated with headers using --force-pointers #263

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TheSadlig
Copy link
Contributor

Related to #262:
Some of the generated code (toBrokerMessage(), brokerMessasgeTo*()) was invalid following the introduction (by me) of the --force-pointers flag., whenever headers are present in the contract.

A few notes:

  • The isFieldPointer had to be changed to circumvent an issue where some fields' IsRequired is true, but the field is not in the parent's list of required field. I decided not to investigate inside the parser, for obvious reasons.
  • I've added a nil check on toBrokerMessage on fields that are required. That same check is not really possible on brokerMessageTo* without checking missing fields afterwards. Since there are currently no validations, I didn't see it necessary at this stage

Please let me know if you have any questions

Thanks,
TheSadlig

@TheSadlig
Copy link
Contributor Author

Hi @lerenn!
Did you have any chance to take a look at this?
Thanks!

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