- Notifications
You must be signed in to change notification settings - Fork 115
Fix optional bodies #5271
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
Fix optional bodies #5271
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -221,7 +221,7 @@ export interface Request extends RequestBase { | |
*/ | ||
with_labels?: boolean | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* Sub-aggregations for the geotile_grid. | ||
* | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -167,7 +167,7 @@ export interface Request<TDocument> extends RequestBase { | |
*/ | ||
version_type?: VersionType | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* An artificial document (a document not present in the index) for which you want to retrieve term vectors. | ||
*/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -158,7 +158,7 @@ export interface Request extends RequestBase { | |
from?: integer | ||
sort?: string | string[] | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** @aliases aggs */ | ||
aggregations?: Dictionary<string, AggregationContainer> | ||
collapse?: FieldCollapse | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -50,7 +50,7 @@ export interface Request extends RequestBase { | |
*/ | ||
master_timeout?: Duration | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
max_outstanding_read_requests?: long | ||
max_outstanding_write_requests?: long | ||
max_read_request_operation_count?: long | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -62,7 +62,7 @@ export interface Request extends RequestBase { | |
*/ | ||
master_timeout?: Duration | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
legacy_template_to_delete?: string | ||
node_attribute?: string | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -40,7 +40,7 @@ export interface Request extends RequestBase { | |
dest: IndexName | ||
} | ||
/** @codegen_name create_from */ | ||
body: CreateFrom | ||
body?: CreateFrom | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
} | ||
| ||
export class CreateFrom { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -70,7 +70,7 @@ export interface Request extends RequestBase { | |
*/ | ||
timeout?: Duration | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* Query used to limit documents the alias can access. | ||
*/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -20,6 +20,7 @@ | |
import { RequestBase } from '@_types/Base' | ||
import { Name } from '@_types/common' | ||
import { Duration } from '@_types/Time' | ||
import { IndexTemplate } from '@indices/_types/IndexTemplate' | ||
| ||
/** | ||
* Simulate an index. | ||
| @@ -64,4 +65,6 @@ export interface Request extends RequestBase { | |
*/ | ||
include_defaults?: boolean | ||
} | ||
/** @codegen_name index_template */ | ||
body?: IndexTemplate | ||
Comment on lines +68 to +69 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -74,7 +74,7 @@ export interface Request extends RequestBase { | |
*/ | ||
include_defaults?: boolean | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* This setting overrides the value of the `action.auto_create_index` cluster setting. | ||
* If set to `true` in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -66,7 +66,7 @@ export interface Request extends RequestBase { | |
* @server_default 30m */ | ||
timeout?: Duration | ||
} | ||
body: { | ||
body?: { | ||
Comment on lines 68 to +69 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* Refer to the description for the `allow_no_match` query parameter. | ||
* @server_default true | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -62,7 +62,7 @@ export interface Request extends RequestBase { | |
*/ | ||
id?: Id | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* The configuration of how to source the analysis data. It requires an | ||
* index. Optionally, query and _source may be specified. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -75,7 +75,7 @@ export interface Request extends RequestBase { | |
*/ | ||
max_model_memory?: string | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* Refer to the description for the `duration` query parameter. | ||
* @server_default 1d | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -57,7 +57,7 @@ export interface Request extends RequestBase { | |
*/ | ||
timeout?: Duration | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* Refer to the description for the `timeout` query parameter. | ||
* @server_default 30m | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -48,7 +48,7 @@ export interface Request extends RequestBase { | |
*/ | ||
id?: Id | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* A data frame analytics config as described in create data frame analytics | ||
* jobs. Note that `id` and `dest` don’t need to be provided in the context of | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -65,7 +65,7 @@ export interface Request extends RequestBase { | |
start?: DateTime | ||
end?: DateTime | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* The datafeed definition to preview. | ||
*/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -40,7 +40,7 @@ export interface Request extends RequestBase { | |
/** A string that uniquely identifies a calendar. */ | ||
calendar_id: Id | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* An array of anomaly detection job identifiers. | ||
*/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -100,7 +100,7 @@ export interface Request extends RequestBase { | |
*/ | ||
wait_for?: DeploymentAllocationState | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* Adaptive allocations configuration. When enabled, the number of allocations | ||
* is set based on the current load. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -69,7 +69,7 @@ export interface Request extends RequestBase { | |
* @server_default 20s */ | ||
timeout?: Duration | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* Refer to the description for the `allow_no_match` query parameter. | ||
* @server_default true */ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -56,7 +56,7 @@ export interface Request extends RequestBase { | |
*/ | ||
number_of_allocations?: integer | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* The number of model allocations on each node where the model is deployed. | ||
* All allocations on a node share the same copy of the model in memory but use | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -61,7 +61,7 @@ export interface Request extends RequestBase { | |
*/ | ||
timeout?: Duration | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* The password for the Elasticsearch keystore. | ||
*/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -48,7 +48,7 @@ export interface Request extends RequestBase { | |
/** | ||
* Contains parameters for a search application. | ||
*/ | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
params?: Dictionary<string, UserDefinedValue> | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -52,7 +52,7 @@ export interface Request extends RequestBase { | |
*/ | ||
typed_keys?: boolean | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* Query parameters specific to this request, which will override any defaults specified in the template. | ||
*/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -72,7 +72,7 @@ export interface Request extends RequestBase { | |
*/ | ||
typed_keys?: boolean | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* Any aggregations to run over the corpus of returned API keys. | ||
* Aggregations and queries work together. Aggregations are computed only on the API keys that match the query. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -43,7 +43,7 @@ export interface Request extends RequestBase { | |
methods: ['GET', 'POST'] | ||
} | ||
] | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* A query to filter which roles to return. | ||
* If the query parameter is missing, it is equivalent to a `match_all` query. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -43,7 +43,7 @@ export interface Request extends RequestBase { | |
methods: ['GET', 'POST'] | ||
} | ||
] | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* A query to filter which users to return. | ||
* If the query parameter is missing, it is equivalent to a `match_all` query. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -52,7 +52,7 @@ export interface Request extends RequestBase { | |
*/ | ||
data?: string | string[] | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* A query string used to match name-related fields in user profile documents. | ||
* Name-related fields are the user's `username`, `full_name`, and `email`. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -63,7 +63,7 @@ export interface Request extends RequestBase { | |
*/ | ||
id: Id | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* The role descriptors to assign to this API key. | ||
* The API key's effective permissions are an intersection of its assigned privileges and the point in time snapshot of permissions of the owner user. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -64,7 +64,7 @@ export interface Request extends RequestBase { | |
*/ | ||
wait_for_completion?: boolean | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. YAML test that creates a snapshot without a body: https://github.com/elastic/elasticsearch/blob/a82b5cfb0ff7d22b95c56a8e7dcd7c5f3ba4ff24/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/snapshot.create/10_basic.yml#L23-L27 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* Determines how wildcard patterns in the `indices` parameter match data streams and indices. | ||
* It supports comma-separated values such as `open,hidden`. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -83,7 +83,7 @@ export interface Request extends RequestBase { | |
*/ | ||
wait_for_completion?: boolean | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. YAML test that restores a snapshot without a body: https://github.com/elastic/elasticsearch/blob/a82b5cfb0ff7d22b95c56a8e7dcd7c5f3ba4ff24/modules/repository-gcs/src/yamlRestTest/resources/rest-api-spec/test/repository_gcs/20_repository.yml#L139-L144 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* The feature states to restore. | ||
* If `include_global_state` is `true`, the request restores all feature states in the snapshot by default. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -70,7 +70,7 @@ export interface Request extends RequestBase { | |
*/ | ||
timeout?: Duration | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* The destination for the transform. | ||
*/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -71,7 +71,7 @@ export interface Request extends RequestBase { | |
*/ | ||
debug?: boolean | ||
} | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* Determines how to handle the watch actions as part of the watch execution. | ||
*/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -39,7 +39,7 @@ export interface Request extends RequestBase { | |
methods: ['GET', 'POST'] | ||
} | ||
] | ||
body: { | ||
body?: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
/** | ||
* The offset from the first result to fetch. | ||
* It must be non-negative. | ||
|
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.
https://github.com/elastic/elasticsearch/blob/63840f1276b1fea156a96a6ae16380c381982900/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsAction.java#L53