From a0306966dfc6520c600eb433489e5d834802f902 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Fri, 24 Jan 2025 11:32:01 +0400 Subject: [PATCH 1/3] Support synthetic_source_keep and mapping.source.mode --- output/openapi/elasticsearch-openapi.json | 42 +++++- .../elasticsearch-serverless-openapi.json | 42 +++++- output/schema/schema-serverless.json | 140 +++++++++++++++--- output/schema/schema.json | 140 +++++++++++++++--- output/typescript/types.ts | 12 +- specification/_types/mapping/Property.ts | 21 +++ specification/indices/_types/IndexSettings.ts | 13 +- 7 files changed, 362 insertions(+), 48 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 7811993a1b..dd071ffc5c 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -61654,8 +61654,18 @@ "dimension_fields": { "$ref": "#/components/schemas/indices._types:MappingLimitSettingsDimensionFields" }, + "source": { + "$ref": "#/components/schemas/indices._types:MappingLimitSettingsSourceFields" + }, "ignore_malformed": { - "type": "boolean" + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string" + } + ] } } }, @@ -61731,6 +61741,25 @@ } } }, + "indices._types:MappingLimitSettingsSourceFields": { + "type": "object", + "properties": { + "mode": { + "$ref": "#/components/schemas/indices._types:SourceMode" + } + }, + "required": [ + "mode" + ] + }, + "indices._types:SourceMode": { + "type": "string", + "enum": [ + "disabled", + "stored", + "synthetic" + ] + }, "indices._types:IndexingSlowlogSettings": { "type": "object", "properties": { @@ -63068,9 +63097,20 @@ "additionalProperties": { "$ref": "#/components/schemas/_types.mapping:Property" } + }, + "synthetic_source_keep": { + "$ref": "#/components/schemas/_types.mapping:SyntheticSourceKeepEnum" } } }, + "_types.mapping:SyntheticSourceKeepEnum": { + "type": "string", + "enum": [ + "none", + "arrays", + "all" + ] + }, "_types.mapping:BooleanProperty": { "allOf": [ { diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 3bd4bc32a6..c50512a757 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -40502,8 +40502,18 @@ "dimension_fields": { "$ref": "#/components/schemas/indices._types:MappingLimitSettingsDimensionFields" }, + "source": { + "$ref": "#/components/schemas/indices._types:MappingLimitSettingsSourceFields" + }, "ignore_malformed": { - "type": "boolean" + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string" + } + ] } } }, @@ -40579,6 +40589,25 @@ } } }, + "indices._types:MappingLimitSettingsSourceFields": { + "type": "object", + "properties": { + "mode": { + "$ref": "#/components/schemas/indices._types:SourceMode" + } + }, + "required": [ + "mode" + ] + }, + "indices._types:SourceMode": { + "type": "string", + "enum": [ + "disabled", + "stored", + "synthetic" + ] + }, "indices._types:IndexingSlowlogSettings": { "type": "object", "properties": { @@ -41123,9 +41152,20 @@ "additionalProperties": { "$ref": "#/components/schemas/_types.mapping:Property" } + }, + "synthetic_source_keep": { + "$ref": "#/components/schemas/_types.mapping:SyntheticSourceKeepEnum" } } }, + "_types.mapping:SyntheticSourceKeepEnum": { + "type": "string", + "enum": [ + "none", + "arrays", + "all" + ] + }, "_types.mapping:BooleanProperty": { "allOf": [ { diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index f44a5a0683..6a9afedc80 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -53915,7 +53915,7 @@ "name": "FieldType", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/Property.ts#L168-L216" + "specLocation": "_types/mapping/Property.ts#L190-L238" }, { "kind": "enum", @@ -87709,7 +87709,7 @@ "name": "Property", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/Property.ts#L97-L166", + "specLocation": "_types/mapping/Property.ts#L119-L188", "type": { "items": [ { @@ -88258,9 +88258,42 @@ } } } + }, + { + "name": "synthetic_source_keep", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "SyntheticSourceKeepEnum", + "namespace": "_types.mapping" + } + } + } + ], + "specLocation": "_types/mapping/Property.ts#L85-L96" + }, + { + "kind": "enum", + "members": [ + { + "description": "Synthetic source diverges from the original source (default)", + "name": "none" + }, + { + "description": "Arrays of the corresponding field or object preserve the original element ordering and duplicate elements.\nThe synthetic source fragment for such arrays is not guaranteed to match the original source exactly,\ne.g. array [1, 2, [5], [[4, [3]]], 5] may appear as-is or in an equivalent format like [1, 2, 5, 4, 3, 5].\nThe exact format may change in the future, in an effort to reduce the storage overhead of this option.", + "name": "arrays" + }, + { + "description": "The source for both singleton instances and arrays of the corresponding field or object gets recorded.\nWhen applied to objects, the source of all sub-objects and sub-fields gets captured.\nFurthermore, the original source of arrays gets captured and appears in synthetic source with no modifications.", + "name": "all" } ], - "specLocation": "_types/mapping/Property.ts#L85-L95" + "name": { + "name": "SyntheticSourceKeepEnum", + "namespace": "_types.mapping" + }, + "specLocation": "_types/mapping/Property.ts#L98-L116" }, { "inherits": { @@ -95676,6 +95709,25 @@ ], "specLocation": "indices/_types/IndexSettings.ts#L224-L228" }, + { + "kind": "enum", + "members": [ + { + "name": "disabled" + }, + { + "name": "stored" + }, + { + "name": "synthetic" + } + ], + "name": { + "name": "SourceMode", + "namespace": "indices._types" + }, + "specLocation": "indices/_types/IndexSettings.ts#L495-L499" + }, { "isOpen": true, "kind": "enum", @@ -95701,7 +95753,7 @@ "name": "StorageType", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L520-L548" + "specLocation": "indices/_types/IndexSettings.ts#L531-L559" }, { "kind": "enum", @@ -114989,7 +115041,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L490-L495" + "specLocation": "indices/_types/IndexSettings.ts#L501-L506" }, { "kind": "interface", @@ -115021,7 +115073,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L497-L500" + "specLocation": "indices/_types/IndexSettings.ts#L508-L511" }, { "kind": "interface", @@ -115075,7 +115127,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L502-L507" + "specLocation": "indices/_types/IndexSettings.ts#L513-L518" }, { "kind": "interface", @@ -115988,18 +116040,41 @@ } }, { - "name": "ignore_malformed", + "name": "source", "required": false, "type": { "kind": "instance_of", "type": { - "name": "boolean", - "namespace": "_builtins" + "name": "MappingLimitSettingsSourceFields", + "namespace": "indices._types" } } + }, + { + "name": "ignore_malformed", + "required": false, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + }, + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + ], + "kind": "union_of" + } } ], - "specLocation": "indices/_types/IndexSettings.ts#L411-L424" + "specLocation": "indices/_types/IndexSettings.ts#L411-L425" }, { "kind": "interface", @@ -116059,7 +116134,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L426-L443" + "specLocation": "indices/_types/IndexSettings.ts#L427-L444" }, { "kind": "interface", @@ -116082,7 +116157,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L445-L452" + "specLocation": "indices/_types/IndexSettings.ts#L446-L453" }, { "kind": "interface", @@ -116105,7 +116180,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L454-L462" + "specLocation": "indices/_types/IndexSettings.ts#L455-L463" }, { "kind": "interface", @@ -116128,7 +116203,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L464-L471" + "specLocation": "indices/_types/IndexSettings.ts#L465-L472" }, { "kind": "interface", @@ -116150,7 +116225,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L473-L480" + "specLocation": "indices/_types/IndexSettings.ts#L474-L481" }, { "kind": "interface", @@ -116172,7 +116247,28 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L482-L488" + "specLocation": "indices/_types/IndexSettings.ts#L483-L489" + }, + { + "kind": "interface", + "name": { + "name": "MappingLimitSettingsSourceFields", + "namespace": "indices._types" + }, + "properties": [ + { + "name": "mode", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "SourceMode", + "namespace": "indices._types" + } + } + } + ], + "specLocation": "indices/_types/IndexSettings.ts#L491-L493" }, { "kind": "interface", @@ -116226,7 +116322,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L563-L568" + "specLocation": "indices/_types/IndexSettings.ts#L574-L579" }, { "kind": "interface", @@ -116250,7 +116346,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L570-L577" + "specLocation": "indices/_types/IndexSettings.ts#L581-L588" }, { "kind": "interface", @@ -116271,7 +116367,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L550-L552" + "specLocation": "indices/_types/IndexSettings.ts#L561-L563" }, { "kind": "interface", @@ -116293,7 +116389,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L554-L561" + "specLocation": "indices/_types/IndexSettings.ts#L565-L572" }, { "kind": "interface", @@ -116326,7 +116422,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L509-L518" + "specLocation": "indices/_types/IndexSettings.ts#L520-L529" }, { "kind": "interface", diff --git a/output/schema/schema.json b/output/schema/schema.json index f481125348..1aa8f4696a 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -76587,7 +76587,7 @@ "name": "FieldType", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/Property.ts#L168-L216" + "specLocation": "_types/mapping/Property.ts#L190-L238" }, { "kind": "interface", @@ -78308,7 +78308,7 @@ "name": "Property", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/Property.ts#L97-L166", + "specLocation": "_types/mapping/Property.ts#L119-L188", "type": { "kind": "union_of", "items": [ @@ -78768,9 +78768,20 @@ } } } + }, + { + "name": "synthetic_source_keep", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "SyntheticSourceKeepEnum", + "namespace": "_types.mapping" + } + } } ], - "specLocation": "_types/mapping/Property.ts#L85-L95" + "specLocation": "_types/mapping/Property.ts#L85-L96" }, { "kind": "interface", @@ -79681,6 +79692,28 @@ ], "specLocation": "_types/mapping/specialized.ts#L43-L48" }, + { + "kind": "enum", + "members": [ + { + "description": "Synthetic source diverges from the original source (default)", + "name": "none" + }, + { + "description": "Arrays of the corresponding field or object preserve the original element ordering and duplicate elements.\nThe synthetic source fragment for such arrays is not guaranteed to match the original source exactly,\ne.g. array [1, 2, [5], [[4, [3]]], 5] may appear as-is or in an equivalent format like [1, 2, 5, 4, 3, 5].\nThe exact format may change in the future, in an effort to reduce the storage overhead of this option.", + "name": "arrays" + }, + { + "description": "The source for both singleton instances and arrays of the corresponding field or object gets recorded.\nWhen applied to objects, the source of all sub-objects and sub-fields gets captured.\nFurthermore, the original source of arrays gets captured and appears in synthetic source with no modifications.", + "name": "all" + } + ], + "name": { + "name": "SyntheticSourceKeepEnum", + "namespace": "_types.mapping" + }, + "specLocation": "_types/mapping/Property.ts#L98-L116" + }, { "kind": "enum", "members": [ @@ -129568,7 +129601,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L550-L552" + "specLocation": "indices/_types/IndexSettings.ts#L561-L563" }, { "kind": "interface", @@ -129590,7 +129623,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L554-L561" + "specLocation": "indices/_types/IndexSettings.ts#L565-L572" }, { "kind": "interface", @@ -129644,7 +129677,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L563-L568" + "specLocation": "indices/_types/IndexSettings.ts#L574-L579" }, { "kind": "interface", @@ -129668,7 +129701,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L570-L577" + "specLocation": "indices/_types/IndexSettings.ts#L581-L588" }, { "kind": "enum", @@ -129780,18 +129813,41 @@ } }, { - "name": "ignore_malformed", + "name": "source", "required": false, "type": { "kind": "instance_of", "type": { - "name": "boolean", - "namespace": "_builtins" + "name": "MappingLimitSettingsSourceFields", + "namespace": "indices._types" } } + }, + { + "name": "ignore_malformed", + "required": false, + "type": { + "kind": "union_of", + "items": [ + { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + }, + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + ] + } } ], - "specLocation": "indices/_types/IndexSettings.ts#L411-L424" + "specLocation": "indices/_types/IndexSettings.ts#L411-L425" }, { "kind": "interface", @@ -129814,7 +129870,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L445-L452" + "specLocation": "indices/_types/IndexSettings.ts#L446-L453" }, { "kind": "interface", @@ -129836,7 +129892,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L482-L488" + "specLocation": "indices/_types/IndexSettings.ts#L483-L489" }, { "kind": "interface", @@ -129858,7 +129914,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L473-L480" + "specLocation": "indices/_types/IndexSettings.ts#L474-L481" }, { "kind": "interface", @@ -129881,7 +129937,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L454-L462" + "specLocation": "indices/_types/IndexSettings.ts#L455-L463" }, { "kind": "interface", @@ -129904,7 +129960,28 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L464-L471" + "specLocation": "indices/_types/IndexSettings.ts#L465-L472" + }, + { + "kind": "interface", + "name": { + "name": "MappingLimitSettingsSourceFields", + "namespace": "indices._types" + }, + "properties": [ + { + "name": "mode", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "SourceMode", + "namespace": "indices._types" + } + } + } + ], + "specLocation": "indices/_types/IndexSettings.ts#L491-L493" }, { "kind": "interface", @@ -129964,7 +130041,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L426-L443" + "specLocation": "indices/_types/IndexSettings.ts#L427-L444" }, { "kind": "interface", @@ -130738,7 +130815,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L490-L495" + "specLocation": "indices/_types/IndexSettings.ts#L501-L506" }, { "kind": "interface", @@ -130792,7 +130869,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L502-L507" + "specLocation": "indices/_types/IndexSettings.ts#L513-L518" }, { "kind": "interface", @@ -130824,7 +130901,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L497-L500" + "specLocation": "indices/_types/IndexSettings.ts#L508-L511" }, { "kind": "interface", @@ -130861,6 +130938,25 @@ ], "specLocation": "indices/_types/IndexSettings.ts#L50-L63" }, + { + "kind": "enum", + "members": [ + { + "name": "disabled" + }, + { + "name": "stored" + }, + { + "name": "synthetic" + } + ], + "name": { + "name": "SourceMode", + "namespace": "indices._types" + }, + "specLocation": "indices/_types/IndexSettings.ts#L495-L499" + }, { "kind": "interface", "name": { @@ -130892,7 +130988,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L509-L518" + "specLocation": "indices/_types/IndexSettings.ts#L520-L529" }, { "kind": "enum", @@ -130919,7 +131015,7 @@ "name": "StorageType", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L520-L548" + "specLocation": "indices/_types/IndexSettings.ts#L531-L559" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 9fd7f48976..f67253d644 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -5740,6 +5740,7 @@ export interface MappingPropertyBase { ignore_above?: integer dynamic?: MappingDynamicMapping fields?: Record + synthetic_source_keep?: MappingSyntheticSourceKeepEnum } export interface MappingRangePropertyBase extends MappingDocValuesPropertyBase { @@ -5846,6 +5847,8 @@ export interface MappingSuggestContext { precision?: integer | string } +export type MappingSyntheticSourceKeepEnum = 'none' | 'arrays' | 'all' + export type MappingTermVectorOption = 'no' | 'yes' | 'with_offsets' | 'with_positions' | 'with_positions_offsets' | 'with_positions_offsets_payloads' | 'with_positions_payloads' export interface MappingTextIndexPrefixes { @@ -11359,7 +11362,8 @@ export interface IndicesMappingLimitSettings { nested_objects?: IndicesMappingLimitSettingsNestedObjects field_name_length?: IndicesMappingLimitSettingsFieldNameLength dimension_fields?: IndicesMappingLimitSettingsDimensionFields - ignore_malformed?: boolean + source?: IndicesMappingLimitSettingsSourceFields + ignore_malformed?: boolean | string } export interface IndicesMappingLimitSettingsDepth { @@ -11382,6 +11386,10 @@ export interface IndicesMappingLimitSettingsNestedObjects { limit?: long } +export interface IndicesMappingLimitSettingsSourceFields { + mode: IndicesSourceMode +} + export interface IndicesMappingLimitSettingsTotalFields { limit?: long | string ignore_dynamic_beyond_limit?: boolean | string @@ -11509,6 +11517,8 @@ export interface IndicesSoftDeletes { retention_lease?: IndicesRetentionLease } +export type IndicesSourceMode = 'disabled' | 'stored' | 'synthetic' + export interface IndicesStorage { type: IndicesStorageType allow_mmap?: boolean diff --git a/specification/_types/mapping/Property.ts b/specification/_types/mapping/Property.ts index 80da7a7caa..0c23b5e0e4 100644 --- a/specification/_types/mapping/Property.ts +++ b/specification/_types/mapping/Property.ts @@ -92,6 +92,27 @@ export class PropertyBase { ignore_above?: integer dynamic?: DynamicMapping fields?: Dictionary + synthetic_source_keep?: SyntheticSourceKeepEnum +} + +export enum SyntheticSourceKeepEnum { + /** + * Synthetic source diverges from the original source (default) + */ + none, + /** + * Arrays of the corresponding field or object preserve the original element ordering and duplicate elements. + * The synthetic source fragment for such arrays is not guaranteed to match the original source exactly, + * e.g. array [1, 2, [5], [[4, [3]]], 5] may appear as-is or in an equivalent format like [1, 2, 5, 4, 3, 5]. + * The exact format may change in the future, in an effort to reduce the storage overhead of this option. + */ + arrays, + /** + * The source for both singleton instances and arrays of the corresponding field or object gets recorded. + * When applied to objects, the source of all sub-objects and sub-fields gets captured. + * Furthermore, the original source of arrays gets captured and appears in synthetic source with no modifications. + */ + all } /** diff --git a/specification/indices/_types/IndexSettings.ts b/specification/indices/_types/IndexSettings.ts index 70b79d6af8..eee64062e0 100644 --- a/specification/indices/_types/IndexSettings.ts +++ b/specification/indices/_types/IndexSettings.ts @@ -420,7 +420,8 @@ export class MappingLimitSettings { nested_objects?: MappingLimitSettingsNestedObjects field_name_length?: MappingLimitSettingsFieldNameLength dimension_fields?: MappingLimitSettingsDimensionFields - ignore_malformed?: boolean + source?: MappingLimitSettingsSourceFields + ignore_malformed?: boolean | string } export class MappingLimitSettingsTotalFields { @@ -487,6 +488,16 @@ export class MappingLimitSettingsDimensionFields { limit?: long } +export class MappingLimitSettingsSourceFields { + mode: SourceMode +} + +export enum SourceMode { + disabled, + stored, + synthetic +} + export class SlowlogSettings { level?: string source?: integer From 3b71a0db0dc4c31df3bd473d36fed69f0e91ca1d Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Fri, 24 Jan 2025 14:28:02 +0400 Subject: [PATCH 2/3] Skip intermediate class --- output/openapi/elasticsearch-openapi.json | 15 +----- .../elasticsearch-serverless-openapi.json | 15 +----- output/schema/schema-serverless.json | 49 ++++++------------- output/schema/schema.json | 49 ++++++------------- output/typescript/types.ts | 6 +-- specification/indices/_types/IndexSettings.ts | 6 +-- 6 files changed, 34 insertions(+), 106 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index dd071ffc5c..a8beb8439d 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -61654,8 +61654,8 @@ "dimension_fields": { "$ref": "#/components/schemas/indices._types:MappingLimitSettingsDimensionFields" }, - "source": { - "$ref": "#/components/schemas/indices._types:MappingLimitSettingsSourceFields" + "source.mode": { + "$ref": "#/components/schemas/indices._types:SourceMode" }, "ignore_malformed": { "oneOf": [ @@ -61741,17 +61741,6 @@ } } }, - "indices._types:MappingLimitSettingsSourceFields": { - "type": "object", - "properties": { - "mode": { - "$ref": "#/components/schemas/indices._types:SourceMode" - } - }, - "required": [ - "mode" - ] - }, "indices._types:SourceMode": { "type": "string", "enum": [ diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index c50512a757..6ff687a7ec 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -40502,8 +40502,8 @@ "dimension_fields": { "$ref": "#/components/schemas/indices._types:MappingLimitSettingsDimensionFields" }, - "source": { - "$ref": "#/components/schemas/indices._types:MappingLimitSettingsSourceFields" + "source.mode": { + "$ref": "#/components/schemas/indices._types:SourceMode" }, "ignore_malformed": { "oneOf": [ @@ -40589,17 +40589,6 @@ } } }, - "indices._types:MappingLimitSettingsSourceFields": { - "type": "object", - "properties": { - "mode": { - "$ref": "#/components/schemas/indices._types:SourceMode" - } - }, - "required": [ - "mode" - ] - }, "indices._types:SourceMode": { "type": "string", "enum": [ diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 6a9afedc80..ef8b58aadc 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -53915,7 +53915,7 @@ "name": "FieldType", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/Property.ts#L190-L238" + "specLocation": "_types/mapping/Property.ts#L189-L237" }, { "kind": "enum", @@ -87709,7 +87709,7 @@ "name": "Property", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/Property.ts#L119-L188", + "specLocation": "_types/mapping/Property.ts#L118-L187", "type": { "items": [ { @@ -95726,7 +95726,7 @@ "name": "SourceMode", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L495-L499" + "specLocation": "indices/_types/IndexSettings.ts#L491-L495" }, { "isOpen": true, @@ -95753,7 +95753,7 @@ "name": "StorageType", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L531-L559" + "specLocation": "indices/_types/IndexSettings.ts#L527-L555" }, { "kind": "enum", @@ -115041,7 +115041,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L501-L506" + "specLocation": "indices/_types/IndexSettings.ts#L497-L502" }, { "kind": "interface", @@ -115073,7 +115073,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L508-L511" + "specLocation": "indices/_types/IndexSettings.ts#L504-L507" }, { "kind": "interface", @@ -115127,7 +115127,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L513-L518" + "specLocation": "indices/_types/IndexSettings.ts#L509-L514" }, { "kind": "interface", @@ -116040,12 +116040,12 @@ } }, { - "name": "source", + "name": "source.mode", "required": false, "type": { "kind": "instance_of", "type": { - "name": "MappingLimitSettingsSourceFields", + "name": "SourceMode", "namespace": "indices._types" } } @@ -116249,27 +116249,6 @@ ], "specLocation": "indices/_types/IndexSettings.ts#L483-L489" }, - { - "kind": "interface", - "name": { - "name": "MappingLimitSettingsSourceFields", - "namespace": "indices._types" - }, - "properties": [ - { - "name": "mode", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "SourceMode", - "namespace": "indices._types" - } - } - } - ], - "specLocation": "indices/_types/IndexSettings.ts#L491-L493" - }, { "kind": "interface", "name": { @@ -116322,7 +116301,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L574-L579" + "specLocation": "indices/_types/IndexSettings.ts#L570-L575" }, { "kind": "interface", @@ -116346,7 +116325,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L581-L588" + "specLocation": "indices/_types/IndexSettings.ts#L577-L584" }, { "kind": "interface", @@ -116367,7 +116346,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L561-L563" + "specLocation": "indices/_types/IndexSettings.ts#L557-L559" }, { "kind": "interface", @@ -116389,7 +116368,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L565-L572" + "specLocation": "indices/_types/IndexSettings.ts#L561-L568" }, { "kind": "interface", @@ -116422,7 +116401,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L520-L529" + "specLocation": "indices/_types/IndexSettings.ts#L516-L525" }, { "kind": "interface", diff --git a/output/schema/schema.json b/output/schema/schema.json index 1aa8f4696a..74ff1d2a85 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -76587,7 +76587,7 @@ "name": "FieldType", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/Property.ts#L190-L238" + "specLocation": "_types/mapping/Property.ts#L189-L237" }, { "kind": "interface", @@ -78308,7 +78308,7 @@ "name": "Property", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/Property.ts#L119-L188", + "specLocation": "_types/mapping/Property.ts#L118-L187", "type": { "kind": "union_of", "items": [ @@ -129601,7 +129601,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L561-L563" + "specLocation": "indices/_types/IndexSettings.ts#L557-L559" }, { "kind": "interface", @@ -129623,7 +129623,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L565-L572" + "specLocation": "indices/_types/IndexSettings.ts#L561-L568" }, { "kind": "interface", @@ -129677,7 +129677,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L574-L579" + "specLocation": "indices/_types/IndexSettings.ts#L570-L575" }, { "kind": "interface", @@ -129701,7 +129701,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L581-L588" + "specLocation": "indices/_types/IndexSettings.ts#L577-L584" }, { "kind": "enum", @@ -129813,12 +129813,12 @@ } }, { - "name": "source", + "name": "source.mode", "required": false, "type": { "kind": "instance_of", "type": { - "name": "MappingLimitSettingsSourceFields", + "name": "SourceMode", "namespace": "indices._types" } } @@ -129962,27 +129962,6 @@ ], "specLocation": "indices/_types/IndexSettings.ts#L465-L472" }, - { - "kind": "interface", - "name": { - "name": "MappingLimitSettingsSourceFields", - "namespace": "indices._types" - }, - "properties": [ - { - "name": "mode", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "SourceMode", - "namespace": "indices._types" - } - } - } - ], - "specLocation": "indices/_types/IndexSettings.ts#L491-L493" - }, { "kind": "interface", "name": { @@ -130815,7 +130794,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L501-L506" + "specLocation": "indices/_types/IndexSettings.ts#L497-L502" }, { "kind": "interface", @@ -130869,7 +130848,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L513-L518" + "specLocation": "indices/_types/IndexSettings.ts#L509-L514" }, { "kind": "interface", @@ -130901,7 +130880,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L508-L511" + "specLocation": "indices/_types/IndexSettings.ts#L504-L507" }, { "kind": "interface", @@ -130955,7 +130934,7 @@ "name": "SourceMode", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L495-L499" + "specLocation": "indices/_types/IndexSettings.ts#L491-L495" }, { "kind": "interface", @@ -130988,7 +130967,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L520-L529" + "specLocation": "indices/_types/IndexSettings.ts#L516-L525" }, { "kind": "enum", @@ -131015,7 +130994,7 @@ "name": "StorageType", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L531-L559" + "specLocation": "indices/_types/IndexSettings.ts#L527-L555" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index f67253d644..84e0b2f544 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11362,7 +11362,7 @@ export interface IndicesMappingLimitSettings { nested_objects?: IndicesMappingLimitSettingsNestedObjects field_name_length?: IndicesMappingLimitSettingsFieldNameLength dimension_fields?: IndicesMappingLimitSettingsDimensionFields - source?: IndicesMappingLimitSettingsSourceFields + 'source.mode'?: IndicesSourceMode ignore_malformed?: boolean | string } @@ -11386,10 +11386,6 @@ export interface IndicesMappingLimitSettingsNestedObjects { limit?: long } -export interface IndicesMappingLimitSettingsSourceFields { - mode: IndicesSourceMode -} - export interface IndicesMappingLimitSettingsTotalFields { limit?: long | string ignore_dynamic_beyond_limit?: boolean | string diff --git a/specification/indices/_types/IndexSettings.ts b/specification/indices/_types/IndexSettings.ts index eee64062e0..b80d3fc7ec 100644 --- a/specification/indices/_types/IndexSettings.ts +++ b/specification/indices/_types/IndexSettings.ts @@ -420,7 +420,7 @@ export class MappingLimitSettings { nested_objects?: MappingLimitSettingsNestedObjects field_name_length?: MappingLimitSettingsFieldNameLength dimension_fields?: MappingLimitSettingsDimensionFields - source?: MappingLimitSettingsSourceFields + 'source.mode'?: SourceMode ignore_malformed?: boolean | string } @@ -488,10 +488,6 @@ export class MappingLimitSettingsDimensionFields { limit?: long } -export class MappingLimitSettingsSourceFields { - mode: SourceMode -} - export enum SourceMode { disabled, stored, From 4a282b5bbe2c44d208375d20d6d65a6229757f11 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Fri, 24 Jan 2025 14:50:57 +0400 Subject: [PATCH 3/3] Revert "Skip intermediate class" This reverts commit 3b71a0db0dc4c31df3bd473d36fed69f0e91ca1d. --- output/openapi/elasticsearch-openapi.json | 15 ++++++- .../elasticsearch-serverless-openapi.json | 15 ++++++- output/schema/schema-serverless.json | 45 ++++++++++++++----- output/schema/schema.json | 45 ++++++++++++++----- output/typescript/types.ts | 6 ++- specification/indices/_types/IndexSettings.ts | 6 ++- 6 files changed, 102 insertions(+), 30 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 8e49e7c09d..a57a922c3f 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -61665,8 +61665,8 @@ "dimension_fields": { "$ref": "#/components/schemas/indices._types:MappingLimitSettingsDimensionFields" }, - "source.mode": { - "$ref": "#/components/schemas/indices._types:SourceMode" + "source": { + "$ref": "#/components/schemas/indices._types:MappingLimitSettingsSourceFields" }, "ignore_malformed": { "oneOf": [ @@ -61752,6 +61752,17 @@ } } }, + "indices._types:MappingLimitSettingsSourceFields": { + "type": "object", + "properties": { + "mode": { + "$ref": "#/components/schemas/indices._types:SourceMode" + } + }, + "required": [ + "mode" + ] + }, "indices._types:SourceMode": { "type": "string", "enum": [ diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index e1cf7a1052..a3d6ef4fba 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -40513,8 +40513,8 @@ "dimension_fields": { "$ref": "#/components/schemas/indices._types:MappingLimitSettingsDimensionFields" }, - "source.mode": { - "$ref": "#/components/schemas/indices._types:SourceMode" + "source": { + "$ref": "#/components/schemas/indices._types:MappingLimitSettingsSourceFields" }, "ignore_malformed": { "oneOf": [ @@ -40600,6 +40600,17 @@ } } }, + "indices._types:MappingLimitSettingsSourceFields": { + "type": "object", + "properties": { + "mode": { + "$ref": "#/components/schemas/indices._types:SourceMode" + } + }, + "required": [ + "mode" + ] + }, "indices._types:SourceMode": { "type": "string", "enum": [ diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 87e8431fe4..88a85e860c 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -95726,7 +95726,7 @@ "name": "SourceMode", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L497-L501" + "specLocation": "indices/_types/IndexSettings.ts#L501-L505" }, { "isOpen": true, @@ -95753,7 +95753,7 @@ "name": "StorageType", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L533-L561" + "specLocation": "indices/_types/IndexSettings.ts#L537-L565" }, { "kind": "enum", @@ -115041,7 +115041,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L503-L508" + "specLocation": "indices/_types/IndexSettings.ts#L507-L512" }, { "kind": "interface", @@ -115073,7 +115073,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L510-L513" + "specLocation": "indices/_types/IndexSettings.ts#L514-L517" }, { "kind": "interface", @@ -115127,7 +115127,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L515-L520" + "specLocation": "indices/_types/IndexSettings.ts#L519-L524" }, { "kind": "interface", @@ -116065,12 +116065,12 @@ } }, { - "name": "source.mode", + "name": "source", "required": false, "type": { "kind": "instance_of", "type": { - "name": "SourceMode", + "name": "MappingLimitSettingsSourceFields", "namespace": "indices._types" } } @@ -116274,6 +116274,27 @@ ], "specLocation": "indices/_types/IndexSettings.ts#L489-L495" }, + { + "kind": "interface", + "name": { + "name": "MappingLimitSettingsSourceFields", + "namespace": "indices._types" + }, + "properties": [ + { + "name": "mode", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "SourceMode", + "namespace": "indices._types" + } + } + } + ], + "specLocation": "indices/_types/IndexSettings.ts#L497-L499" + }, { "kind": "interface", "name": { @@ -116326,7 +116347,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L576-L581" + "specLocation": "indices/_types/IndexSettings.ts#L580-L585" }, { "kind": "interface", @@ -116350,7 +116371,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L583-L590" + "specLocation": "indices/_types/IndexSettings.ts#L587-L594" }, { "kind": "interface", @@ -116371,7 +116392,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L563-L565" + "specLocation": "indices/_types/IndexSettings.ts#L567-L569" }, { "kind": "interface", @@ -116393,7 +116414,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L567-L574" + "specLocation": "indices/_types/IndexSettings.ts#L571-L578" }, { "kind": "interface", @@ -116426,7 +116447,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L522-L531" + "specLocation": "indices/_types/IndexSettings.ts#L526-L535" }, { "kind": "interface", diff --git a/output/schema/schema.json b/output/schema/schema.json index 97c071f32f..3ac0f877ec 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -129626,7 +129626,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L563-L565" + "specLocation": "indices/_types/IndexSettings.ts#L567-L569" }, { "kind": "interface", @@ -129648,7 +129648,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L567-L574" + "specLocation": "indices/_types/IndexSettings.ts#L571-L578" }, { "kind": "interface", @@ -129702,7 +129702,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L576-L581" + "specLocation": "indices/_types/IndexSettings.ts#L580-L585" }, { "kind": "interface", @@ -129726,7 +129726,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L583-L590" + "specLocation": "indices/_types/IndexSettings.ts#L587-L594" }, { "kind": "enum", @@ -129838,12 +129838,12 @@ } }, { - "name": "source.mode", + "name": "source", "required": false, "type": { "kind": "instance_of", "type": { - "name": "SourceMode", + "name": "MappingLimitSettingsSourceFields", "namespace": "indices._types" } } @@ -129987,6 +129987,27 @@ ], "specLocation": "indices/_types/IndexSettings.ts#L471-L478" }, + { + "kind": "interface", + "name": { + "name": "MappingLimitSettingsSourceFields", + "namespace": "indices._types" + }, + "properties": [ + { + "name": "mode", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "SourceMode", + "namespace": "indices._types" + } + } + } + ], + "specLocation": "indices/_types/IndexSettings.ts#L497-L499" + }, { "kind": "interface", "name": { @@ -130819,7 +130840,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L503-L508" + "specLocation": "indices/_types/IndexSettings.ts#L507-L512" }, { "kind": "interface", @@ -130873,7 +130894,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L515-L520" + "specLocation": "indices/_types/IndexSettings.ts#L519-L524" }, { "kind": "interface", @@ -130905,7 +130926,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L510-L513" + "specLocation": "indices/_types/IndexSettings.ts#L514-L517" }, { "kind": "interface", @@ -130959,7 +130980,7 @@ "name": "SourceMode", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L497-L501" + "specLocation": "indices/_types/IndexSettings.ts#L501-L505" }, { "kind": "interface", @@ -130992,7 +131013,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L522-L531" + "specLocation": "indices/_types/IndexSettings.ts#L526-L535" }, { "kind": "enum", @@ -131019,7 +131040,7 @@ "name": "StorageType", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L533-L561" + "specLocation": "indices/_types/IndexSettings.ts#L537-L565" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 5697fe08cf..cefe1da84a 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11363,7 +11363,7 @@ export interface IndicesMappingLimitSettings { nested_objects?: IndicesMappingLimitSettingsNestedObjects field_name_length?: IndicesMappingLimitSettingsFieldNameLength dimension_fields?: IndicesMappingLimitSettingsDimensionFields - 'source.mode'?: IndicesSourceMode + source?: IndicesMappingLimitSettingsSourceFields ignore_malformed?: boolean | string } @@ -11387,6 +11387,10 @@ export interface IndicesMappingLimitSettingsNestedObjects { limit?: long } +export interface IndicesMappingLimitSettingsSourceFields { + mode: IndicesSourceMode +} + export interface IndicesMappingLimitSettingsTotalFields { limit?: long | string ignore_dynamic_beyond_limit?: boolean | string diff --git a/specification/indices/_types/IndexSettings.ts b/specification/indices/_types/IndexSettings.ts index 9a7cc32c45..038ea7617b 100644 --- a/specification/indices/_types/IndexSettings.ts +++ b/specification/indices/_types/IndexSettings.ts @@ -426,7 +426,7 @@ export class MappingLimitSettings { nested_objects?: MappingLimitSettingsNestedObjects field_name_length?: MappingLimitSettingsFieldNameLength dimension_fields?: MappingLimitSettingsDimensionFields - 'source.mode'?: SourceMode + source?: MappingLimitSettingsSourceFields ignore_malformed?: boolean | string } @@ -494,6 +494,10 @@ export class MappingLimitSettingsDimensionFields { limit?: long } +export class MappingLimitSettingsSourceFields { + mode: SourceMode +} + export enum SourceMode { disabled, stored,