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

json2: add compatibility of @[skip] in json2 #22077

Merged
merged 2 commits into from
Aug 19, 2024

Conversation

esquerbatua
Copy link
Contributor

In order to make the v version of json (x.json2) compatible with json, make the same functionality of skip working in json2

@esquerbatua esquerbatua changed the title Add compatibility of @[skip] in json2 json2: add compatibility of @[skip] in json2 Aug 19, 2024
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@spytheman spytheman merged commit 4188deb into vlang:master Aug 19, 2024
61 checks passed
@enghitalo
Copy link
Contributor

What is the difference between skip and json:"-"?

@esquerbatua esquerbatua deleted the json2skip_field branch August 19, 2024 13:04
@JalonSolov
Copy link
Contributor

Less typing?

@esquerbatua
Copy link
Contributor Author

esquerbatua commented Aug 19, 2024

What is the difference between skip and json:"-"?

Actually in json the anon @[json: '-'] (or I don't see them in the code) do not skip the field, it's new in x.json2, can be removed maybe in json2, but to keep the current functionality I didn't removed it

@JalonSolov
Copy link
Contributor

It worked in json, so needs to be supported in x.json2 for compatibility, if nothing else.

Personally, I don't know why json:'-' was added to x.json2, instead of skip.

@esquerbatua
Copy link
Contributor Author

True, it's also in json, maybe in the future we shoud remove it.

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.

4 participants