[OpenAPI] Do not generate imports for local references#250723
Merged
janmonschke merged 1 commit intomainfrom Jan 28, 2026
Merged
[OpenAPI] Do not generate imports for local references#250723janmonschke merged 1 commit intomainfrom
janmonschke merged 1 commit intomainfrom
Conversation
Contributor
|
Pinging @elastic/kibana-cases (Team:Cases) |
maximpn
approved these changes
Jan 28, 2026
Contributor
maximpn
left a comment
There was a problem hiding this comment.
@janmonschke Thanks for improving the OpenAPI code generator 👍
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
|
Contributor
|
Starting backport for target branches: 8.19, 9.1, 9.2, 9.3 https://github.com/elastic/kibana/actions/runs/21475232772 |
Contributor
|
Starting backport for target branches: 8.19, 9.1, 9.2, 9.3 https://github.com/elastic/kibana/actions/runs/21475232814 |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Jan 29, 2026
## Summary
I noticed that when generating schemas from yaml files with local
references, the generator will create import statements for the
referenced types.
```yml
openapi: 3.0.1
paths:
/api/cases:
post:
parameters:
- $ref: '#/components/parameters/kbn_xsrf'
components:
parameters:
kbn_xsrf:
schema:
type: string
```
Will generate:
```typescript
import {, #/components/parameters/kbn_xsrf' } (...)
```
The fix I am proposing will skip generating import statements for local
references.
(cherry picked from commit a304458)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Jan 29, 2026
## Summary
I noticed that when generating schemas from yaml files with local
references, the generator will create import statements for the
referenced types.
```yml
openapi: 3.0.1
paths:
/api/cases:
post:
parameters:
- $ref: '#/components/parameters/kbn_xsrf'
components:
parameters:
kbn_xsrf:
schema:
type: string
```
Will generate:
```typescript
import {, #/components/parameters/kbn_xsrf' } (...)
```
The fix I am proposing will skip generating import statements for local
references.
(cherry picked from commit a304458)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Jan 29, 2026
## Summary
I noticed that when generating schemas from yaml files with local
references, the generator will create import statements for the
referenced types.
```yml
openapi: 3.0.1
paths:
/api/cases:
post:
parameters:
- $ref: '#/components/parameters/kbn_xsrf'
components:
parameters:
kbn_xsrf:
schema:
type: string
```
Will generate:
```typescript
import {, #/components/parameters/kbn_xsrf' } (...)
```
The fix I am proposing will skip generating import statements for local
references.
(cherry picked from commit a304458)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Jan 29, 2026
## Summary
I noticed that when generating schemas from yaml files with local
references, the generator will create import statements for the
referenced types.
```yml
openapi: 3.0.1
paths:
/api/cases:
post:
parameters:
- $ref: '#/components/parameters/kbn_xsrf'
components:
parameters:
kbn_xsrf:
schema:
type: string
```
Will generate:
```typescript
import {, #/components/parameters/kbn_xsrf' } (...)
```
The fix I am proposing will skip generating import statements for local
references.
(cherry picked from commit a304458)
Contributor
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
kibanamachine
added a commit
that referenced
this pull request
Jan 29, 2026
#250869) # Backport This will backport the following commits from `main` to `9.3`: - [[OpenAPI] Do not generate imports for local references (#250723)](#250723) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Jan Monschke","email":"jan.monschke@elastic.co"},"sourceCommit":{"committedDate":"2026-01-28T15:14:18Z","message":"[OpenAPI] Do not generate imports for local references (#250723)\n\n## Summary\n\nI noticed that when generating schemas from yaml files with local\nreferences, the generator will create import statements for the\nreferenced types.\n\n```yml\nopenapi: 3.0.1\npaths:\n /api/cases:\n post:\n parameters:\n - $ref: '#/components/parameters/kbn_xsrf'\ncomponents:\n parameters:\n kbn_xsrf:\n schema:\n type: string\n```\n\nWill generate:\n\n```typescript\nimport {, #/components/parameters/kbn_xsrf' } (...)\n```\n\nThe fix I am proposing will skip generating import statements for local\nreferences.","sha":"a304458f9ba46cd208f9932e4af139b79560a206","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","Team:Cases","v9.4.0"],"title":"[OpenAPI] Do not generate imports for local references","number":250723,"url":"https://github.com/elastic/kibana/pull/250723","mergeCommit":{"message":"[OpenAPI] Do not generate imports for local references (#250723)\n\n## Summary\n\nI noticed that when generating schemas from yaml files with local\nreferences, the generator will create import statements for the\nreferenced types.\n\n```yml\nopenapi: 3.0.1\npaths:\n /api/cases:\n post:\n parameters:\n - $ref: '#/components/parameters/kbn_xsrf'\ncomponents:\n parameters:\n kbn_xsrf:\n schema:\n type: string\n```\n\nWill generate:\n\n```typescript\nimport {, #/components/parameters/kbn_xsrf' } (...)\n```\n\nThe fix I am proposing will skip generating import statements for local\nreferences.","sha":"a304458f9ba46cd208f9932e4af139b79560a206"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/250723","number":250723,"mergeCommit":{"message":"[OpenAPI] Do not generate imports for local references (#250723)\n\n## Summary\n\nI noticed that when generating schemas from yaml files with local\nreferences, the generator will create import statements for the\nreferenced types.\n\n```yml\nopenapi: 3.0.1\npaths:\n /api/cases:\n post:\n parameters:\n - $ref: '#/components/parameters/kbn_xsrf'\ncomponents:\n parameters:\n kbn_xsrf:\n schema:\n type: string\n```\n\nWill generate:\n\n```typescript\nimport {, #/components/parameters/kbn_xsrf' } (...)\n```\n\nThe fix I am proposing will skip generating import statements for local\nreferences.","sha":"a304458f9ba46cd208f9932e4af139b79560a206"}}]}] BACKPORT--> Co-authored-by: Jan Monschke <jan.monschke@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
kibanamachine
added a commit
that referenced
this pull request
Jan 29, 2026
#250868) # Backport This will backport the following commits from `main` to `9.2`: - [[OpenAPI] Do not generate imports for local references (#250723)](#250723) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Jan Monschke","email":"jan.monschke@elastic.co"},"sourceCommit":{"committedDate":"2026-01-28T15:14:18Z","message":"[OpenAPI] Do not generate imports for local references (#250723)\n\n## Summary\n\nI noticed that when generating schemas from yaml files with local\nreferences, the generator will create import statements for the\nreferenced types.\n\n```yml\nopenapi: 3.0.1\npaths:\n /api/cases:\n post:\n parameters:\n - $ref: '#/components/parameters/kbn_xsrf'\ncomponents:\n parameters:\n kbn_xsrf:\n schema:\n type: string\n```\n\nWill generate:\n\n```typescript\nimport {, #/components/parameters/kbn_xsrf' } (...)\n```\n\nThe fix I am proposing will skip generating import statements for local\nreferences.","sha":"a304458f9ba46cd208f9932e4af139b79560a206","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","Team:Cases","v9.4.0"],"title":"[OpenAPI] Do not generate imports for local references","number":250723,"url":"https://github.com/elastic/kibana/pull/250723","mergeCommit":{"message":"[OpenAPI] Do not generate imports for local references (#250723)\n\n## Summary\n\nI noticed that when generating schemas from yaml files with local\nreferences, the generator will create import statements for the\nreferenced types.\n\n```yml\nopenapi: 3.0.1\npaths:\n /api/cases:\n post:\n parameters:\n - $ref: '#/components/parameters/kbn_xsrf'\ncomponents:\n parameters:\n kbn_xsrf:\n schema:\n type: string\n```\n\nWill generate:\n\n```typescript\nimport {, #/components/parameters/kbn_xsrf' } (...)\n```\n\nThe fix I am proposing will skip generating import statements for local\nreferences.","sha":"a304458f9ba46cd208f9932e4af139b79560a206"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/250723","number":250723,"mergeCommit":{"message":"[OpenAPI] Do not generate imports for local references (#250723)\n\n## Summary\n\nI noticed that when generating schemas from yaml files with local\nreferences, the generator will create import statements for the\nreferenced types.\n\n```yml\nopenapi: 3.0.1\npaths:\n /api/cases:\n post:\n parameters:\n - $ref: '#/components/parameters/kbn_xsrf'\ncomponents:\n parameters:\n kbn_xsrf:\n schema:\n type: string\n```\n\nWill generate:\n\n```typescript\nimport {, #/components/parameters/kbn_xsrf' } (...)\n```\n\nThe fix I am proposing will skip generating import statements for local\nreferences.","sha":"a304458f9ba46cd208f9932e4af139b79560a206"}}]}] BACKPORT--> Co-authored-by: Jan Monschke <jan.monschke@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
kibanamachine
added a commit
that referenced
this pull request
Jan 30, 2026
… (#250866) # Backport This will backport the following commits from `main` to `8.19`: - [[OpenAPI] Do not generate imports for local references (#250723)](#250723) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Jan Monschke","email":"jan.monschke@elastic.co"},"sourceCommit":{"committedDate":"2026-01-28T15:14:18Z","message":"[OpenAPI] Do not generate imports for local references (#250723)\n\n## Summary\n\nI noticed that when generating schemas from yaml files with local\nreferences, the generator will create import statements for the\nreferenced types.\n\n```yml\nopenapi: 3.0.1\npaths:\n /api/cases:\n post:\n parameters:\n - $ref: '#/components/parameters/kbn_xsrf'\ncomponents:\n parameters:\n kbn_xsrf:\n schema:\n type: string\n```\n\nWill generate:\n\n```typescript\nimport {, #/components/parameters/kbn_xsrf' } (...)\n```\n\nThe fix I am proposing will skip generating import statements for local\nreferences.","sha":"a304458f9ba46cd208f9932e4af139b79560a206","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","Team:Cases","v9.4.0"],"title":"[OpenAPI] Do not generate imports for local references","number":250723,"url":"https://github.com/elastic/kibana/pull/250723","mergeCommit":{"message":"[OpenAPI] Do not generate imports for local references (#250723)\n\n## Summary\n\nI noticed that when generating schemas from yaml files with local\nreferences, the generator will create import statements for the\nreferenced types.\n\n```yml\nopenapi: 3.0.1\npaths:\n /api/cases:\n post:\n parameters:\n - $ref: '#/components/parameters/kbn_xsrf'\ncomponents:\n parameters:\n kbn_xsrf:\n schema:\n type: string\n```\n\nWill generate:\n\n```typescript\nimport {, #/components/parameters/kbn_xsrf' } (...)\n```\n\nThe fix I am proposing will skip generating import statements for local\nreferences.","sha":"a304458f9ba46cd208f9932e4af139b79560a206"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/250723","number":250723,"mergeCommit":{"message":"[OpenAPI] Do not generate imports for local references (#250723)\n\n## Summary\n\nI noticed that when generating schemas from yaml files with local\nreferences, the generator will create import statements for the\nreferenced types.\n\n```yml\nopenapi: 3.0.1\npaths:\n /api/cases:\n post:\n parameters:\n - $ref: '#/components/parameters/kbn_xsrf'\ncomponents:\n parameters:\n kbn_xsrf:\n schema:\n type: string\n```\n\nWill generate:\n\n```typescript\nimport {, #/components/parameters/kbn_xsrf' } (...)\n```\n\nThe fix I am proposing will skip generating import statements for local\nreferences.","sha":"a304458f9ba46cd208f9932e4af139b79560a206"}}]}] BACKPORT--> Co-authored-by: Jan Monschke <jan.monschke@elastic.co> Co-authored-by: christineweng <18648970+christineweng@users.noreply.github.com>
kibanamachine
added a commit
that referenced
this pull request
Jan 30, 2026
#250867) # Backport This will backport the following commits from `main` to `9.1`: - [[OpenAPI] Do not generate imports for local references (#250723)](#250723) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Jan Monschke","email":"jan.monschke@elastic.co"},"sourceCommit":{"committedDate":"2026-01-28T15:14:18Z","message":"[OpenAPI] Do not generate imports for local references (#250723)\n\n## Summary\n\nI noticed that when generating schemas from yaml files with local\nreferences, the generator will create import statements for the\nreferenced types.\n\n```yml\nopenapi: 3.0.1\npaths:\n /api/cases:\n post:\n parameters:\n - $ref: '#/components/parameters/kbn_xsrf'\ncomponents:\n parameters:\n kbn_xsrf:\n schema:\n type: string\n```\n\nWill generate:\n\n```typescript\nimport {, #/components/parameters/kbn_xsrf' } (...)\n```\n\nThe fix I am proposing will skip generating import statements for local\nreferences.","sha":"a304458f9ba46cd208f9932e4af139b79560a206","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","Team:Cases","v9.4.0"],"title":"[OpenAPI] Do not generate imports for local references","number":250723,"url":"https://github.com/elastic/kibana/pull/250723","mergeCommit":{"message":"[OpenAPI] Do not generate imports for local references (#250723)\n\n## Summary\n\nI noticed that when generating schemas from yaml files with local\nreferences, the generator will create import statements for the\nreferenced types.\n\n```yml\nopenapi: 3.0.1\npaths:\n /api/cases:\n post:\n parameters:\n - $ref: '#/components/parameters/kbn_xsrf'\ncomponents:\n parameters:\n kbn_xsrf:\n schema:\n type: string\n```\n\nWill generate:\n\n```typescript\nimport {, #/components/parameters/kbn_xsrf' } (...)\n```\n\nThe fix I am proposing will skip generating import statements for local\nreferences.","sha":"a304458f9ba46cd208f9932e4af139b79560a206"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/250723","number":250723,"mergeCommit":{"message":"[OpenAPI] Do not generate imports for local references (#250723)\n\n## Summary\n\nI noticed that when generating schemas from yaml files with local\nreferences, the generator will create import statements for the\nreferenced types.\n\n```yml\nopenapi: 3.0.1\npaths:\n /api/cases:\n post:\n parameters:\n - $ref: '#/components/parameters/kbn_xsrf'\ncomponents:\n parameters:\n kbn_xsrf:\n schema:\n type: string\n```\n\nWill generate:\n\n```typescript\nimport {, #/components/parameters/kbn_xsrf' } (...)\n```\n\nThe fix I am proposing will skip generating import statements for local\nreferences.","sha":"a304458f9ba46cd208f9932e4af139b79560a206"}}]}] BACKPORT--> Co-authored-by: Jan Monschke <jan.monschke@elastic.co> Co-authored-by: christineweng <18648970+christineweng@users.noreply.github.com>
hannahbrooks
pushed a commit
to hannahbrooks/kibana
that referenced
this pull request
Jan 30, 2026
## Summary
I noticed that when generating schemas from yaml files with local
references, the generator will create import statements for the
referenced types.
```yml
openapi: 3.0.1
paths:
/api/cases:
post:
parameters:
- $ref: '#/components/parameters/kbn_xsrf'
components:
parameters:
kbn_xsrf:
schema:
type: string
```
Will generate:
```typescript
import {, #/components/parameters/kbn_xsrf' } (...)
```
The fix I am proposing will skip generating import statements for local
references.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
I noticed that when generating schemas from yaml files with local references, the generator will create import statements for the referenced types.
Will generate:
The fix I am proposing will skip generating import statements for local references.