glideapps/quicktype

Find a better JSON parser or implement our own

Open

#646 ouverte le 8 mars 2018

Voir sur GitHub
 (12 commentaires) (2 réactions) (0 assignés)TypeScript (968 forks)batch import
good first issue

Métriques du dépôt

Stars
 (10 867 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

Required features:

  • Streaming. We need to process files larger than V8 strings allow.
  • Preserve property order.
  • Good and actionable error messages. Our users often have issues with invalid JSON.
  • Recover from common errors.
  • Distinguish between integers and floating point numbers.
  • Span for each non-symbol token - line number and column of start and end.

Common errors:

  • Unquoted keys: { foo: "bar" }
  • Superfluous commas: [1, 2, 3,]
  • Wrong delimiter: [ "foo": "bar" ], { 1, 2, 3 }

Other easily recoverable errors:

  • = (or anything else) instead of : in objects: { "foo"="bar" }
  • Number format stuff, such as no digits before point (.3), leading zeros (0123), hexadecimals (0xdeadbeef)

Guide contributeur