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

How is invalid/non-well-formed JSON handled while parsing #9

Closed
trieloff opened this issue Jul 26, 2021 · 3 comments
Closed

How is invalid/non-well-formed JSON handled while parsing #9

trieloff opened this issue Jul 26, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@trieloff
Copy link

Great to see another JSON parser for AssemblyScript. When dealing with JSON from external sources, it would be great to have some examples to see how erroneous JSON is handled. In particular:

  • non-JSON, e.g. a missing } somewhere
  • JSON with extraneous fields compared to the declared type
  • JSON with mismatching fields compared to the declared type
@trieloff
Copy link
Author

See also: near/assemblyscript-json#225 – similar problem there

@JairusSW
Copy link
Owner

JairusSW commented Jul 26, 2021

Ah, yes. I'm going to try to do this.
I'll get back as soon as its done! 😄

@JairusSW JairusSW reopened this Jul 26, 2021
@JairusSW JairusSW reopened this Jan 2, 2023
@JairusSW
Copy link
Owner

JairusSW commented Jan 2, 2023

Maybe using a https://github.com/MaxGraey/as-option here or implement rust-like Result<T>?

@JairusSW JairusSW self-assigned this Jan 2, 2023
@JairusSW JairusSW added the enhancement New feature or request label Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants