Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/java/com/xliic/openapi/bundler/Resolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;

import com.fasterxml.jackson.databind.JsonNode;
Expand All @@ -30,10 +30,10 @@ public static boolean isExternalRef(final JsonNode node) {
}

public static void resolveReference(Parser parser, Reference reference) {
resolveReference(parser, reference, new ArrayList<URI>());
resolveReference(parser, reference, new HashSet<>());
}

public static void resolveReference(Parser parser, Reference reference, ArrayList<URI> visited) {
public static void resolveReference(Parser parser, Reference reference, HashSet<URI> visited) {

URI ref;
try {
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/com/xliic/openapi/bundler/BundlerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,11 @@ void testSwaggerRemapEmpty() throws JsonProcessingException, IOException, URISyn
BundlingException, WorkspaceException {
// make sure that components are mapped to
// nodes under /definitions and /components
// even if the main files dont' have these nodes
// even if the main files don't have these nodes
BundledJsonNode bundled20 = bundle("minimal", "swagger20.yaml");
assertNotNull(bundled20.at("/definitions/FooSchema/type"));
assertEquals("object", bundled20.at("/definitions/definitions.yaml-definitions-FooSchema/type").textValue());

BundledJsonNode bundled30 = bundle("minimal", "openapi30.yaml");
assertNotNull(bundled30.at("/components/schemas/FooSchema/type"));
assertEquals("object", bundled30.at("/components/schemas/schemas.yaml-components-schemas-FooSchema/type").textValue());
}
}