Skip to content

Commit d4bbc89

Browse files
committed
add docs
Signed-off-by: Aleksandar Stojanov <me@fnd.works>
1 parent 21f5298 commit d4bbc89

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

README.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,15 @@ usage: helm schema [-input STR] [-draft INT] [-output STR]
9595
-indent int
9696
Indentation spaces (even number) (default 4)
9797
-input value
98-
Multiple yamlFiles as inputs (comma-separated)
98+
Multiple yaml files as inputs (comma-separated)
9999
-output string
100100
Output file path (default "values.schema.json")
101+
-schemaRoot.description string
102+
JSON schema description
103+
-schemaRoot.id string
104+
JSON schema ID
105+
-schemaRoot.title string
106+
JSON schema title
101107
```
102108

103109
### Basic
@@ -207,6 +213,49 @@ Output will be something like this:
207213
}
208214
```
209215

216+
Adding ID, title and description to the schema:
217+
218+
`basic.yaml`
219+
220+
```yaml
221+
image:
222+
repository: nginx
223+
tag: latest
224+
pullPolicy: Always
225+
```
226+
227+
```bash
228+
$ helm schema -input basic.yaml -schemaRoot.id "https://example.com/schema" -schemaRoot.title "My schema" -schemaRoot.description "This is my schema"
229+
```
230+
231+
Generated schema will be:
232+
233+
```json
234+
{
235+
"$id": "https://example.com/schema",
236+
"$schema": "https://json-schema.org/draft/2020-12/schema",
237+
"description": "This is my schema",
238+
"properties": {
239+
"image": {
240+
"properties": {
241+
"pullPolicy": {
242+
"type": "string"
243+
},
244+
"repository": {
245+
"type": "string"
246+
},
247+
"tag": {
248+
"type": "string"
249+
}
250+
},
251+
"type": "object"
252+
}
253+
},
254+
"title": "My schema",
255+
"type": "object"
256+
}
257+
```
258+
210259
## Issues, Features, Feedback
211260

212261
Your input matters. Feel free to open [issues](https://github.com/losisin/helm-values-schema-json/issues) for bugs, feature requests, or any feedback you may have. Check if a similar issue exists before creating a new one, and please use clear titles and explanations to help understand your point better. Your thoughts help me improve this project!

0 commit comments

Comments
 (0)