-
Notifications
You must be signed in to change notification settings - Fork 50
Update uri decoder for non encoded comma strings #52
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
Update uri decoder for non encoded comma strings #52
Conversation
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!
Sources/OpenAPIRuntime/URICoder/Decoding/URIValueFromNodeDecoder.swift
Outdated
Show resolved
Hide resolved
@swift-server-bot test this please |
@bfrearson Please run |
Hopefully all ready to go now! |
@swift-server-bot add to allowlist |
@bfrearson the soundness check is still failing, can you check the CI output why? |
Looks to be an issue with swift-format:
I've run the suggested command locally and there's no changes though. Will take a close look at it tomorrow |
Might be the version of swift-format? We clone it from main in CI I believe. |
Actually likely the opposite, we clone the 508.0.0 tag, so you might be using a newer one: https://github.com/apple/swift-openapi-generator/blob/main/docker/Dockerfile |
yep that was it! |
Motivation
Makes decoding of non-percent encoded strings containing commas more permissive as per discussion in 278. This is not strictly necessary to adhere to the Openapi spec, but encompasses header values that are not percent encoded.
Modifications
Update the simple unexploded decoder to return a single string of comma separated values.
Result
Simple, unexploded nodes containing commas should be decoded correctly. e.g.
foo, bar
should be a single string, rather than an array.Test Plan
Add tests for non percent encoded comma separated strings and percent encoded strings for additional coverage.