Download the PHP package swaggest/json-cli without Composer
On this page you can find all versions of the php package swaggest/json-cli. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download swaggest/json-cli
More information about swaggest/json-cli
Files in swaggest/json-cli
Package json-cli
Short Description JSON CLI tool (diff, rearrange, pretty print, minify, yaml convert, etc...)
License MIT
Informations about the package json-cli
JSON CLI multitool
A CLI app to find unordered diff between two JSON
documents (based
on swaggest/json-diff
), generate JSON Schema and Go/PHP code, pretty print,
minify, yaml convert, etc....
Purpose
- To simplify changes review between two
JSON
files you can use a standarddiff
tool on rearranged pretty-printedJSON
. - To detect breaking changes by analyzing removals and changes from original
JSON
. - To keep original order of object sets (for
example
swagger.json
parameters list). - To make and apply JSON Patches, specified in RFC 6902 from the IETF.
- To convert between YAML/JSON/PHP serialization.
- To resolve
JSON Pointer
to data. - To resolve
JSON Pointer
to file position. - To validate JSON data against
JSON Schema
. - To generate or update JSON Schema with instance value(s).
- To generate sample JSON value from JSON Schema.
- To
Go
structure. - To render
JSON Schema
asPHP
classes. - To render
JSON Schema
asJSDoc
type definitions. - To render
JSON Schema
asMarkdown
documentation.
Installation
Docker
json-cli
can load schema from stdin (using -
as a file path) which can be handy with docker, for example:
Composer
CLI tool
Usage
Input paths can be .json/.yaml/.yml/.serialized files, file format is detected by file extension:
.json
JSON.yaml
,.yml
YAML.serialized
PHP serialization format
Diff, make JSON Patch
from two documents
Example:
Making JSON Patch
Apply JSON Patch
to document
Rearrange JSON document to keep original order
Example:
Using with standard diff
Show difference between two JSON documents
Example:
Showing differences in JSON
mode
Pretty-print JSON document or convert between formats
Minify JSON document
Bash command to minify all JSON files in current directory.
Replace values in JSON document
Example:
Resolve JSON Pointer
to a value from document
Example:
Resolve JSON Pointer
to a position in JSON file (line:col)
Example:
Validate JSON document against JSON Schema
Example:
Generate/update JSON Schema
from instance value(s).
New or existing schema is synchronized to match data samples.
Basic example:
Advanced example:
Updates swagger.json
with actual response samples provided in dump-responses.jsonl
.
Generate Go
structure from JSON Schema
.
Go
code is built using swaggest/go-code-builder
.
Example:
Advanced example:
Generate PHP
classes from JSON Schema
.
PHP
code is built using swaggest/php-code-builder
.
Generated classes require swaggest/json-schema
package.
Advanced example:
Generate JSDoc
type definitions from JSON Schema
.
Example:
Generate Markdown
documentation from JSON Schema
.
Example:
Generate JSON
sample from JSON Schema
.
All versions of json-cli with dependencies
swaggest/json-diff Version ^3.8.3
php-yaoi/php-yaoi Version ^1
symfony/yaml Version ^3
salsify/json-streaming-parser Version ^7.0
swaggest/json-schema Version ^0.12.41
swaggest/go-code-builder Version 0.4.51
swaggest/php-code-builder Version ^0.2.41
swaggest/code-builder Version ^0.3.5
swaggest/json-schema-maker Version ^0.3.7