Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip with Schema Generation #73

Open
jl-beast opened this issue Aug 24, 2023 · 5 comments
Open

Skip with Schema Generation #73

jl-beast opened this issue Aug 24, 2023 · 5 comments
Assignees
Labels
on-hold Issues that we need to work on

Comments

@jl-beast
Copy link

For some Params, I want to skip with Schema Generation as I use this with KubeApps. I want to only show values in the values.schema.json that are useful or desirable to have be set by customers, while still providing documentation.

The goal is to have people be able to easily spin up an easy chart that only shows values that are important and let the configuration done for more rare things be conducted inside a direct yaml editor.

@kuisathaverat
Copy link
Contributor

We have a similar use case. When we configure the helm values, we set the default values, and the rest are marked as @skip because they are nullable. In the following example, stack.mode is not added to the schema, but it is to the documentation. This makes the schema incomplete to use it in VSCode # yaml-language-server: $schema=./docs/schema.json

## @section stack Configuration for the deployment
## @param stack.mode [string, nullable] way to deploy
## @param stack.version version of the stack
stack:
  version: 8.10.3
## Parameters

### stack Configuration for the deployment

| Name            | Description          | Value       |
| --------------- | -------------------- | ----------- |
| `stack.mode`    | way to deploy        | `undefined` |
| `stack.version` | version of the stack | `8.10.3`    |
{
    "title": "Chart Values",
    "type": "object",
    "properties": {
        "stack": {
            "type": "object",
            "properties": {
                "version": {
                    "type": "string",
                    "description": "version of the stack",
                    "default": "8.10.3"
                }
            }
        }
    }
}

@fmulero fmulero self-assigned this Oct 20, 2023
@fmulero
Copy link
Contributor

fmulero commented Oct 20, 2023

Hi @jl-beast and @kuisathaverat.

We have released version 2.6.0 and now modifiers also apply to schema generation. Could you please give it a try to check if your issues are solved with that version?

@kuisathaverat
Copy link
Contributor

I have to review it with the real YAML I have because some of the default values disappeared with the new version. With a tiny example seems to work fine.

## @section stack Configuration for the deployment
## @param stack.mode [string, nullable] way to deploy
## @param stack.version version of the stack
## @param stack.elasticsearch.image image to use for elasticsearch
stack:
  version: 8.10.3
  elasticsearch:
    image: docked.example.com/elasticsearch:8.10.3
{
    "title": "Chart Values",
    "type": "object",
    "properties": {
        "stack": {
            "type": "object",
            "properties": {
                "version": {
                    "type": "string",
                    "description": "version of the stack",
                    "default": "8.10.3"
                },
                "elasticsearch": {
                    "type": "object",
                    "properties": {
                        "image": {
                            "type": "string",
                            "description": "image to use for elasticsearch",
                            "default": "docked.example.com/elasticsearch:8.10.3"
                        }
                    }
                }
            }
        }
    }
}
# Cluster Configuration

## Parameters

### stack Configuration for the deployment

| Name                        | Description                    | Value                                     |
| --------------------------- | ------------------------------ | ----------------------------------------- |
| `stack.mode`                | way to deploy                  | `undefined`                               |
| `stack.version`             | version of the stack           | `8.10.3`                                  |
| `stack.elasticsearch.image` | image to use for elasticsearch | `docked.example.com/elasticsearch:8.10.3` |

@kuisathaverat
Copy link
Contributor

kuisathaverat commented Oct 24, 2023

If you pass the type the schema does not have the default and the markdown is not generated

## @param version [string] Version of app (default: 0.5.0)
version: 0.5.0
{
    "title": "Chart Values",
    "type": "object",
    "properties": {
        "version": {
            "type": "string",
            "description": "Version of app (default: 0.5.0)",
            "default": "\"\""
        }
    }
}
# Cluster Configuration

## Parameters

If you remove the type the schema is correct bit the markdown is not

## @param version Version of app (default: 0.5.0)
version: 0.5.0
{
    "title": "Chart Values",
    "type": "object",
    "properties": {
        "version": {
            "type": "string",
            "description": "Version of app (default: 0.5.0)",
            "default": "0.5.0"
        }
    }
}
# Cluster Configuration

## Parameters

@github-actions github-actions bot assigned fmulero and unassigned fmulero Nov 29, 2023
@fmulero
Copy link
Contributor

fmulero commented Mar 12, 2024

Sorry for my very late response.

I've just created an internal task to fix this issue

@fmulero fmulero added the on-hold Issues that we need to work on label Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on-hold Issues that we need to work on
Projects
None yet
Development

No branches or pull requests

3 participants