-
Notifications
You must be signed in to change notification settings - Fork 102
Add documentation for GET snapshots state query parameter. #4597
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
base: main
Are you sure you want to change the base?
Conversation
Adds documentation for the SnapshotState enum and state query parameter added in elasticsearch PR #128635.
Following you can find the validation results for the APIs you have changed.
You can validate these APIs yourself by using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Note that the Elasticsearch specification has multiple uses, and documentation is only one of them. The original goal was to generate Elasticsearch clients, and this is how we generate 7 of our clients now.
/** | ||
* Only return snapshots with a state found in the given comma-separated list of snapshot states. | ||
* The default is all snapshot states. | ||
* @server_default All snapshot states | ||
* @availability stack since=9.1.0 | ||
* @availability serverless | ||
*/ | ||
state?: SnapshotState |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For better user experience, comma-separated values in query parameters are exposed as lists in Elasticsearch clients, so we should allow SnapshotState
but also SnapshotState[]
, as shown below. I had to remove the default value line too because of this error: Error: Default values in unions can only be configured for instance_of types, you are using union_of
.
/** | |
* Only return snapshots with a state found in the given comma-separated list of snapshot states. | |
* The default is all snapshot states. | |
* @server_default All snapshot states | |
* @availability stack since=9.1.0 | |
* @availability serverless | |
*/ | |
state?: SnapshotState | |
/** | |
* Only return snapshots with a state found in the given comma-separated list of snapshot states. | |
* The default is all snapshot states. | |
* @availability stack since=9.1.0 | |
* @availability serverless | |
*/ | |
state?: SnapshotState | SnapshotState[] |
With this change, validation passes for snapshot.get
, as you will see in the GitHub comment.
Adds documentation for the SnapshotState enum and state query parameter added in elasticsearch PR 128635.