From 293778f86fca3ba91b14b0147145ef75480f5e25 Mon Sep 17 00:00:00 2001 From: Keith Massey Date: Fri, 15 Aug 2025 10:59:26 -0500 Subject: [PATCH] Adding effective-mapping to the ingest simulate response --- output/schema/schema.json | 19 ++++++++++++---- output/typescript/types.ts | 3 ++- .../simulate/ingest/SimulateIngestResponse.ts | 2 ++ .../SimulateIngestResponseExample3.yaml | 22 +++++++++++++++++-- 4 files changed, 39 insertions(+), 7 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 59331ae7f5..8b872b7968 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -248727,9 +248727,20 @@ "namespace": "_types" } } + }, + { + "name": "effective_mapping", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "TypeMapping", + "namespace": "_types.mapping" + } + } } ], - "specLocation": "simulate/ingest/SimulateIngestResponse.ts#L35-L78" + "specLocation": "simulate/ingest/SimulateIngestResponse.ts#L36-L80" }, { "kind": "enum", @@ -249071,14 +249082,14 @@ "SimulateIngestResponseExample3": { "description": "A successful response when the simulation uses pipeline substitutions.", "summary": "Use pipeline substitutions", - "value": "{\n \"docs\": [\n {\n \"doc\": {\n \"_id\": \"123\",\n \"_index\": \"my-index\",\n \"_version\": -3,\n \"_source\": {\n \"foo\": \"foo\"\n },\n \"executed_pipelines\": []\n }\n },\n {\n \"doc\": {\n \"_id\": \"456\",\n \"_index\": \"my-index\",\n \"_version\": -3,\n \"_source\": {\n \"bar\": \"rab\"\n },\n \"executed_pipelines\": []\n }\n }\n ]\n}" + "value": "{\n \"docs\": [\n {\n \"doc\": {\n \"_id\": \"123\",\n \"_index\": \"my-index\",\n \"_version\": -3,\n \"_source\": {\n \"foo\": \"foo\"\n },\n \"executed_pipelines\": [],\n \"effective_mapping\": {\n \"_doc\": {\n \"properties\": {\n \"foo\": {\n \"type\": \"keyword\"\n }\n }\n }\n }\n }\n },\n {\n \"doc\": {\n \"_id\": \"456\",\n \"_index\": \"my-index\",\n \"_version\": -3,\n \"_source\": {\n \"bar\": \"rab\"\n },\n \"executed_pipelines\": [],\n \"effective_mapping\": {\n \"_doc\": {\n \"properties\": {\n \"bar\": {\n \"type\": \"keyword\"\n }\n }\n }\n }\n }\n }\n ]\n}" } }, "name": { "name": "Response", "namespace": "simulate.ingest" }, - "specLocation": "simulate/ingest/SimulateIngestResponse.ts#L27-L29" + "specLocation": "simulate/ingest/SimulateIngestResponse.ts#L28-L30" }, { "kind": "interface", @@ -249099,7 +249110,7 @@ } } ], - "specLocation": "simulate/ingest/SimulateIngestResponse.ts#L31-L33" + "specLocation": "simulate/ingest/SimulateIngestResponse.ts#L32-L34" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 0d8e634199..32c814521e 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -21162,9 +21162,10 @@ export interface SimulateIngestIngestDocumentSimulationKeys { executed_pipelines: string[] ignored_fields?: Record[] error?: ErrorCause + effective_mapping?: MappingTypeMapping } export type SimulateIngestIngestDocumentSimulation = SimulateIngestIngestDocumentSimulationKeys - & { [property: string]: string | Id | IndexName | Record | SpecUtilsStringified | string[] | Record[] | ErrorCause } + & { [property: string]: string | Id | IndexName | Record | SpecUtilsStringified | string[] | Record[] | ErrorCause | MappingTypeMapping } export type SimulateIngestMergeType = 'index' | 'template' diff --git a/specification/simulate/ingest/SimulateIngestResponse.ts b/specification/simulate/ingest/SimulateIngestResponse.ts index 1a88b7fb13..8252423078 100644 --- a/specification/simulate/ingest/SimulateIngestResponse.ts +++ b/specification/simulate/ingest/SimulateIngestResponse.ts @@ -19,6 +19,7 @@ import { Id, IndexName, VersionNumber } from '@_types/common' import { ErrorCause } from '@_types/Errors' +import { TypeMapping } from '@_types/mapping/TypeMapping' import { AdditionalProperties } from '@spec_utils/behaviors' import { Dictionary } from '@spec_utils/Dictionary' import { Stringified } from '@spec_utils/Stringified' @@ -75,4 +76,5 @@ export class IngestDocumentSimulation * doc. */ error?: ErrorCause + effective_mapping?: TypeMapping } diff --git a/specification/simulate/ingest/examples/response/SimulateIngestResponseExample3.yaml b/specification/simulate/ingest/examples/response/SimulateIngestResponseExample3.yaml index fdd1f30ec3..66fa6c6483 100644 --- a/specification/simulate/ingest/examples/response/SimulateIngestResponseExample3.yaml +++ b/specification/simulate/ingest/examples/response/SimulateIngestResponseExample3.yaml @@ -13,7 +13,16 @@ value: |- "_source": { "foo": "foo" }, - "executed_pipelines": [] + "executed_pipelines": [], + "effective_mapping": { + "_doc": { + "properties": { + "foo": { + "type": "keyword" + } + } + } + } } }, { @@ -24,7 +33,16 @@ value: |- "_source": { "bar": "rab" }, - "executed_pipelines": [] + "executed_pipelines": [], + "effective_mapping": { + "_doc": { + "properties": { + "bar": { + "type": "keyword" + } + } + } + } } } ]