openapi-typescript-codegen icon indicating copy to clipboard operation
openapi-typescript-codegen copied to clipboard

`allOf` ignores schemas which are not specified via ref

Open IrynaMatviichuk opened this issue 3 years ago • 9 comments

If all schemas in allOf are specified via ref, then lib creates correct response types in SDK OpenApi doc:

"allOf": [
    {
        "$ref": "#/components/schemas/Schema1"
    },
    {
        "$ref": "#/components/schemas/Schema2"
    }
]

Response type:

Resource = (Schema1 & Schema2);

In case if a schema is not specified via ref, the lib just ignores it.

"allOf": [
    {
        "properties": {
            ...
        }
    },
    {
        "$ref": "#/components/schemas/Schema2"
    }
]

Response type:

Resource = Schema2;

IrynaMatviichuk avatar Jun 02 '22 10:06 IrynaMatviichuk

Any updates on this?

mp205 avatar Sep 12 '22 16:09 mp205

Also getting bit by this one. I didn't have any problems with another spec that didn't use allOf.

akinnee avatar Sep 23 '22 05:09 akinnee