Skip to content

Support examples in documentation #5077

@dlvenable

Description

@dlvenable

Is your feature request related to a problem? Please describe.

Right now our examples for configuration fields are embedded in the description (@JsonPropertyDescription). This makes it difficult to include multiple examples.

Describe the solution you'd like

Provide an annotation for @DataPrepperExampleValues to support providing one or more example values for a field.

For example, with the date processor:

    @JsonProperty("output_format")
    @JsonPropertyDescription("Determines the format of the timestamp added to an event.")
    @DataPrepperExampleValues("yyyy-MM-dd'T'HH:mm:ss.SSSXXX")
    private String outputFormat = DEFAULT_OUTPUT_FORMAT;

This would produce:

"output_format" : {
      "exampleValues" : [
        "yyyy-MM-dd'T'HH:mm:ss.SSSXXX",
      ]
      "description" : "Determines the format of the timestamp added to an event."
    },

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions