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

Merged
merged 1 commit into from
Jan 20, 2025

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!

@lerenn
Copy link
Owner

lerenn commented Jan 20, 2025

Oh sorry ! Thanks for reminding me, I'll a look at this ASAP

Didn't know why I didn't get the notification..

@lerenn lerenn self-assigned this Jan 20, 2025
@lerenn lerenn merged commit e9a7410 into lerenn:main Jan 20, 2025
5 checks passed
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