apple / apple/swift-openapi-generator

Revisit structure at runtime of allOf/oneOf/anyOf

Open
#29 5 comments 0 reactions 0 assignees View on GitHub
kind/usability status/needs-design
Dominant language
Swift
Stars
2k
Forks
182
Avg merge
13h 28m
Merged PRs (30d)
5

Description

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

Contributor guide

Open the contributing guide

Research direction

Review the current runtime representation of nested allOf, oneOf, and anyOf schemas. Compare the proposed flattened-struct and nested-struct approaches in light of Swift's lack of nested protocols and the cost of existentials versus concrete types. Done means selecting and documenting a representation with its trade-offs.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, swift
Domain
api, backend-api-design
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.