-
Notifications
You must be signed in to change notification settings - Fork 99
Adding specification for the new data stream settings APIs #4416
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
specification/_doc_ids/table.csv
Outdated
indices-get-field-mapping,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-mapping | ||
indices-get-index,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get | ||
indices-get-mapping,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-mapping | ||
indices-get-settings,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-settings | ||
indices-get-template,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-index-template | ||
indices-get-template-v1,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-template | ||
indices-open-close,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-open | ||
indices-put-data-stream-settings,https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html |
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.
This is the only URL in this whole file that links to a docs v2 page. @lcawl @georgewallace Does this need to be changed?
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.
I had just put in the placeholder we had used on the elasticsearch side. I can change it to something else. Looking now to see what fits best.
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.
I've added a lot of minor suggestions, but the important one is related to the @doc_tag
. It would also be nice to have request and response examples per https://github.com/elastic/elasticsearch-specification/blob/main/docs/add-new-api.md#add-endpoint-request-and-response-examples
specification/indices/get_data_stream_settings/IndicesGetDataStreamSettingsRequest.ts
Show resolved
Hide resolved
specification/indices/get_data_stream_settings/IndicesGetDataStreamSettingsRequest.ts
Show resolved
Hide resolved
specification/indices/put_data_stream_settings/IndicesPutDataStreamSettingsRequest.ts
Show resolved
Hide resolved
specification/indices/put_data_stream_settings/IndicesPutDataStreamSettingsRequest.ts
Outdated
Show resolved
Hide resolved
specification/indices/put_data_stream_settings/IndicesPutDataStreamSettingsRequest.ts
Outdated
Show resolved
Hide resolved
specification/indices/put_data_stream_settings/IndicesPutDataStreamSettingsRequest.ts
Outdated
Show resolved
Hide resolved
specification/indices/put_data_stream_settings/IndicesPutDataStreamSettingsRequest.ts
Outdated
Show resolved
Hide resolved
specification/indices/put_data_stream_settings/IndicesPutDataStreamSettingsResponse.ts
Show resolved
Hide resolved
specification/indices/put_data_stream_settings/IndicesPutDataStreamSettingsResponse.ts
Outdated
Show resolved
Hide resolved
specification/indices/put_data_stream_settings/IndicesPutDataStreamSettingsResponse.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Lisa Cawley <[email protected]>
export class DataStreamSettings { | ||
/** The name of the data stream. */ | ||
name: string | ||
settings: IndexSettings |
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.
settings: IndexSettings
The example includes effective_settings
. If that's valid, shouldn't it appear here too?
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.
Oh wow yes good catch.
} | ||
/** Settings to be applied to the data stream. | ||
* @codegen_name settings */ | ||
body: IndexSettings |
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.
body: IndexSettings
This currently seems to result in a kind of recursive situation in the OpenAPI output:
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/indices._types.IndexSettings"
},
...
"indices._types.IndexSettings": {
"type": "object",
"properties": {
"index": {
"$ref": "#/components/schemas/indices._types.IndexSettings"
},
"mode": {
"type": "string"
},
...
We don't have that level of detail in our old docs (e.g. https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-update-settings.html or https://www.elastic.co/guide/en/elasticsearch/reference/8.18/index-modules.html#index-modules-settings), so I want to call it out to ensure it's accurate.
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.
I don't think I understand. I see that I haven't made any changes to output/openapi/elasticsearch-openapi.json
. Did I miss a step? And body:IndexSettings
is just copied directly from https://github.com/elastic/elasticsearch-specification/blob/main/specification/indices/put_settings/IndicesPutSettingsRequest.ts#L124. Is it generating different OpenAPI output for some reason?
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.
Oh I just realized that make generate
does not run make transform-to-openapi
. Looking into this now.
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.
I still don't think I see the recursion you're talking about, even after running make transform-to-openapi
. Could you show me where you're seeing this? Thanks.
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 some reason, make transform-to-openapi
does not pull in the new APIs I have added.
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.
OK, I realized that make transform-to-openapi
was not generating anything because the API was behind a feature flag. I removed the feature flag (just merged that into elasticsearch this morning) so now I am generating openapi information. But I don't understand what you mean by recursion, or how it is different from what we've done for IndicesPutSettingsRequest. I am not sure how to generate the docs to take a look.
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.
Sorry for the confusion, yes I was testing it with feature flag turned off so I could see the output. You're right that this is not different than the index settings APIs. I'm just seeing potentially problematic output in the docs so I'll pursue as a separate issue.
Co-authored-by: Lisa Cawley <[email protected]>
…ch-specification into data-stream-settings
Following you can find the validation results for the APIs you have changed.
You can validate these APIs yourself by using the |
This adds specifications for the new data stream settings APIs.