kestra icon indicating copy to clipboard operation
kestra copied to clipboard

Generate proper documentation/schema for plugin properties using an `anyOf` Schema

Open yuri1969 opened this issue 11 months ago • 0 comments

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.

image


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):

yuri1969 avatar Mar 22 '24 15:03 yuri1969