ExampleValues annotation for schema generation along with date examples#5088
Merged
dlvenable merged 2 commits intoopensearch-project:mainfrom Oct 23, 2024
Merged
Conversation
chenqi0805
previously approved these changes
Oct 21, 2024
…ration. Adds a new annotation ExampleValues. Updates the schema generation with an InstanceAttributeOverride to add the examples to the schemas. Adds ExampleValues to the date processor. Signed-off-by: David Venable <dlv@amazon.com>
d80a881 to
5440445
Compare
Member
Author
|
@chenqi0805 , I had to rebase with |
shenkw1
approved these changes
Oct 22, 2024
|
|
||
| @JsonClassDescription("test config") | ||
| static class TestConfig { | ||
| @JsonPropertyDescription("The aggregate action description") |
Contributor
There was a problem hiding this comment.
maybe make this description more generic
Member
Author
There was a problem hiding this comment.
This is just for testing.
san81
reviewed
Oct 22, 2024
| * | ||
| * @since 2.11 | ||
| */ | ||
| @interface Example { |
Collaborator
There was a problem hiding this comment.
Does it have to be an inner interface? As it is inner, at the time of specifying these example values it looks overly verbose
@ExampleValues({
@ExampleValues.Example("some example value"),
@ExampleValues.Example(value = "second example value", description = "This is the second value.")
})
Member
Author
There was a problem hiding this comment.
This is actually quite common for annotations that are coupled with their parent. You can add ExampleValues as a static import.
Member
Author
There was a problem hiding this comment.
I pushed a revision that imports ExampleValues.Example.
…ProcessorConfig. Signed-off-by: David Venable <dlv@amazon.com>
chenqi0805
approved these changes
Oct 23, 2024
shenkw1
approved these changes
Oct 23, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Introduces
@ExampleValuesannotation for schema and documentation generation.@ExampleValues.InstanceAttributeOverrideto add the examples to the schemas.@ExampleValuesannotations to the date processor.Issues Resolved
Resolves #5077
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.