-
Notifications
You must be signed in to change notification settings - Fork 324
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
Suggestions on post validation line & column information? #340
Comments
Closing this issue as we found a way to handle this. If it's of any interest, it wasn't that hard, involving a few fairly simple steps.
|
@ascertrobw Your workaround makes perfect sense. I am wondering if you want to contribute to the library so that other users can enjoy it. Thanks. |
Not sure how generally applicable it will be - but happy to share the code I used. Is there an "examples" or "library" section somewhere for that, or should I just ZIP and post here? |
On a similar topic - I'm not seeing any way to get line/col information out of a ValidationMessage when a document fails validation against a schema. Which makes sense I guess, since the schema validate is also working from the converted JSON which has lost it's trace back to the original YAML source numbers. I'm unsure whether our approach would be workable for internal use, but if so then it might help bridge that gap also. |
@ascertrobw I just sent an invite to join the team. You can create a feature branch and add an example folder to show us how it works. If we can find a way to generalize it, then we merge into the library. Otherwise, it will live in the example folder for users to adopt. |
Cool, thanks, will do. I'm just chasing down the "line numbers in ValidationMessage" aspect, see if I can create an example for that also. Should hopefully be able to carve out some time to create standalone examples in the next week or two once I'm done and have got my current work off my desk. |
Example describing how to retain YAML source file location information in processed and validated JSON tree Fixes #340
A tad short of time this week to create a full worked exampled - so I've created a .MD instead which describes the scenarios and solutions |
One aspect we are really battling with.
How to log line/column information to a user for a YAML document that passes schema validation, but then fails semantic checks on the content of the JSON node tree?
Maybe we're missing something obvious here - but so far we have a multi step process:
After step 1 we have effectively lost the original source file information, so if we detect any semantic errors we can't easily report them back to the user with line/col information against the original file.
I doubt this is feasible, but I'm wondering if there couldn't be an option to include meta information in the processed JSON Node tree such as the original source positions of various nodes, which would then allow such error reporting.
The text was updated successfully, but these errors were encountered: