|
8 | 8 | import com.github.tomakehurst.wiremock.client.WireMock; |
9 | 9 | import com.github.tomakehurst.wiremock.core.WireMockConfiguration; |
10 | 10 | import io.swagger.v3.core.util.Json31; |
11 | | -import io.swagger.v3.core.util.Yaml31; |
12 | | -import io.swagger.v3.oas.models.OpenAPI; |
13 | | -import io.swagger.v3.oas.models.media.Schema; |
14 | 11 | import io.swagger.v3.parser.OpenAPIV3Parser; |
15 | 12 | import io.swagger.v3.parser.core.models.ParseOptions; |
16 | 13 | import io.swagger.v3.parser.core.models.SwaggerParseResult; |
|
23 | 20 | import java.io.IOException; |
24 | 21 | import java.net.HttpURLConnection; |
25 | 22 | import java.nio.charset.StandardCharsets; |
26 | | -import java.util.Map; |
27 | 23 | import java.util.Random; |
28 | 24 |
|
29 | 25 | import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; |
@@ -220,32 +216,6 @@ public void testAnchorUnresolve() throws Exception { |
220 | 216 | compare("$anchor-not-found", swaggerParseResult); |
221 | 217 | } |
222 | 218 |
|
223 | | - @Test (enabled = false) |
224 | | - public void testa() throws Exception { |
225 | | - ParseOptions parseOptions = new ParseOptions(); |
226 | | - parseOptions.setResolve(true); |
227 | | - //parseOptions.setResolveFully(true); |
228 | | - // |
229 | | - SwaggerParseResult result = new OpenAPIV3Parser().readLocation("http://localhost:8002/api/v31/openapi.json", null, parseOptions); |
230 | | - // SwaggerParseResult result = new OpenAPIV3Parser().readLocation("https://petstore31.swagger.io/api/v31/openapi.json", null, parseOptions); |
231 | | - OpenAPI openAPI = result.getOpenAPI(); |
232 | | - |
233 | | - if (result.getMessages() != null) { |
234 | | - result.getMessages() |
235 | | - .forEach(System.err::println); // validation errors and warnings |
236 | | - } |
237 | | - |
238 | | - if (openAPI != null) { |
239 | | - final Map<String, Schema> schemas = openAPI.getComponents() |
240 | | - .getSchemas(); |
241 | | -/* schemas.entrySet() |
242 | | - .stream() |
243 | | - .forEach(this::printSchema);*/ |
244 | | - } |
245 | | - Yaml31.prettyPrint(openAPI); |
246 | | - } |
247 | | - |
248 | | - |
249 | 219 | public void compare(String dir, SwaggerParseResult result) throws Exception { |
250 | 220 | ObjectMapper mapper = Json31.mapper().copy(); |
251 | 221 | mapper.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true); |
|
0 commit comments