-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix/ensure-valid-classpath-paths
- Loading branch information
Showing
30 changed files
with
316 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "maven" | ||
target-branch: "master" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
allow: | ||
- dependency-name: "io.swagger.core.v3:*" | ||
- dependency-name: "io.swagger:*" | ||
- package-ecosystem: "maven" | ||
target-branch: "v1" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
allow: | ||
- dependency-name: "io.swagger.core.v3:*" | ||
- dependency-name: "io.swagger:*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
.../swagger-parser-v3/src/test/java/io/swagger/v3/parser/test/CustomOpenAPIDereferencer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package io.swagger.v3.parser.test; | ||
|
||
import io.swagger.v3.parser.core.models.AuthorizationValue; | ||
import io.swagger.v3.parser.reference.DereferencerContext; | ||
import io.swagger.v3.parser.reference.OpenAPI31Traverser; | ||
import io.swagger.v3.parser.reference.OpenAPIDereferencer31; | ||
import io.swagger.v3.parser.reference.Reference; | ||
import io.swagger.v3.parser.reference.ReferenceVisitor; | ||
import io.swagger.v3.parser.reference.Traverser; | ||
import io.swagger.v3.parser.reference.Visitor; | ||
|
||
import java.util.HashMap; | ||
import java.util.HashSet; | ||
import java.util.List; | ||
|
||
public class CustomOpenAPIDereferencer extends OpenAPIDereferencer31 { | ||
@Override | ||
public Visitor buildReferenceVisitor(DereferencerContext context, Reference reference, Traverser traverser) { | ||
return new CustomVisitor(reference, (OpenAPI31Traverser)traverser, new HashSet<>(), new HashMap<>()); | ||
} | ||
|
||
static public class CustomVisitor extends ReferenceVisitor { | ||
|
||
public CustomVisitor(Reference reference, OpenAPI31Traverser openAPITraverser, HashSet<Object> visited, | ||
HashMap<Object, Object> visitedMap) { | ||
super(reference, openAPITraverser, visited, visitedMap); | ||
} | ||
|
||
@Override | ||
public String readHttp(String uri, List<AuthorizationValue> auths) throws Exception { | ||
|
||
if (uri.startsWith("http://example.com/custom")) { | ||
return "openapi: 3.1.0\n" + | ||
"info:\n" + | ||
" title: Domain\n" + | ||
" version: '1.0'\n" + | ||
"components:\n" + | ||
" pathItems:\n" + | ||
" ExternalRef:\n" + | ||
" get:\n" + | ||
" description: ExternalRef domain\n" + | ||
" operationId: ExternalRef PathItem\n" + | ||
" responses:\n" + | ||
" '200':\n" + | ||
" description: OK"; | ||
} else { | ||
return super.readHttp(uri, auths); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.