Skip to content

Commit 9b003cc

Browse files
authored
Add an escaped path component test case (#49)
### Motivation While investigating apple/swift-openapi-generator#251 I noticed we don't have a test case for an escaped path component. ### Modifications Added an extra test case. ### Result Unescaping path params has better test coverage. ### Test Plan This whole PR is about improving the tests.
1 parent f0589f6 commit 9b003cc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: Tests/OpenAPIRuntimeTests/Conversion/Test_Converter+Server.swift

+9
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ final class Test_ServerConverterExtensions: Test_Runtime {
125125
"foo": "bar",
126126
"number": "1",
127127
"habitats": "land,air",
128+
"withEscaping": "Hello%20world%21",
128129
]
129130
do {
130131
let value = try converter.getPathParameterAsURI(
@@ -150,6 +151,14 @@ final class Test_ServerConverterExtensions: Test_Runtime {
150151
)
151152
XCTAssertEqual(value, [.land, .air])
152153
}
154+
do {
155+
let value = try converter.getPathParameterAsURI(
156+
in: path,
157+
name: "withEscaping",
158+
as: String.self
159+
)
160+
XCTAssertEqual(value, "Hello world!")
161+
}
153162
}
154163

155164
// | server | get | request query | URI | optional | getOptionalQueryItemAsURI |

0 commit comments

Comments
 (0)