kestra
kestra copied to clipboard
Generate proper documentation/schema for plugin properties using an `anyOf` Schema
Describe the issue
Dynamic plugin properties are often additionally typed as String
due using Pebble values. This leads to using anyOf
in the @Schema
definition.
Using an enum as the type doesn't render the plugin property documentation correctly - the Type is duplicated and, more importantly, there are no enum's Possible values listed.
A simple demonstration:
test: "{{ input.test }}"
@Schema(
title = "Dynamic enum property",
anyOf = {
String.class,
TestEnum.class
}
)
@PluginProperty(
dynamic = true
)
@Builder.Default
protected Object test = TestEnum.INPUT;
enum TestEnum {
INPUT,
OUTPUT
}
Environment
- Kestra Version: 0.16-SNAPSHOT as of Mar 22nd 2024
- Operating System (OS/Docker/Kubernetes):
- Java Version (if you don't run kestra in Docker):