-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Runtime] Async bodies + swift-http-types adoption #47
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
czechboy0
commented
Sep 6, 2023
czechboy0
commented
Sep 6, 2023
czechboy0
commented
Sep 7, 2023
czechboy0
changed the title
[WIP] Async bodies + swift-http-types adoption
[WIP] [Runtime] Async bodies + swift-http-types adoption
Sep 7, 2023
Co-authored-by: Si Beaumont <[email protected]>
Co-authored-by: Si Beaumont <[email protected]>
Co-authored-by: Si Beaumont <[email protected]>
Co-authored-by: Si Beaumont <[email protected]>
Co-authored-by: Si Beaumont <[email protected]>
Co-authored-by: Si Beaumont <[email protected]>
Co-authored-by: Si Beaumont <[email protected]>
…api-runtime into hd-adopt-http-types
Co-authored-by: Si Beaumont <[email protected]>
Co-authored-by: Si Beaumont <[email protected]>
Co-authored-by: Si Beaumont <[email protected]>
Ok, applied most of your feedback, @simonjbeaumont, and left some questions asking for clarification. |
…ame ServerError.metadata -> ServerError.requestMetadata.
simonjbeaumont
approved these changes
Sep 27, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, @czechboy0! Really nice work. Great attention to detail with docs and tests.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Runtime changes of the approved proposals apple/swift-openapi-generator#255 and apple/swift-openapi-generator#254.
Blockers of merging this
Modifications
Request
,Response
,HeaderField
HTTPTypes
...AsString
and the whole string-based serialization strategy, which was only ever used by bodies, but with streaming, we can't safely stream string chunks, only byte chunks, so we instead provide utils onHTTPBody
to create it from string, and to collect it into a string. This means that the underlying type for thetext/plain
content type is nowHTTPBody
(a sequence of byte chunks) as opposed toString
HTTPTypes
doesn't provide that, thepath
property contains both the path and the query components (insetEscapedQueryItem
)queryParameters
property fromServerRequestMetadata
, as now we parse the full query ourselves, instead of relying on the server transport to do it for usRouterPathComponent
as now we pass the full path string to the server transport in theregister
function, allowing transport with more flexible routers to handle mixed path components, e.g./foo/{bar}.zip
.HTTPBody
, as described by the proposalResult
SOAR-0004 and SOAR-0005 implemented.
Test Plan
Introduced and adjusted tests for all of the above.