diff --git a/schemas/schema.json b/schemas/schema.json new file mode 100644 index 0000000..6e2eddd --- /dev/null +++ b/schemas/schema.json @@ -0,0 +1,66 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Cobra CLI settings", + "description": "Cobra CLI settings", + "type": "object", + "properties": { + "author": { + "title": "author", + "description": "An author of the project\nhttps://github.com/spf13/cobra-cli", + "type": "string", + "minLength": 1, + "pattern": "\\S", + "examples": ["Steve Francia "] + }, + "license": { + "title": "license", + "description": "A license of the project\nhttps://github.com/spf13/cobra-cli", + "oneOf": [ + { + "type": "string", + "minLength": 1, + "pattern": "\\S", + "examples": [ + "GPLv2", + "GPLv3", + "LGPL", + "AGPL", + "MIT", + "2-Clause BSD", + "3-Clause BSD" + ] + }, + { + "type": "object", + "properties": { + "header": { + "title": "header", + "description": "A header of the license\nhttps://github.com/spf13/cobra-cli", + "type": "string", + "minLength": 1, + "pattern": "\\S", + "examples": ["This file is part of CLI application foo."] + }, + "text": { + "title": "text", + "description": "A text of the license\nVariables:\n- copyright\nhttps://github.com/spf13/cobra-cli", + "type": "string", + "minLength": 1, + "pattern": "\\S", + "examples": [ + "{{ .copyright }}\n\nThis is my license. There are many like it, but this one is mine.\nMy license is my best friend. It is my life. I must master it as I must\nmaster my life.\n" + ] + } + }, + "additionalProperties": false + } + ] + }, + "useViper": { + "title": "use Viper", + "description": "Whether to use Viper (https://github.com/spf13/viper) for managing project configuration\nhttps://github.com/spf13/cobra-cli", + "type": "boolean" + } + }, + "additionalProperties": false +}