Usage of `allOf` generates an incomplete type
See original GitHub issueWhat are the steps to reproduce this issue?
- Clone your repo
yarn install
andyarn build
on the rootcd samples/basic/ && yarn install
and modify thepetstore.yaml
- Generate the model using
yarn example
What happens?
The generated models look like this:
petBase.ts
/*
* Generated by orval v5.5.3 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
*/
export interface PetBase {
id: number;
name: string;
tag?: string;
}
pet.ts
/*
* Generated by orval v5.5.3 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
*/
import type { PetBase } from './petBase';
export type Pet = PetBase;
What were you expecting to happen?
I would expect Pet
to contain all fields of PetBase
and the new color
property like this:
pet.ts
/*
* Generated by orval v5.5.3 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
*/
import type { PetBase } from './petBase';
export interface Pet extends PetBase {
color: string;
}
// OR
export type Pet = PetBase & { color: string; };
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
[BUG] No more inheritance for components generated by ...
Hi all, I've filed #14172 to allow using $ref as parent in allOf with a new option called "openapi-normalizer". Please give it a...
Read more >invalid use of incomplete type - c++ - Stack Overflow
The reason is that when instantiating a class template, all its declarations (not the definitions) of its member functions are instantiated ...
Read more >4 Managing Oracle Objects
EXECUTE on an object type enables you to use the type to: Define a table. · UNDER enables you to create a subtype/subview...
Read more >Using Incomplete (Forward) Declarations
An incomplete declaration is the keyword class or struct followed by the name of a class or structure type. It tells the.
Read more >Class template - cppreference.com
a non-empty comma-separated list of the template parameters, each of which is either a non-type parameter, a type parameter, a template ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @anymaniax, ok I understood my mistake, it was a syntax issue. I should specify it like:
TBH, I would like to migrate from
openapi generator
. In openapi, the generation was working even with the wrong syntax:I’ll fix my specs, thank you 😉
Closing this issue since it’s normally fixed. Don’t hesitate if you have any problem