Skip to content

Commit

Permalink
[Auto Import] Make sure the committed schema is generated (elastic#19…
Browse files Browse the repository at this point in the history
…5302)

## 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 elastic#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).
  • Loading branch information
ilyannn authored Oct 7, 2024
1 parent 99970dc commit 1599e4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const RawSamples = z.array(z.string());
* mapping object to ECS Mapping Request.
*/
export type Mapping = z.infer<typeof Mapping>;
export const Mapping = z.object({}).passthrough();
export const Mapping = z.object({}).catchall(z.unknown());

/**
* LLM Connector to be used in each API request.
Expand All @@ -58,7 +58,7 @@ export const Connector = z.string();
* An array of processed documents.
*/
export type Docs = z.infer<typeof Docs>;
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ components:
Mapping:
type: object
description: mapping object to ECS Mapping Request.
additionalProperties: true

Connector:
type: string
Expand All @@ -41,6 +42,7 @@ components:
description: An array of processed documents.
items:
type: object
additionalProperties: true

SamplesFormatName:
type: string
Expand Down

0 comments on commit 1599e4f

Please sign in to comment.