-
Notifications
You must be signed in to change notification settings - Fork 146
Description
Motivation
Currently the code generated by swift-openapi-generator uses very generic type names that cannot be customised, e.g. Client
, Operation
, APIProtocol
, and so on. These names aren't particularly descriptive (what kind of client? what kind of operation?) and prevent multiple generated API clients from being used within a project without splitting them into their own modules and using fully qualified type names (e.g. MyAPI.Client
).
Proposed solution
It would be ideal to have some way to customise the names of generated types. I propose adding a set of configuration options to control this, e.g.:
typeNames:
Client: MyServiceClient
Operations: MyServiceOperations
APIProtocol: MyServiceAPIProtocol
Alternatives considered
In most cases, what you really want is some sort of prefix to disambiguate type names, in which case we could simplify the config by simply providing this prefix:
typeNamePrefix: MyService
This may also be preferable as it maps more cleanly to a command line argument, e.g. swift-openapi-generator generate --type-name-prefix MyService
.
Additional information
No response