Skip to content

Instantly share code, notes, and snippets.

@effervescentia
Created April 4, 2023 18:43
Show Gist options
  • Save effervescentia/ddfb5fc750e9f16fbaaa200050f7466b to your computer and use it in GitHub Desktop.
Save effervescentia/ddfb5fc750e9f16fbaaa200050f7466b to your computer and use it in GitHub Desktop.
openapi-generator typescript-fetch ideal configuration
generatorName: typescript-fetch
inputSpec: /code/openapi.json
### global customization ###
# sets the suffix for generated client class names
#
# before: class UserApi
# after: class UserClient
apiNameSuffix: Client
# avoid prefixing all the client methods with the controller name
#
# before: UserClient#userControllerFindByID()
# after: UserClient#findByID()
removeOperationIdPrefix: true
### generator customization ###
additionalProperties:
# use positional parameters based on the controller method
# instead of creating an object with autogenerated names for each parameter
#
# before: patchOneByID({ userID: 1, userControllerRequestBody: { name: 'foo' } })
# after: patchOneByID(1, { name: 'foo' })
useSingleRequestParameter: false
# ensure that the names of generated interfaces do not conflict with each other
#
# before: interface FindOneByID
# after: interface UserControllerFindOneByID
prefixParameterInterfaces: true
# ensure that enum property names are uppercase
#
# before: enum SomeEnum { Property = 'property' }
# after: enum SomeEnum { PROPERTY = 'property' }
enumPropertyNaming: UPPERCASE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment