Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksandar Stojanov <[email protected]>
  • Loading branch information
losisin committed Jun 3, 2024
1 parent 21f5298 commit d4bbc89
Showing 1 changed file with 50 additions and 1 deletion.
51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,15 @@ usage: helm schema [-input STR] [-draft INT] [-output STR]
-indent int
Indentation spaces (even number) (default 4)
-input value
Multiple yamlFiles as inputs (comma-separated)
Multiple yaml files as inputs (comma-separated)
-output string
Output file path (default "values.schema.json")
-schemaRoot.description string
JSON schema description
-schemaRoot.id string
JSON schema ID
-schemaRoot.title string
JSON schema title
```

### Basic
Expand Down Expand Up @@ -207,6 +213,49 @@ Output will be something like this:
}
```

Adding ID, title and description to the schema:

`basic.yaml`

```yaml
image:
repository: nginx
tag: latest
pullPolicy: Always
```

```bash
$ helm schema -input basic.yaml -schemaRoot.id "https://example.com/schema" -schemaRoot.title "My schema" -schemaRoot.description "This is my schema"
```

Generated schema will be:

```json
{
"$id": "https://example.com/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "This is my schema",
"properties": {
"image": {
"properties": {
"pullPolicy": {
"type": "string"
},
"repository": {
"type": "string"
},
"tag": {
"type": "string"
}
},
"type": "object"
}
},
"title": "My schema",
"type": "object"
}
```

## Issues, Features, Feedback

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!
Expand Down

0 comments on commit d4bbc89

Please sign in to comment.