diff --git a/schemas/flowfile_schema.json b/schemas/flowfile_schema.json index be69ba1..e510489 100644 --- a/schemas/flowfile_schema.json +++ b/schemas/flowfile_schema.json @@ -87,7 +87,50 @@ } } }, - "ExecutableArgument": {}, + "ExecutableArgument": { + "type": "object", + "required": [ + "envKey" + ], + "properties": { + "default": { + "description": "The default value to use if the argument is not provided.\nIf the argument is required and no default is provided, the executable will fail.\n", + "type": "string", + "default": "" + }, + "envKey": { + "description": "The name of the environment variable that will be assigned the value.", + "type": "string", + "default": "" + }, + "flag": { + "description": "The flag to use when setting the argument from the command line.\nEither `flag` or `pos` must be set, but not both.\n", + "type": "string", + "default": "" + }, + "pos": { + "description": "The position of the argument in the command line ArgumentList. Values start at 1.\nEither `flag` or `pos` must be set, but not both.\n", + "type": "integer", + "default": 0 + }, + "required": { + "description": "If the argument is required, the executable will fail if the argument is not provided.\nIf the argument is not required, the default value will be used if the argument is not provided.\n", + "type": "boolean", + "default": false + }, + "type": { + "description": "The type of the argument. This is used to determine how to parse the value of the argument.", + "type": "string", + "default": "string", + "enum": [ + "string", + "int", + "float", + "bool" + ] + } + } + }, "ExecutableArgumentList": { "type": "array", "items": { @@ -228,7 +271,35 @@ "$ref": "#/definitions/ExecutableParallelRefConfig" } }, - "ExecutableParameter": {}, + "ExecutableParameter": { + "description": "A parameter is a value that can be passed to an executable and all of its sub-executables.\nOnly one of `text`, `secretRef`, or `prompt` must be set. Specifying more than one will result in an error.\n", + "type": "object", + "required": [ + "envKey" + ], + "properties": { + "envKey": { + "description": "The name of the environment variable that will be assigned the value.", + "type": "string", + "default": "" + }, + "prompt": { + "description": "A prompt to be displayed to the user when collecting an input value.", + "type": "string", + "default": "" + }, + "secretRef": { + "description": "A reference to a secret to be passed to the executable.", + "type": "string", + "default": "" + }, + "text": { + "description": "A static value to be passed to the executable.", + "type": "string", + "default": "" + } + } + }, "ExecutableParameterList": { "type": "array", "items": { diff --git a/schemas/template_schema.json b/schemas/template_schema.json index 486cba6..b9bf886 100644 --- a/schemas/template_schema.json +++ b/schemas/template_schema.json @@ -45,59 +45,8 @@ } } }, - "ExecutableArgument": { - "type": "object", - "required": [ - "envKey" - ], - "properties": { - "default": { - "description": "The default value to use if the argument is not provided.\nIf the argument is required and no default is provided, the executable will fail.\n", - "type": "string", - "default": "" - }, - "envKey": { - "description": "The name of the environment variable that will be assigned the value.", - "type": "string", - "default": "" - }, - "flag": { - "description": "The flag to use when setting the argument from the command line.\nEither `flag` or `pos` must be set, but not both.\n", - "type": "string", - "default": "" - }, - "pos": { - "description": "The position of the argument in the command line ArgumentList. Values start at 1.\nEither `flag` or `pos` must be set, but not both.\n", - "type": "integer", - "default": 0 - }, - "required": { - "description": "If the argument is required, the executable will fail if the argument is not provided.\nIf the argument is not required, the default value will be used if the argument is not provided.\n", - "type": "boolean", - "default": false - }, - "type": { - "description": "The type of the argument. This is used to determine how to parse the value of the argument.", - "type": "string", - "default": "string", - "enum": [ - "string", - "int", - "float", - "bool" - ] - } - } - }, - "ExecutableArgumentList": { - "type": "array", - "items": { - "$ref": "#/definitions/ExecutableArgument" - } - }, + "ExecutableArgumentList": {}, "ExecutableDirectory": { - "description": "The directory to execute the command in.\nIf unset, the directory of the flow file will be used.\nIf set to `f:tmp`, a temporary directory will be created for the process.\nIf prefixed with `./`, the path will be relative to the current working directory.\nIf prefixed with `//`, the path will be relative to the workspace root.\nEnvironment variables in the path will be expended at runtime.\n", - "type": "string", "default": "" }, "ExecutableExecExecutableType": { @@ -131,41 +80,7 @@ } } }, - "ExecutableParameter": { - "description": "A parameter is a value that can be passed to an executable and all of its sub-executables.\nOnly one of `text`, `secretRef`, or `prompt` must be set. Specifying more than one will result in an error.\n", - "type": "object", - "required": [ - "envKey" - ], - "properties": { - "envKey": { - "description": "The name of the environment variable that will be assigned the value.", - "type": "string", - "default": "" - }, - "prompt": { - "description": "A prompt to be displayed to the user when collecting an input value.", - "type": "string", - "default": "" - }, - "secretRef": { - "description": "A reference to a secret to be passed to the executable.", - "type": "string", - "default": "" - }, - "text": { - "description": "A static value to be passed to the executable.", - "type": "string", - "default": "" - } - } - }, - "ExecutableParameterList": { - "type": "array", - "items": { - "$ref": "#/definitions/ExecutableParameter" - } - }, + "ExecutableParameterList": {}, "Field": { "description": "A field to be displayed to the user when generating a flow file from a template.", "type": "object", diff --git a/tools/docsgen/json.go b/tools/docsgen/json.go index e4483c3..9da77d1 100644 --- a/tools/docsgen/json.go +++ b/tools/docsgen/json.go @@ -20,6 +20,11 @@ func generateJSONSchemas() { sm := schema.RegisteredSchemaMap() for fn, s := range sm { if slices.Contains(TopLevelPages, fn.Title()) { + if fn.Title() == "Template" { + // TODO: fix schema gem bug where the common executable definitions used by the flowfile + // and template schemas are non-deterministically generated + continue + } updateFileID(s, fn) for key, value := range s.Properties { if !value.Ext.IsExported() {