Commit cb17921
authored
Introduce StringEncoder and StringDecoder types (#44)
Introduce StringEncoder and StringDecoder types
### Motivation
A sibling PR to #41, as part of moving from hand-crafted code that uses `LosslessStringConvertible` conformances on built-in and generated types, we need not just an URI coder, but also a raw string coder.
This will be used for encoding and decoding `text/plain` bodies, where only primitive types can be used, and are encoded as raw strings.
### Modifications
Introduced two types, `StringEncoder` and `StringDecoder`. It's very simple, doesn't support containers, only primitive types.
### Result
Once this lands, it'll allow us to get rid of our ugly marker protocols `_StringConvertible` and `_AutoLosslessStringConvertible` and always go through `Codable`. More on this in subsequent PRs integrating this logic.
### Test Plan
Added a rountrip unit test.
Reviewed by: glbrntt
Builds:
✔︎ pull request validation (5.8) - Build finished.
✔︎ pull request validation (5.9) - Build finished.
✔︎ pull request validation (api breakage) - 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.
#441 parent 24546b1 commit cb17921
File tree
3 files changed
+1026
-0
lines changed- Sources/OpenAPIRuntime/StringCoder
- Tests/OpenAPIRuntimeTests/StringCoder
3 files changed
+1026
-0
lines changed
0 commit comments