-
-
Couldn't load subscription status.
- Fork 591
Closed
Labels
PRs welcomePRs are welcome to solve this issue!PRs are welcome to solve this issue!bugSomething isn't workingSomething isn't workinggood first issueStraightforward problem, solvable for first-time contributors without deep knowledge of the projectStraightforward problem, solvable for first-time contributors without deep knowledge of the projectopenapi-tsRelevant to the openapi-typescript libraryRelevant to the openapi-typescript library
Description
Thanks everyone for the new updates of openapi-typescript! I have found an issue which I believe might be related to the new major version (7).
Description
In version 7.3.0 and OpenAPI version 3.0.3, combining type: object and nullable: true does not produce the expected union type.
Reproduction
Run the CLI with default options on the following schema:
openapi: "3.0.3"
info: { title: "Test", version: "0" }
servers:
- url: "example.com"
components:
schemas:
obj1:
type: object
nullable: true
paths: {}Expected result
schemas: {
obj1: Record<string, never> | null;
};Actual Result
schemas: {
obj1: Record<string, never>;
};Checklist
- My OpenAPI schema passes the Redocly validator (
npx @redocly/cli@latest lint) - I’m willing to open a PR (see CONTRIBUTING.md)
The example given above works fine with type: string and nullable: true. It also works in openapi-typescript version 6.7.6.
Metadata
Metadata
Assignees
Labels
PRs welcomePRs are welcome to solve this issue!PRs are welcome to solve this issue!bugSomething isn't workingSomething isn't workinggood first issueStraightforward problem, solvable for first-time contributors without deep knowledge of the projectStraightforward problem, solvable for first-time contributors without deep knowledge of the projectopenapi-tsRelevant to the openapi-typescript libraryRelevant to the openapi-typescript library
Type
Projects
Status
Done