restful-react
restful-react copied to clipboard
`schemas.[name].properties` are ignored when `allOf` is present
Describe the bug
properties
are ignored when allOf
and properties
are both present at the same level.
To Reproduce Steps to reproduce the behavior:
- Example schema: https://gist.github.com/wei/af7976a2bbdf4e0c4ed1013559d58578/revisions#diff-bea257c04d5327bd1cb2994a43299a45f926bf90e20e091a5e38d6faae3619dd
Pet: description: A pet. allOf: - $ref: "#/components/schemas/NewPet" properties: id: type: integer format: int64
- We get
export type Pet = NewPet;
Expected behavior
export type Pet = NewPet & {
id: number;
};
Additional context
https://github.com/contiamo/restful-react/blob/7f1f69b358a248a9a55fe58f5717622bc1d304ad/src/scripts/import-open-api.ts#L122-L129
^ As seen here, schemas.[name].properties
are ignored when schemas.[name].allOf
is present.
Indeed, good catch! Thanks for the reporting