@@ -28,6 +28,8 @@ final class Test_FilteredDocument: XCTestCase {
2828 - name: t
2929 paths:
3030 /things/a:
31+ parameters:
32+ - $ref: '#/components/parameters/A'
3133 get:
3234 operationId: getA
3335 tags:
@@ -52,6 +54,12 @@ final class Test_FilteredDocument: XCTestCase {
5254 type: string
5355 B:
5456 $ref: '#/components/schemas/A'
57+ parameters:
58+ A:
59+ in: query
60+ schema:
61+ type: string
62+ name: A
5563 responses:
5664 A:
5765 description: success
@@ -75,14 +83,16 @@ final class Test_FilteredDocument: XCTestCase {
7583 filter: DocumentFilter ( tags: [ " t " ] ) ,
7684 hasPaths: [ " /things/a " ] ,
7785 hasOperations: [ " getA " ] ,
78- hasSchemas: [ " A " ]
86+ hasSchemas: [ " A " ] ,
87+ hasParameters: [ " A " ]
7988 )
8089 assert (
8190 filtering: document,
8291 filter: DocumentFilter ( paths: [ " /things/a " ] ) ,
8392 hasPaths: [ " /things/a " ] ,
8493 hasOperations: [ " getA " , " deleteA " ] ,
85- hasSchemas: [ " A " ]
94+ hasSchemas: [ " A " ] ,
95+ hasParameters: [ " A " ]
8696 )
8797 assert (
8898 filtering: document,
@@ -96,7 +106,8 @@ final class Test_FilteredDocument: XCTestCase {
96106 filter: DocumentFilter ( paths: [ " /things/a " , " /things/b " ] ) ,
97107 hasPaths: [ " /things/a " , " /things/b " ] ,
98108 hasOperations: [ " getA " , " deleteA " , " getB " ] ,
99- hasSchemas: [ " A " , " B " ]
109+ hasSchemas: [ " A " , " B " ] ,
110+ hasParameters: [ " A " ]
100111 )
101112 assert (
102113 filtering: document,
@@ -117,21 +128,24 @@ final class Test_FilteredDocument: XCTestCase {
117128 filter: DocumentFilter ( paths: [ " /things/a " ] , schemas: [ " B " ] ) ,
118129 hasPaths: [ " /things/a " ] ,
119130 hasOperations: [ " getA " , " deleteA " ] ,
120- hasSchemas: [ " A " , " B " ]
131+ hasSchemas: [ " A " , " B " ] ,
132+ hasParameters: [ " A " ]
121133 )
122134 assert (
123135 filtering: document,
124136 filter: DocumentFilter ( tags: [ " t " ] , schemas: [ " B " ] ) ,
125137 hasPaths: [ " /things/a " ] ,
126138 hasOperations: [ " getA " ] ,
127- hasSchemas: [ " A " , " B " ]
139+ hasSchemas: [ " A " , " B " ] ,
140+ hasParameters: [ " A " ]
128141 )
129142 assert (
130143 filtering: document,
131144 filter: DocumentFilter ( operations: [ " deleteA " ] ) ,
132145 hasPaths: [ " /things/a " ] ,
133146 hasOperations: [ " deleteA " ] ,
134- hasSchemas: [ ]
147+ hasSchemas: [ ] ,
148+ hasParameters: [ " A " ]
135149 )
136150 }
137151
@@ -141,6 +155,7 @@ final class Test_FilteredDocument: XCTestCase {
141155 hasPaths paths: [ OpenAPI . Path . RawValue ] ,
142156 hasOperations operationIDs: [ String ] ,
143157 hasSchemas schemas: [ String ] ,
158+ hasParameters parameters: [ String ] = [ ] ,
144159 file: StaticString = #filePath,
145160 line: UInt = #line
146161 ) {
@@ -149,11 +164,31 @@ final class Test_FilteredDocument: XCTestCase {
149164 XCTFail ( " Filter threw error: \( error) " , file: file, line: line)
150165 return
151166 }
152- XCTAssertUnsortedEqual ( filteredDocument. paths. keys. map ( \. rawValue) , paths, file: file, line: line)
153- XCTAssertUnsortedEqual ( filteredDocument. allOperationIds, operationIDs, file: file, line: line)
167+ XCTAssertUnsortedEqual (
168+ filteredDocument. paths. keys. map ( \. rawValue) ,
169+ paths,
170+ " Paths don't match " ,
171+ file: file,
172+ line: line
173+ )
174+ XCTAssertUnsortedEqual (
175+ filteredDocument. allOperationIds,
176+ operationIDs,
177+ " Operations don't match " ,
178+ file: file,
179+ line: line
180+ )
154181 XCTAssertUnsortedEqual (
155182 filteredDocument. components. schemas. keys. map ( \. rawValue) ,
156183 schemas,
184+ " Schemas don't match " ,
185+ file: file,
186+ line: line
187+ )
188+ XCTAssertUnsortedEqual (
189+ filteredDocument. components. parameters. keys. map ( \. rawValue) ,
190+ parameters,
191+ " Parameters don't match " ,
157192 file: file,
158193 line: line
159194 )
0 commit comments