Skip to content

Conversation

@LinusBolls
Copy link

my openapi schema contains the following declaration, this is auto-generated and i don't have control over it:

"ResponseEnvelopeFoo[]": {
    "type": "object",
    "properties": {
        "status": { "type": "string", "enum": ["OK", "ERROR"] },
        "httpCode": { "type": "integer", "format": "int32" },
        "data": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/Foo" }
        },
        "error": { "$ref": "#/components/schemas/ErrorDetails" }
    }
}

this gets parsed as this:

export type ResponseEnvelopeFoo[] = Components.Schemas.ResponseEnvelopeFoo;

which is of course invalid typescript syntax and breaks my build.

this pr fixes this by escaping the names of openapi resources before using them as type names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant