API reference
JsonFast exposes static methods only. Data-returning methods accept an optional $output argument (output modes).
Constants
Validation & diagnostics
| Method | Description |
|---|---|
validate() | Quick boolean check — is this valid JSON? |
inspect() | Valid/invalid plus error line and column |
analyse() | Full diagnostic with suggested repair flags |
Repair & encoding
| Method | Description |
|---|---|
repair() | Fix malformed JSON with a repair flag bitmask |
unwrap() | Peel double- or triple-encoded JSON strings |
Format
| Method | Description |
|---|---|
beautify() | Pretty-print with configurable indent |
minify() | Compact JSON or parsed value |
Path access
| Method | Description |
|---|---|
get() | Read a single dot/bracket path |
has() | Check whether a path exists |
search() | Collect values matching a wildcard path |
extract() | Read multiple paths in one call |
Transform
| Method | Description |
|---|---|
merge() | Deep-merge two documents |
diff() | Structural diff between two documents |
Schema
| Method | Description |
|---|---|
getSchema() | Infer JSON Schema from a document |
validateSchema() | Validate JSON against a schema |
applySchema() | Apply defaults and strip extra properties |
schemaDiff() | Diff two schema documents |
Global notes
- Schema validation implements a focused subset of JSON Schema (
type,required,properties,items,default) — not the full draft spec. - Path wildcards (
[*]) work insearch(), not inget(). beautify()withOUTPUT_STRINGpreserves indent; other methods return compact JSON strings.OUTPUT_OBJECTmaps JSON objects tostdClass; JSON arrays remain PHP arrays.
