Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] [Streams] Small type changes for advanced mapping parameters (#…
…211817) (#211906) # Backport This will backport the following commits from `main` to `8.x`: - [[Streams] Small type changes for advanced mapping parameters (#211817)](#211817) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Kerry Gallagher","email":"kerry.gallagher@elastic.co"},"sourceCommit":{"committedDate":"2025-02-20T13:21:58Z","message":"[Streams] Small type changes for advanced mapping parameters (#211817)\n\n## Summary\n\nSwitches to the `recursiveRecord` schema so we don't get these in\nconsole:\n\n```\n[2025-02-19T15:47:07.556+01:00][WARN ][plugins.streams] Warning for PUT /api/streams/{name}: schema ZodUnknown at body.stream.ingest.wired.fields is not inspectable and could lead to runtime exceptions, convert it to a supported schema\n[2025-02-19T15:47:07.557+01:00][WARN ][plugins.streams] Warning for POST /api/streams/{name}/schema/fields_simulation: schema ZodUnknown at body.field_definitions is not inspectable and could lead to runtime exceptions, convert it to a supported schema\n[2025-02-19T15:47:07.557+01:00][WARN ][plugins.streams] Warning for POST /api/streams/{name}/processing/_simulate: schema ZodUnknown at body.detected_fields is not inspectable and could lead to runtime exceptions, convert it to a supported schema\n```\n\nI had to move the schema definition / types into another file otherwise\na circular dependency was introduced with the `fields/index.ts` file,\ncausing a `Cannot read properties of undefined (reading '_parse')`\nerror.\n\nAs far as I can see the `recursiveRecord` schema should handle / cover\nthe ES `MappingProperty` type fine.","sha":"670da35d4101fc64139876fbdf2aee5975036399","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:version","Feature:Streams","v9.1.0","v8.19.0"],"title":"[Streams] Small type changes for advanced mapping parameters","number":211817,"url":"https://github.com/elastic/kibana/pull/211817","mergeCommit":{"message":"[Streams] Small type changes for advanced mapping parameters (#211817)\n\n## Summary\n\nSwitches to the `recursiveRecord` schema so we don't get these in\nconsole:\n\n```\n[2025-02-19T15:47:07.556+01:00][WARN ][plugins.streams] Warning for PUT /api/streams/{name}: schema ZodUnknown at body.stream.ingest.wired.fields is not inspectable and could lead to runtime exceptions, convert it to a supported schema\n[2025-02-19T15:47:07.557+01:00][WARN ][plugins.streams] Warning for POST /api/streams/{name}/schema/fields_simulation: schema ZodUnknown at body.field_definitions is not inspectable and could lead to runtime exceptions, convert it to a supported schema\n[2025-02-19T15:47:07.557+01:00][WARN ][plugins.streams] Warning for POST /api/streams/{name}/processing/_simulate: schema ZodUnknown at body.detected_fields is not inspectable and could lead to runtime exceptions, convert it to a supported schema\n```\n\nI had to move the schema definition / types into another file otherwise\na circular dependency was introduced with the `fields/index.ts` file,\ncausing a `Cannot read properties of undefined (reading '_parse')`\nerror.\n\nAs far as I can see the `recursiveRecord` schema should handle / cover\nthe ES `MappingProperty` type fine.","sha":"670da35d4101fc64139876fbdf2aee5975036399"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/211817","number":211817,"mergeCommit":{"message":"[Streams] Small type changes for advanced mapping parameters (#211817)\n\n## Summary\n\nSwitches to the `recursiveRecord` schema so we don't get these in\nconsole:\n\n```\n[2025-02-19T15:47:07.556+01:00][WARN ][plugins.streams] Warning for PUT /api/streams/{name}: schema ZodUnknown at body.stream.ingest.wired.fields is not inspectable and could lead to runtime exceptions, convert it to a supported schema\n[2025-02-19T15:47:07.557+01:00][WARN ][plugins.streams] Warning for POST /api/streams/{name}/schema/fields_simulation: schema ZodUnknown at body.field_definitions is not inspectable and could lead to runtime exceptions, convert it to a supported schema\n[2025-02-19T15:47:07.557+01:00][WARN ][plugins.streams] Warning for POST /api/streams/{name}/processing/_simulate: schema ZodUnknown at body.detected_fields is not inspectable and could lead to runtime exceptions, convert it to a supported schema\n```\n\nI had to move the schema definition / types into another file otherwise\na circular dependency was introduced with the `fields/index.ts` file,\ncausing a `Cannot read properties of undefined (reading '_parse')`\nerror.\n\nAs far as I can see the `recursiveRecord` schema should handle / cover\nthe ES `MappingProperty` type fine.","sha":"670da35d4101fc64139876fbdf2aee5975036399"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Kerry Gallagher <kerry.gallagher@elastic.co>
- Loading branch information