Skip to content

[8.19] [OpenAPI] Do not generate imports for local references (#250723)#250866

Merged
kibanamachine merged 2 commits into
elastic:8.19from
kibanamachine:backport/8.19/pr-250723
Jan 30, 2026
Merged

[8.19] [OpenAPI] Do not generate imports for local references (#250723)#250866
kibanamachine merged 2 commits into
elastic:8.19from
kibanamachine:backport/8.19/pr-250723

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 8.19:

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:56
@kibanamachine kibanamachine merged commit 0a34bae into elastic:8.19 Jan 30, 2026
13 checks passed
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
kbnUiSharedDeps-srcJs 3.7MB 3.7MB +129.0B

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.

4 participants