Skip to content

Commit

Permalink
skip template json gen
Browse files Browse the repository at this point in the history
  • Loading branch information
jahvon committed Sep 23, 2024
1 parent 9ae620b commit b2bd505
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 89 deletions.
75 changes: 73 additions & 2 deletions schemas/flowfile_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down
89 changes: 2 additions & 87 deletions schemas/template_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions tools/docsgen/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ func generateJSONSchemas() {
sm := schema.RegisteredSchemaMap()
for fn, s := range sm {
if slices.Contains(TopLevelPages, fn.Title()) {

Check failure on line 22 in tools/docsgen/json.go

View workflow job for this annotation

GitHub Actions / validate

`if slices.Contains(TopLevelPages, fn.Title())` has complex nested blocks (complexity: 5) (nestif)
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() {
Expand Down

0 comments on commit b2bd505

Please sign in to comment.