-
Notifications
You must be signed in to change notification settings - Fork 575
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
Get line and column number on valid JSON? #637
Comments
I recently wrote
That said, it seems to be working OK for my use cases - maybe give it a whirl? Basically, you just wrap anything you want a span of with json_spanned_value::Spanned<...>. You can stick them in I've got an examples/demo.rs using |
Since
|
I'm encoutering a similar issue where I want to parse a JSON document while keeping track of source locations. serde_spanned from the toml crate is probably the best start; but I 100% agree that a (line, column) pair would help a lot for UI, on top of the byte offset. |
I'm currently parsing JSON data and validating its input and if there is invalid input I'll display the error message to the user.
I can't just use
Deserializer
trait because to validate these input I need to populate external data first.The text was updated successfully, but these errors were encountered: