-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Improve checked JSON casting #9994
Comments
Blocked on #9994, tests will fail until this
Blocked on #9994, tests will fail until this
Hey! Thank you! |
Hey @haenoe, great to hear! As the Nix core team is very busy, feel free to tag me when you open a PR, I'll review your changes. You can check the PR linked in the description above to see where to start, and the API docs of the json library were using to find out how to implement the desired changes. |
Thank you for being so kind and welcoming - you seriously made my week!! I hope I'm on the right track here.. :D |
Oh I have been hunting for GSoC merge derivation proposition and reading the 'derivations.c'. It lead me here. So it looks like this one also relates to the restructuring of the JSON? |
@stablejoy Not really. This is only about improving error messages and type safety. |
@stablejoy I think it is OK to make part of a GSOC project with those things. It makes sense to improve JSON formats and improve infra about JSON formats at the same time. Indeed #9995, which is blocked on this issue, has notes from Nix team meeting (which I missed) about that it should be accompanied with updates to the JSON guidelines. |
OTOH #10087 has already started it and should be done soon :) |
In #8760, @iFreilicht added an
ensureType
function to improve our errors for JSON decoding ill-formed values. The errors our indeed better, but using it is cumbersome because has to remember to always first callensureType
with the right type, and then do the actual cast.To make things a bit easier I propose this interface change:
It would be very nice if someone could change this interface (and update the current usages of
ensureType
to use these new functions instead).The text was updated successfully, but these errors were encountered: