Skip to content

Commit

Permalink
remove leftover
Browse files Browse the repository at this point in the history
  • Loading branch information
frantuma committed Oct 28, 2024
1 parent 47e9f66 commit bb8e066
Showing 1 changed file with 0 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
import com.github.tomakehurst.wiremock.client.WireMock;
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
import io.swagger.v3.core.util.Json31;
import io.swagger.v3.core.util.Yaml31;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.parser.OpenAPIV3Parser;
import io.swagger.v3.parser.core.models.ParseOptions;
import io.swagger.v3.parser.core.models.SwaggerParseResult;
Expand All @@ -23,7 +20,6 @@
import java.io.IOException;
import java.net.HttpURLConnection;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.Random;

import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
Expand Down Expand Up @@ -220,32 +216,6 @@ public void testAnchorUnresolve() throws Exception {
compare("$anchor-not-found", swaggerParseResult);
}

@Test (enabled = false)
public void testa() throws Exception {
ParseOptions parseOptions = new ParseOptions();
parseOptions.setResolve(true);
//parseOptions.setResolveFully(true);
//
SwaggerParseResult result = new OpenAPIV3Parser().readLocation("http://localhost:8002/api/v31/openapi.json", null, parseOptions);
// SwaggerParseResult result = new OpenAPIV3Parser().readLocation("https://petstore31.swagger.io/api/v31/openapi.json", null, parseOptions);
OpenAPI openAPI = result.getOpenAPI();

if (result.getMessages() != null) {
result.getMessages()
.forEach(System.err::println); // validation errors and warnings
}

if (openAPI != null) {
final Map<String, Schema> schemas = openAPI.getComponents()
.getSchemas();
/* schemas.entrySet()
.stream()
.forEach(this::printSchema);*/
}
Yaml31.prettyPrint(openAPI);
}


public void compare(String dir, SwaggerParseResult result) throws Exception {
ObjectMapper mapper = Json31.mapper().copy();
mapper.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true);
Expand Down

0 comments on commit bb8e066

Please sign in to comment.