Description
Motivation
We need all of our models generated by swift-openapi-generator
to comply with protocols like Equatable
or Identifiable
to work with our overlaying architecture. Manually extending each generated model to conform to these protocols is insufficient and cumbersome, especially as the number of models increases.
Proposed solution
Add a feature to the swift-openapi-generator
that allows specifying which protocols the generated models should conform to. This could be implemented as a configuration option in the generator, enabling automated protocol conformance during the model generation process.
Alternatives considered
The current workaround is manually extending each generated model, like so:
extension ModelA: Equatable {}
extension ModelB: Equatable {}
extension ModelC: Equatable {}
extension ModelD: Equatable, Identifyable {
var id: Int
//...
}
However, this approach is not scalable and becomes unwieldy as the number of models grows.
Additional information
If there is already an existing feature to achieve this, i apologize for the oversight and kindly request guidance to the relevant documentation. I could not find any reference to such a feature in the current documentation.
References:
Identifiable Documentation
Equatable Documentation
Thank you for considering this request.