Skip to content

Commit 947170e

Browse files
committed
improve docs
Signed-off-by: Utkarsh Srivastava <[email protected]>
1 parent 3cb700a commit 947170e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

README.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is a very basic node based CLI for converting OpenAPI schema to JSON Schema
44

55

66
```
7-
Usage: openapi-jsonschema [options]
7+
Usage: kubeopenapi-jsonschema [options]
88
99
Options:
1010
-t, --type [type] set type of input, can be either yaml or json (default: "yaml")
@@ -14,6 +14,7 @@ Options:
1414
-o [output-format] output format (default: "json")
1515
--o-filter [output-filter] output filter query
1616
--silent skip output (default: false)
17+
--resolve [resolve-filter] root of the OpenAPI spec to resolve the $ref. It is important to note that this jsonpath MUST evaluate to one object (default: "")
1718
-h, --help display help for command
1819
```
1920

@@ -22,9 +23,18 @@ Options:
2223
Download the binaries from the github releases. Only linux-x64, darwin-x64 and windows-x64 binaries are released
2324

2425
```bash
25-
openapi-jsonschema --location ./istio.yaml -t yaml --filter '$[?(@.kind=="CustomResourceDefinition" && @.spec.names.kind=="EnvoyFilter")]..validation.openAPIV3Schema.properties.spec' -o yaml --o-filter '$[0]'
26+
kubeopenapi-jsonschema --location ./k8s.json -f '$.definitions' -t json --o-filter '$[0][?(@["x-kubernetes-group-version-kind"][0].kind=="Deployment")].properties.spec' --resolve "$"
2627
```
2728

29+
The above will consume kubernetes open API schema and will produce schema for Kubernetes `Deployment`
30+
31+
32+
```bash
33+
kubeopenapi-jsonschema --location ./istio.yaml -t yaml --filter '$[?(@.kind=="CustomResourceDefinition")]..schema.openAPIV3Schema.properties.spec' --o-filter '$'
34+
```
35+
36+
The above will consume istio CRD manifest and will produce schema for all of the CustomResourceDefinition objects
37+
2838
<div>&nbsp;</div>
2939

3040
## Join the service mesh community!

0 commit comments

Comments
 (0)