Code Monkey home page Code Monkey logo

helm-validation-generator's Introduction

Online version of this generator here

Comments syntax

Example of base usage

values.yaml

image: # schema: ref(ImageRef)
  pullPolicy: Always
  repository: curl
  tag: latest
replicas: 1
foo: bar # schema: skip
debugMode: false # schema: optional

values.definitions.json

{
  "ImageRef": {
    "type": "object",
    "properties": {
      "pullPolicy": {
        "type": "string",
        "enum": ["Always", "IfNotPresent"]
      },
      "repository": { "type": "string" },
      "tag": { "type": "string" }
    },
    "required": ["pullPolicy", "repository", "tag"]
  }
}

values.schema.json

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "debugMode": {
          "oneOf": [ { "type": "boolean" } ]
        },
        "image": {
          "oneOf": [ { "$ref": "#/$defs/ImageRef" } ]
        },
        "replicas": {
          "oneOf": [ { "type": "number" } ]
        }
      },
      "required": [ "image", "replicas" ],
      "additionalProperties": false
    }
  ],
  "$defs": {
    "ImageRef": {
      "type": "object",
      "properties": {
        "pullPolicy": {
          "type": "string",
          "enum": [ "Always", "IfNotPresent" ]
        },
        "repository": { "type": "string" },
        "tag": { "type": "string" }
      },
      "required": [ "pullPolicy", "repository", "tag" ]
    }
  }
}

Control comments:

  • skip: Skip this part of YAML.
  • ref($DEFINITION): Replace this part of YAML to alredy defined definition.
  • optional: Mark as optional
  • deprecated($COMMENT): Mark as deprecated

TODO: Show some options as deprecated

https://github.com/search?q=repo%3Aredhat-developer%2Fyaml-language-server%20deprecation&type=code

helm-validation-generator's People

Contributors

zbitname avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.