tag:github.com,2008:https://github.com/apple/swift-openapi-runtime/releases Tags from swift-openapi-runtime 2025-04-01T19:15:59Z tag:github.com,2008:Repository/630567214/1.8.2 2025-04-02T06:51:40Z 1.8.2 <p>Add support for Windows (<a class="issue-link js-issue-link" href="https://github.com/apple/swift-openapi-runtime/pull/148">#148</a>)</p> <p>CoreFoundation isn't API on Windows, so compile it out in that case. All <br />tests pass with these changes.</p> <p>Co-authored-by: Honza Dvorsky &lt;honza@apple.com&gt;</p> czechboy0 tag:github.com,2008:Repository/630567214/1.8.1 2025-03-13T09:25:24Z 1.8.1 <p>Only apply standard swift settings on valid targets (<a class="issue-link js-issue-link" href="https://github.com/apple/swift-openapi-runtime/pull/145">#145</a>)</p> <p>Only apply standard swift settings on valid targets. The current check <br />ignores plugins but that is not comprehensive enough.</p> czechboy0 tag:github.com,2008:Repository/630567214/1.8.0 2025-01-13T08:31:02Z 1.8.0 <p>[CI] Enable Linux nightly main on PRs (<a class="issue-link js-issue-link" href="https://github.com/apple/swift-openapi-runtime/pull/137">#137</a>)</p> <p>### Motivation</p> <p>PR CI was missing testing with nighly Linux toolchains from main.</p> <p>### Modifications</p> <p>Enable nightly toolchain CI as well.</p> <p>### Result</p> <p>More test coverage on PRs.</p> <p>### Test Plan</p> <p>See this PR's CI if this works or if we need more changes.</p> czechboy0 tag:github.com,2008:Repository/630567214/1.7.0 2024-11-25T14:55:19Z 1.7.0 <p>Refactor URIDecoder/URIParser to improve handling of the deepObject s…</p> <p>…tyle (<a class="issue-link js-issue-link" href="https://github.com/apple/swift-openapi-runtime/pull/127">#127</a>)</p> <p>### Motivation</p> <p>As part of <a class="issue-link js-issue-link" href="https://github.com/apple/swift-openapi-generator/issues/259">apple/swift-openapi-generator#259</a>, <br />adding deepObject parameter style support, the initial PR wasn't <br />complete.</p> <p>And once we dug more into it, turns out the original implementation of <br />the URIDecoder/URIParser didn't really lend themselves well for handling <br />deepObject, and the recent additions of supporting arrays within <br />dictionaries (<a class="issue-link js-issue-link" href="https://github.com/apple/swift-openapi-runtime/pull/120">#120</a>) <br />further confused the implementation.</p> <p>### Modifications</p> <p>Refactored URIParser/URIDecoder with a clearer understanding of the <br />current requirements. It's now much easier to follow and embraces the <br />fact that each of the 7 variants of URI coding we support (form <br />exploded, form unexploded, simple exploded, simple unexploded, form data <br />exploded, form data unexploded, and now deepObject exploded) are <br />similar, but still different in subtle ways.</p> <p>This new implementation doesn't try as hard to share code between the <br />implementations, so might at first sight appear to duplicate code. The <br />original implementation had many methods with many configuration <br />parameters and utility methods with a high cyclomatic complexity, which <br />made it very hard to reason about. We did away with that.</p> <p>While there, I also made some minor improvements to the serialization <br />path, which allows cleaner round-tripping tests.</p> <p>### Result</p> <p>A more maintainable and more correct URI decoder/parser implementation.</p> <p>### Test Plan</p> <p>Added many more unit tests that test the full matrix of supported styles <br />and inputs.</p> <p>---------</p> <p>Co-authored-by: Si Beaumont &lt;simonjbeaumont@gmail.com&gt;</p> czechboy0 tag:github.com,2008:Repository/630567214/1.6.0 2024-10-31T09:34:43Z 1.6.0 czechboy0 tag:github.com,2008:Repository/630567214/1.5.0 2024-07-30T08:11:04Z 1.5.0 czechboy0 tag:github.com,2008:Repository/630567214/1.4.1 2024-07-22T14:29:38Z 1.4.1 <p>Improved encoding of NSNumber in OpenAPIValueContainer (<a class="issue-link js-issue-link" href="https://github.com/apple/swift-openapi-runtime/pull/110">#110</a>)</p> <p>Improved encoding of NSNumber in OpenAPIValueContainer</p> <p>### Motivation</p> <p>When getting CoreFoundation/Foundation types, especially numbers, they automatically bridge to Swift types like Bool, Int, etc. That casting is pretty flexible, and allows e.g. casting a number into a boolean, which isn't desired when encoding into JSON, as `false` and `0` represent very different values.</p> <p>Previously, we relied on the automatic casting to know how to encode values, however that produced incorrect results in some cases.</p> <p>### Modifications</p> <p>Add explicit handling of CF/NS types and try to encode using that new method before falling back to testing for native Swift types. This ensures that the original intention of the creator of the CF/NS types doesn't get lost in encoding.</p> <p>### Result</p> <p>Correct encoding into JSON of types produced in the CF/NS world, like JSONSerialization.</p> <p>### Test Plan</p> <p>Added unit tests.</p> <p>Reviewed by: simonjbeaumont</p> <p>Builds: <br /> ✔︎ pull request validation (5.10) - Build finished. <br /> ✔︎ pull request validation (5.9) - Build finished. <br /> ✔︎ pull request validation (5.9.0) - Build finished. <br /> ✔︎ pull request validation (api breakage) - Build finished. <br /> ✔︎ pull request validation (docc test) - Build finished. <br /> ✔︎ pull request validation (integration test) - Build finished. <br /> ✔︎ pull request validation (nightly) - Build finished. <br /> ✔︎ pull request validation (soundness) - Build finished. </p> <p><a class="issue-link js-issue-link" href="https://github.com/apple/swift-openapi-runtime/pull/110">#110</a></p> czechboy0 tag:github.com,2008:Repository/630567214/1.4.0 2024-04-16T09:56:01Z 1.4.0 <p>[Runtime] Add support of deepObject style in query params (<a class="issue-link js-issue-link" href="https://github.com/apple/swift-openapi-runtime/pull/100">#100</a>)</p> <p>### Motivation</p> <p>The runtime changes for: <br /><a class="issue-link js-issue-link" href="https://github.com/apple/swift-openapi-generator/issues/259">apple/swift-openapi-generator#259</a></p> <p>### Modifications</p> <p>Added `deepObject` style to serializer &amp; parser in order to support <br />nested keys on query parameters.</p> <p>### Result</p> <p>Support nested keys on query parameters.</p> <p>### Test Plan</p> <p>These are just the runtime changes, tested together with generated <br />changes.</p> <p>---------</p> <p>Co-authored-by: Honza Dvorsky &lt;honza@apple.com&gt;</p> czechboy0 tag:github.com,2008:Repository/630567214/1.3.2 2024-01-18T18:46:37Z 1.3.2 <p>Set content length in request/response bodies (<a class="issue-link js-issue-link" href="https://github.com/apple/swift-openapi-runtime/pull/96">#96</a>)</p> <p>### Motivation</p> <p>A surprising oversight, we were never setting the `content-length` <br />header when sending out a known-length body.</p> <p>Some transports might be already doing this, but this change makes <br />things more consistent.</p> <p>### Modifications</p> <p>Add the `content-length` header when setting a body and we know the <br />length from the `HTTPBody`.</p> <p>### Result</p> <p>More consistent experience.</p> <p>### Test Plan</p> <p>Adapted unit tests.</p> czechboy0 tag:github.com,2008:Repository/630567214/1.3.1 2024-01-18T15:57:19Z 1.3.1 <p>Bug/502 crash thread safety fix (<a class="issue-link js-issue-link" href="https://github.com/apple/swift-openapi-runtime/pull/95">#95</a>)</p> <p>### Motivation</p> <p><span class="issue-keyword tooltipped tooltipped-se">Fixes</span> <a class="issue-link js-issue-link" href="https://github.com/apple/swift-openapi-generator/issues/502">apple/swift-openapi-generator#502</a> <br />- Ensure thread safety of `HTTPBody.collect(upTo)`. <br />- `makeAsyncIterator()`: Instead of crashing, return AsyncSequence which <br />throws `TooManyIterationsError` thereby honoring the contract for <br />`IterationBehavior.single` (HTTPBody, MultipartBody)</p> <p>### Modifications</p> <p>- HTTPBody, MultipartBody: `makeAsyncIterator()`: removed `try!`, catch <br />error and create a sequence which throws the error on iteration. <br />- This removed the need for `try checkIfCanCreateIterator()` in <br />`HTTPBody.collect(upTo)`. <br />**Note**: This creates a small change in behavior: There may be a <br />`TooManyBytesError` thrown before the check for `iterationBehavior`. <br />This approach uses the simplest code, IMO. If we want to keep that <br />`iterationBehavior` is checked first and only after that for the length, <br />then the code needs to be more complex. <br />- Removed `try checkIfCanCreateIterator()` in both classes (only used in <br />`HTTPBody`).</p> <p>### Result</p> <p>- No intentional crash in `makeAsyncIterator()` anymore. <br />- Tests supplied as example in <br /><a class="issue-link js-issue-link" href="https://github.com/apple/swift-openapi-generator/issues/502">apple/swift-openapi-generator#502</a> succeed.</p> <p>### Test Plan</p> <p>- Added check in `Test_Body.testIterationBehavior_single()` to ensure <br />that using `makeAsyncIterator()` directly yields the expected error. <br />- Added tests to check iteration behavior of `MultipartBody`.</p> <p>---------</p> <p>Co-authored-by: Lars Peters &lt;software@lpeters.net&gt;</p> czechboy0