-
Notifications
You must be signed in to change notification settings - Fork 149
Description
Creating input types is quite verbose because they contain multiple nested enums. (e.g. .ok(.init(headers: .init(), body: .json(...)))).
It may be useful to generate static helper functions on the output type so it's possible to write .ok(body: .json(...)) instead, or even .ok(...) directly.
We have to be careful here, though, as it's possible to go very far and generate a ton of conveniences, that end up making the API more difficult to understand. So will require a well thought-out proposal first, describing which high-value conveniences we should generate, and how we evaluate further requests.
We also need to keep in mind that the generator complexity shouldn't be significantly increased with this work, as per https://github.com/apple/swift-openapi-generator/blob/main/Sources/swift-openapi-generator/Documentation.docc/Articles/Project-scope-and-goals.md#principle-reduce-complexity-of-the-generator-implementation