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

json: fix option state #18802

Merged
merged 3 commits into from Jul 9, 2023
Merged

json: fix option state #18802

merged 3 commits into from Jul 9, 2023

Conversation

felipensp
Copy link
Member

@felipensp felipensp commented Jul 6, 2023

This PR fixes the option state created from json module.

🤖 Generated by Copilot at 42fe8e6

This pull request enhances the JSON support in V by fixing and improving the C code generation for optional fields and elements. It also adds a new test file vlib/json/json_option_none_test.v to verify the correct decoding of JSON objects with optional fields.

🤖 Generated by Copilot at 42fe8e6

  • Add a condition to check the result state before setting the option value for JSON objects with optional fields (link). This fixes a bug where the option value could be set to a garbage value when the field is missing or invalid.

@felipensp felipensp marked this pull request as ready for review July 7, 2023 17:48
@spytheman
Copy link
Member

@felipensp, there is a conflict with the other json PR from yesterday (7fe794a).

@spytheman spytheman merged commit 8f3a175 into vlang:master Jul 9, 2023
49 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.

None yet

2 participants