-
Notifications
You must be signed in to change notification settings - Fork 292
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
Creating a Dynamic
with property default
set produces a broken object
#561
Labels
Comments
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. |
This actually doesn't just affect JSON/YAML parsing. It also affects
|
json.Parser
should throw an error when useMapping = false
and key "default" is encounteredDynamic
with property default
set produces a broken object
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:
This similarly affects
yaml.Parser.parse()
andMap.toDynamic()
.The text was updated successfully, but these errors were encountered: