-
Notifications
You must be signed in to change notification settings - Fork 280
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.Parser
should throw an error when useMapping = false
and key "default" is encountered
#561
Labels
Comments
HT154
changed the title
pkl:json.Parser should throw an error when
Jun 30, 2024
useMapping = false
and key "default" is encounteredjson.Parser
should throw an error when useMapping = false
and key "default" is encountered
Fair issue; seems like a good idea to throw here instead. |
Hey, I can take this up. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The behavior as-is is very surprising! Check this out:
Result:
I think throwing an error (or at least some kind of warning) here instead of returning unexpected results is desirable. Something like "encountered object key
default
when parsing JSON, resultingDynamic
will be incomplete or invalid" might make sense.N.B.: Attempting to access the default yields further surprises:
asDynamicDefault = asDynamic.default
Result:
The text was updated successfully, but these errors were encountered: