From 1599e4f61b3e5caf60730be5a2def73f6d603148 Mon Sep 17 00:00:00 2001 From: Ilya Nikokoshev Date: Mon, 7 Oct 2024 22:47:43 +0300 Subject: [PATCH] [Auto Import] Make sure the committed schema is generated (#195302) ## Summary Previously our schema and `.gen` files were not in sync, in the sense that ``` git checkout main && yarn kbn bootstrap && node scripts/generate_openapi --rootDir ./x-pack/plugins/integration_assistant && git diff ``` returned a non-trivial diff, despite the implementation in https://github.com/elastic/kibana/issues/193243. In this PR we - add missing additionalProperties to the schema; - generate and commit exactly the generated files. There don't seem to be any effects from the change from `passthrough` to `catchall`. Tested with Teleport (see GitHub). --- .../common/api/model/common_attributes.gen.ts | 4 ++-- .../common/api/model/common_attributes.schema.yaml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/integration_assistant/common/api/model/common_attributes.gen.ts b/x-pack/plugins/integration_assistant/common/api/model/common_attributes.gen.ts index 59fe7d461698f..49e6f12691429 100644 --- a/x-pack/plugins/integration_assistant/common/api/model/common_attributes.gen.ts +++ b/x-pack/plugins/integration_assistant/common/api/model/common_attributes.gen.ts @@ -46,7 +46,7 @@ export const RawSamples = z.array(z.string()); * mapping object to ECS Mapping Request. */ export type Mapping = z.infer; -export const Mapping = z.object({}).passthrough(); +export const Mapping = z.object({}).catchall(z.unknown()); /** * LLM Connector to be used in each API request. @@ -58,7 +58,7 @@ export const Connector = z.string(); * An array of processed documents. */ export type Docs = z.infer; -export const Docs = z.array(z.object({}).passthrough()); +export const Docs = z.array(z.object({}).catchall(z.unknown())); /** * The name of the log samples format. diff --git a/x-pack/plugins/integration_assistant/common/api/model/common_attributes.schema.yaml b/x-pack/plugins/integration_assistant/common/api/model/common_attributes.schema.yaml index 0af01834970c7..073b485b1cb3d 100644 --- a/x-pack/plugins/integration_assistant/common/api/model/common_attributes.schema.yaml +++ b/x-pack/plugins/integration_assistant/common/api/model/common_attributes.schema.yaml @@ -31,6 +31,7 @@ components: Mapping: type: object description: mapping object to ECS Mapping Request. + additionalProperties: true Connector: type: string @@ -41,6 +42,7 @@ components: description: An array of processed documents. items: type: object + additionalProperties: true SamplesFormatName: type: string