Skip to content

[9.2] [OpenAPI] Do not generate imports for local references (#250723)#250868

Merged
kibanamachine merged 2 commits intoelastic:9.2from
kibanamachine:backport/9.2/pr-250723
Jan 29, 2026
Merged

[9.2] [OpenAPI] Do not generate imports for local references (#250723)#250868
kibanamachine merged 2 commits intoelastic:9.2from
kibanamachine:backport/9.2/pr-250723

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.2:

Questions ?

Please refer to the Backport tool documentation

## 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 kibanamachine added the backport This PR is a backport of another PR label Jan 29, 2026
@kibanamachine kibanamachine enabled auto-merge (squash) January 29, 2026 10:57
@janmonschke
Copy link
Copy Markdown
Contributor

@elasticmachine merge upstream

@kibanamachine kibanamachine merged commit a01243a into elastic:9.2 Jan 29, 2026
13 checks passed
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #90 / Cases - group 1 View case Assignees field logs in with default user and creates case before each removes an assigned user
  • [job] [logs] Jest Tests #17 / useGetCaseUserActionsStats shows a toast error when the API returns an error

Metrics [docs]

✅ unchanged

History

cc @janmonschke

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants