Skip to content

[9.3] [OpenAPI] Do not generate imports for local references (#250723)#250869

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

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

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.3:

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)
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Jan 29, 2026

⏳ Build in-progress, with failures

Failed CI Steps

History

cc @janmonschke

@kibanamachine kibanamachine merged commit e61586a into elastic:9.3 Jan 29, 2026
13 checks passed
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