You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Generator] Fix nested coding
### Motivation
Fixes#263. Depends on apple/swift-openapi-runtime#50.
### Modifications
This started as a "simple" fix for Date coding, which was broken when nested in oneOf/allOf/anyOf, and resulted in a refactoring of how we generate custom Codable implementations.
I wrote it up in a new article for maintainers, that has all the detail that should explain this PR: https://github.com/apple/swift-openapi-generator/blob/d735ac18354cee03bd3b087e229948593394e9c0/Sources/swift-openapi-generator/Documentation.docc/Development/Generating-custom-Codable-conformance-methods.md
### Result
Now Dates are correctly encoded/decoded even when nested in oneOf/allOf/anyOf.
### Test Plan
Updated reference tests to cover more of these tricky cases (that's why they were added to the file-based reference tests), updated snippet tests as well, and unit tests.
Verified that the motivating use case - the k8s API, now parses responses correctly when Dates are nested in allOf.
Reviewed by: glbrntt
Builds:
✔︎ pull request validation (5.8) - Build finished.
✔︎ pull request validation (5.9) - Build finished.
✔︎ pull request validation (compatibility test) - Build finished.
✔︎ pull request validation (docc test) - Build finished.
✔︎ pull request validation (integration test) - Build finished.
✔︎ pull request validation (nightly) - Build finished.
✔︎ pull request validation (soundness) - Build finished.
#271
0 commit comments