apple / swift-openapi-generator

Generate Swift client and server code from an OpenAPI document.
https://swiftpackageindex.com/apple/swift-openapi-generator/documentation
Apache License 2.0
1.21k stars 87 forks source link

Equatable conformance #546

Closed cpd closed 2 months ago

cpd commented 2 months ago

Question

Hi, it's possible to add Equatable conformance to generated models? Adding it post factum prevents automatic synthesis

Extension outside of file declaring struct 'categoryListPayloadPayload' prevents automatic synthesis of '==' for protocol 'Equatable'

czechboy0 commented 2 months ago

Hi @cpd,

all the generated types should already be Equatable (because they're Hashable, which implies Equatable as well). Are you seeing some types not being Equatable?

cpd commented 2 months ago

they're Hashable, which implies Equatable as well

sorry, forgot about that

messed up with typealiases, used typealias that pointed to Void in a Equatable struct 🤦‍♂️

Thank you