swift-openapi-generator icon indicating copy to clipboard operation
swift-openapi-generator copied to clipboard

Revisit structure at runtime of allOf/oneOf/anyOf

Open czechboy0 opened this issue 2 years ago • 5 comments

Structure at runtime of allOf/oneOf/anyOf - today, we use nesting of structs to represent the nested schemas.

Could be represented as a single flattened struct that conforms to multiple protocols, one for each nested type, or some other way.

Things to keep in mind:

  • lack of nested protocols in Swift
  • cost of using existentials vs concrete types

czechboy0 avatar May 25 '23 10:05 czechboy0

allOf - is like inheritance but with struct it would be like big struct with embed fields from parent struct :)

iDevPro avatar Dec 15 '23 05:12 iDevPro