Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support examples in documentation #5077

Closed
dlvenable opened this issue Oct 16, 2024 · 0 comments · Fixed by #5088
Closed

Support examples in documentation #5077

dlvenable opened this issue Oct 16, 2024 · 0 comments · Fixed by #5088
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@dlvenable
Copy link
Member

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."
    },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

1 participant