openapi-typescript-codegen
openapi-typescript-codegen copied to clipboard
Schema object called `default` generates invalid TypeScript raising reserved keyword error
Sample schema which validates:
openapi: 3.0.0
info:
version: 1.0.0
title: Simple API
components:
schemas:
default:
type: object
properties:
name:
type: string
paths:
/artists:
get:
description: Returns a list of artists
responses:
'200':
description: Successfully returned a list of artists
content:
application/json:
schema:
$ref: '#/components/schemas/default'
generates:
export type default = {
name?: string;
};
which fails tsc with:
Identifier expected. 'default' is a reserved word that cannot be used here
Would that be easy to fix? In what file? Thanks!