Replies: 1 comment 8 replies
-
oops, i swear i searched the issue list before posting, but after poking around just a little bit more, i think i see evidence you all took a pass at this in #1382, but ran into issues making use of it - is getting position info working for external formats on anyone's radar at the moment? |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
tl;dr how possible is it to add line number references for records imported from json?
use case is this- we have a number of uh "organically evolved" json inputs in our environment used to describe, generally, service deployment configurations, currently only validated at runtime. over time, they've become rather beastly.
there's now a need to open these up to editing by a much larger audience, so we need to put some guardrails/validation on these json blobs. there was a first attempt using cue, and it works, but the error messages are absolutely atrocious. i'm trying to make the argument that we should use nickel for contract validation at first, using nickel itself to express these definitions eventually. i got to putting together a contract definition, and this works great- being able to customize error messages is quite nice.
however, we'll need to keep the format-of-record json for quite a while, and i've noticed that while nickel is happy to import json into a record, all line number information gets stripped off, making contract validation error messages not super useful. below is an example of output from a service definition with an intentional error:
nice to know what the problem is, but not easy to run down where the problem is without extra information and a bit of a hunt. this is a lot nicer when importing a record from a .ncl file, with line numbers and everything:
if nickel provided line info for the imported json when reporting a contract issue, i think there'd be a pretty compelling argument to use it over the other things we've been trying. how difficult would this be?
Beta Was this translation helpful? Give feedback.
All reactions