-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Description
Node Version
22.20.0
NPM/Yarn/PNPM Version
NPM 11.6.2
Strapi Version
5.25/5.26
Operating System
Linux (Other)
Database
PostgreSQL
Javascript or Typescript
Typescript
Reproduction URL
No response
Bug Description
After updating beyond V25 to 26 (Or currently 29), the generated OpenAPI file is missing references, and types (components & schemas).
Reverting back to 25 from 26 (or 29) resolves the issue.
This makes it so that FE client generators are unable to create a proper client.
I was unable to find any changes in release 26 regarding this code, making it slightly confusing.
Diffing the files reveals that in v25, the components are referenced from otherplaces. In v26 they are inline.
Steps to Reproduce
- Generate the spec in v25 and observe that the output is correct
- Bump the version to v26 and observe that the output is broken
"@strapi/plugin-cloud": "5.26.0",
"@strapi/plugin-users-permissions": "5.26.0",
"@strapi/strapi": "5.26.0",
- Revert to v25 and observe it is correct again
"@strapi/plugin-cloud": "5.25.0",
"@strapi/plugin-users-permissions": "5.25.0",
"@strapi/strapi": "5.25.0",
I don't believe there is anything specific to this codebase other than the version responsible for this.
Expected Behavior
A correctly generated file populated with types.
Logs
strapi git:(fix/web-client-generation) ✗ npm run generate-spec
> strapi@0.1.0 generate-spec
> cross-env ENV_PATH=../.env strapi openapi generate --output ../openapi/strapi-spec.json
⚠️ The OpenAPI generation feature is currently experimental.
Its behavior and output might change in future releases without following semver.
Please report any issues you encounter on https://github.com/strapi/strapi/issues/new?template=BUG_REPORT.yml.
Generated an OpenAPI specification for "strapi v0.1.0" at ../openapi/strapi-spec.json in 76msCode Snippets
No response
Media
V26
V25
Additional information
I can provide the generated files if requested, but the project itself is WIP and the files are large.
Because it works when purely changing Strapi versions, i doubt its my code at fault. However i cannot conclude that it is not. Any pointers or help is greatly appreciated.
Running on Fedora 42 with PostgreSQL in Docker.
Confirmation Checklist
- I have checked the existing issues for duplicates.
- I agree to follow this project's Code of Conduct.
EDIT: The types are placed inline, but they are not defined as reusable components. As such, multiple tools will not pick it up and generate client types based on it (afaik), such as Hey API
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status