Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
302 changes: 151 additions & 151 deletions output/openapi/elasticsearch-openapi.json

Large diffs are not rendered by default.

300 changes: 150 additions & 150 deletions output/openapi/elasticsearch-serverless-openapi.json

Large diffs are not rendered by default.

72 changes: 34 additions & 38 deletions output/schema/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions output/typescript/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions specification/cluster/_types/ComponentTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { TypeMapping } from '@_types/mapping/TypeMapping'
import { DateTime, EpochTime, UnitMillis } from '@_types/Time'
import { AliasDefinition } from '@indices/_types/AliasDefinition'
import { DataStreamLifecycleWithRollover } from '@indices/_types/DataStreamLifecycle'
import { DataStreamOptionsTemplate } from '@indices/_types/DataStreamOptions'
import { DataStreamOptions } from '@indices/_types/DataStreamOptions'
import { IndexSettings } from '@indices/_types/IndexSettings'
import { Dictionary } from '@spec_utils/Dictionary'

Expand Down Expand Up @@ -82,5 +82,5 @@ export class ComponentTemplateSummary {
* @availability stack since=8.19.0 stability=stable
* @availability serverless stability=stable
*/
data_stream_options?: DataStreamOptionsTemplate | null
data_stream_options?: DataStreamOptions
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { RequestBase } from '@_types/Base'
import { Metadata, Name, VersionNumber } from '@_types/common'
import { Duration } from '@_types/Time'
import { IndexState } from '@indices/_types/IndexState'
import { IndexTemplateMapping } from '@indices/put_index_template/IndicesPutIndexTemplateRequest'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import isn't particularly pretty. I'll leave it up to you whether this is fine or if we should extract the IndexTemplateMapping class to a dedicated file. If we're extracting it (which I'm in favor of), we should probably also rename it.

Copy link
Member Author

@pquentin pquentin Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should move to a shared place. Options include:

  1. specification/indices/_types
  2. specification/cluster/_types
  3. specification/_types

Not sure which is best. Probably cluster since it's where Template lives in the Elasticsearch code. Unfortunately, moving a class is a breaking change, so that will be 9.3 only.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, moving it to specification/cluster/_types works for me 👍. I'm having trouble coming up with a good name though... IndexTemplate is already used for retrieving templates. Is there some kind of naming convention for types that are used for PUT requests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No naming convention, I'm not sure what to use. Is keeping IndexTemplateMapping that bad? It will reduce breakage for clients that don't care about the namespace of types.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, I don't think the name itself really makes any sense, but if it avoids breakage, I'm fine with leaving it as is. Then let's just stick to moving the class. Could you take care of that perhaps? 🙏

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! So I did it locally, which made me realize that we already have a case of an endpoint doing this:

https://github.com/elastic/elasticsearch-specification/blob/6566f6962beceaa27c50ac31100ac22f62aea822/specification/indices/simulate_template/IndicesSimulateTemplateRequest.ts#L25C10-L25C30

So let's merge without doing this for now, and I'll ask to @l-trotta what's the best thing to do here, as the location of types mostly affects the Java client.


/**
* Create or update a component template.
Expand Down Expand Up @@ -87,7 +87,7 @@ export interface Request extends RequestBase {
/**
* The template to be applied which includes mappings, settings, or aliases configuration.
*/
template: IndexState
template: IndexTemplateMapping
/**
* Version number used to manage component templates externally.
* This number isn't automatically generated or incremented by Elasticsearch.
Expand Down
4 changes: 2 additions & 2 deletions specification/indices/_types/IndexTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { TypeMapping } from '@_types/mapping/TypeMapping'
import { long } from '@_types/Numeric'
import { DateTime, EpochTime, UnitMillis } from '@_types/Time'
import { DataStreamLifecycleWithRollover } from '@indices/_types/DataStreamLifecycle'
import { DataStreamOptionsTemplate } from '@indices/_types/DataStreamOptions'
import { DataStreamOptions } from '@indices/_types/DataStreamOptions'
import { Dictionary } from '@spec_utils/Dictionary'
import { Alias } from './Alias'
import { IndexSettings } from './IndexSettings'
Expand Down Expand Up @@ -145,5 +145,5 @@ export class IndexTemplateSummary {
* @availability stack since=8.19.0 stability=stable
* @availability serverless stability=stable
*/
data_stream_options?: DataStreamOptionsTemplate | null
data_stream_options?: DataStreamOptions
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { Duration } from '@_types/Time'
import { Alias } from '@indices/_types/Alias'
import { DataStreamVisibility } from '@indices/_types/DataStream'
import { DataStreamLifecycle } from '@indices/_types/DataStreamLifecycle'
import { DataStreamOptionsTemplate } from '@indices/_types/DataStreamOptions'
import { IndexSettings } from '@indices/_types/IndexSettings'
import { Dictionary } from '@spec_utils/Dictionary'

Expand Down Expand Up @@ -178,4 +179,9 @@ export class IndexTemplateMapping {
* @availability serverless stability=stable
*/
lifecycle?: DataStreamLifecycle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this lifecycle field in the template object can also explicitly be set to null, and the same holds for all the fields inside DataStreamLifecycle. Do you want to address that in this PR or a follow-up one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to do this as a follow-up, as long as this is before 9.3, to avoid breaking those APIs twice.

/**
* @availability stack since=8.19.0 stability=stable
* @availability serverless stability=stable
*/
data_stream_options?: DataStreamOptionsTemplate
}