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

Null value causes incorrect error "property not found" #397

Closed
rhtenhove opened this issue Mar 11, 2024 · 1 comment
Closed

Null value causes incorrect error "property not found" #397

rhtenhove opened this issue Mar 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@rhtenhove
Copy link
Contributor

rhtenhove commented Mar 11, 2024

Using today's dasel:2-alpine image (dasel version v2.6.0)

I use dasel to parse settings from the GitLab Project API. Today, for the first time, I received an error that a property was not found in the API output. Upon further inspection, the value for that property turned out to be null instead of missing.

I am not sure if this was changed by GitLab by returning null if the setting is unset, instead of the default boolean. Either way, I would expect dasel to return the value, null, instead of failing with the incorrect feedback that the key is missing.

How to reproduce:

$ echo '{"iamnull": null}' | dasel -r json "iamnull"
Error: could not access map index: property not found: iamnull
@rhtenhove rhtenhove added the bug Something isn't working label Mar 11, 2024
@TomWright
Copy link
Owner

Hey @rhtenhove,

This looks like a duplicate of #346.

I'm going to close this in favour of the other issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants