{
  "description": "ConsoleSample is an extension to customizing OpenShift web console by adding samples.\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": "string"
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "description": "spec contains configuration for a console sample.",
      "properties": {
        "abstract": {
          "description": "abstract is a short introduction to the sample.\n\nIt is required and must be no more than 100 characters in length.\n\nThe abstract is shown on the sample card tile below the title and provider\nand is limited to three lines of content.",
          "maxLength": 100,
          "type": "string"
        },
        "description": {
          "description": "description is a long form explanation of the sample.\n\nIt is required and can have a maximum length of **4096** characters.\n\nIt is a README.md-like content for additional information, links, pre-conditions, and other instructions.\nIt will be rendered as Markdown so that it can contain line breaks, links, and other simple formatting.",
          "maxLength": 4096,
          "type": "string"
        },
        "icon": {
          "description": "icon is an optional base64 encoded image and shown beside the sample title.\n\nThe format must follow the data: URL format and can have a maximum size of **10 KB**.\n\n  data:[<mediatype>][;base64],<base64 encoded image>\n\nFor example:\n\n  data:image;base64,             plus the base64 encoded image.\n\nVector images can also be used. SVG icons must start with:\n\n  data:image/svg+xml;base64,     plus the base64 encoded SVG image.\n\nAll sample catalog icons will be shown on a white background (also when the dark theme is used).\nThe web console ensures that different aspect ratios work correctly.\nCurrently, the surface of the icon is at most 40x100px.\n\nFor more information on the data URL format, please visit\nhttps://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs.",
          "maxLength": 14000,
          "pattern": "^data:([a-z/\\.+0-9]*;(([-a-zA-Z0-9=])*;)?)?base64,",
          "type": "string"
        },
        "provider": {
          "description": "provider is an optional label to honor who provides the sample.\n\nIt is optional and must be no more than 50 characters in length.\n\nA provider can be a company like \"Red Hat\" or an organization like \"CNCF\" or \"Knative\".\n\nCurrently, the provider is only shown on the sample card tile below the title with the prefix \"Provided by \"",
          "maxLength": 50,
          "type": "string"
        },
        "source": {
          "description": "source defines where to deploy the sample service from.\nThe sample may be sourced from an external git repository or container image.",
          "properties": {
            "containerImport": {
              "description": "containerImport allows the user import a container image.",
              "properties": {
                "image": {
                  "description": "reference to a container image that provides a HTTP service.\nThe service must be exposed on the default port (8080) unless\notherwise configured with the port field.\n\nSupported formats:\n  - <repository-name>/<image-name>\n  - docker.io/<repository-name>/<image-name>\n  - quay.io/<repository-name>/<image-name>\n  - quay.io/<repository-name>/<image-name>@sha256:<image hash>\n  - quay.io/<repository-name>/<image-name>:<tag>",
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "service": {
                  "default": {
                    "targetPort": 8080
                  },
                  "description": "service contains configuration for the Service resource created for this sample.",
                  "properties": {
                    "targetPort": {
                      "default": 8080,
                      "description": "targetPort is the port that the service listens on for HTTP requests.\nThis port will be used for Service and Route created for this sample.\nPort must be in the range 1 to 65535.\nDefault port is 8080.",
                      "format": "int32",
                      "maximum": 65535,
                      "minimum": 1,
                      "type": "integer"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                }
              },
              "required": [
                "image"
              ],
              "type": "object",
              "additionalProperties": false
            },
            "gitImport": {
              "description": "gitImport allows the user to import code from a git repository.",
              "properties": {
                "repository": {
                  "description": "repository contains the reference to the actual Git repository.",
                  "properties": {
                    "contextDir": {
                      "description": "contextDir is used to specify a directory within the repository to build the\ncomponent.\nMust start with `/` and have a maximum length of 256 characters.\nWhen omitted, the default value is to build from the root of the repository.",
                      "maxLength": 256,
                      "pattern": "^/",
                      "type": "string"
                    },
                    "revision": {
                      "description": "revision is the git revision at which to clone the git repository\nCan be used to clone a specific branch, tag or commit SHA.\nMust be at most 256 characters in length.\nWhen omitted the repository's default branch is used.",
                      "maxLength": 256,
                      "type": "string"
                    },
                    "url": {
                      "description": "url of the Git repository that contains a HTTP service.\nThe HTTP service must be exposed on the default port (8080) unless\notherwise configured with the port field.\n\nOnly public repositories on GitHub, GitLab and Bitbucket are currently supported:\n\n  - https://github.com/<org>/<repository>\n  - https://gitlab.com/<org>/<repository>\n  - https://bitbucket.org/<org>/<repository>\n\nThe url must have a maximum length of 256 characters.",
                      "maxLength": 256,
                      "minLength": 1,
                      "pattern": "^https:\\/\\/(github.com|gitlab.com|bitbucket.org)\\/[a-zA-Z0-9-]+\\/[a-zA-Z0-9-]+(.git)?$",
                      "type": "string"
                    }
                  },
                  "required": [
                    "url"
                  ],
                  "type": "object",
                  "additionalProperties": false
                },
                "service": {
                  "default": {
                    "targetPort": 8080
                  },
                  "description": "service contains configuration for the Service resource created for this sample.",
                  "properties": {
                    "targetPort": {
                      "default": 8080,
                      "description": "targetPort is the port that the service listens on for HTTP requests.\nThis port will be used for Service created for this sample.\nPort must be in the range 1 to 65535.\nDefault port is 8080.",
                      "format": "int32",
                      "maximum": 65535,
                      "minimum": 1,
                      "type": "integer"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                }
              },
              "required": [
                "repository"
              ],
              "type": "object",
              "additionalProperties": false
            },
            "type": {
              "description": "type of the sample, currently supported: \"GitImport\";\"ContainerImport\"",
              "enum": [
                "GitImport",
                "ContainerImport"
              ],
              "type": "string"
            }
          },
          "required": [
            "type"
          ],
          "type": "object",
          "x-kubernetes-validations": [
            {
              "message": "source.gitImport is required when source.type is GitImport, and forbidden otherwise",
              "rule": "self.type == 'GitImport' ? has(self.gitImport) : !has(self.gitImport)"
            },
            {
              "message": "source.containerImport is required when source.type is ContainerImport, and forbidden otherwise",
              "rule": "self.type == 'ContainerImport' ? has(self.containerImport) : !has(self.containerImport)"
            }
          ],
          "additionalProperties": false
        },
        "tags": {
          "description": "tags are optional string values that can be used to find samples in the samples catalog.\n\nExamples of common tags may be \"Java\", \"Quarkus\", etc.\n\nThey will be displayed on the samples details page.",
          "items": {
            "type": "string"
          },
          "maxItems": 10,
          "type": "array",
          "x-kubernetes-list-type": "set"
        },
        "title": {
          "description": "title is the display name of the sample.\n\nIt is required and must be no more than 50 characters in length.",
          "maxLength": 50,
          "minLength": 1,
          "type": "string"
        },
        "type": {
          "description": "type is an optional label to group multiple samples.\n\nIt is optional and must be no more than 20 characters in length.\n\nRecommendation is a singular term like \"Builder Image\", \"Devfile\" or \"Serverless Function\".\n\nCurrently, the type is shown a badge on the sample card tile in the top right corner.",
          "maxLength": 20,
          "type": "string"
        }
      },
      "required": [
        "abstract",
        "description",
        "source",
        "title"
      ],
      "type": "object",
      "additionalProperties": false
    }
  },
  "required": [
    "metadata",
    "spec"
  ],
  "type": "object"
}
