();
sec.put(sr.name(), sr.scopes());
@@ -64,7 +64,7 @@ public Operation(io.swagger.oas.annotations.Operation op) {
}
}
- for(io.swagger.oas.annotations.servers.Server s : op.servers()) {
+ for(io.swagger.v3.oas.annotations.servers.Server s : op.servers()) {
getServers().add(new Server(s));
}
}
diff --git a/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/Parameter.java b/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/Parameter.java
index 78d9f11..03865b4 100644
--- a/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/Parameter.java
+++ b/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/Parameter.java
@@ -3,7 +3,7 @@
import java.util.HashMap;
import java.util.Map;
-import io.swagger.oas.annotations.enums.Explode;
+import io.swagger.v3.oas.annotations.enums.Explode;
/**
* @see https://swagger.io/specification/#parameterObject
@@ -27,15 +27,15 @@ public Parameter(String ref) {
super(ref);
}
- public Parameter(io.swagger.oas.annotations.Parameter p) {
+ public Parameter(io.swagger.v3.oas.annotations.Parameter p) {
setName(OpenApi.nullIfEmpty(p.name()));
- setIn(OpenApi.nullIfEmpty(p.in()));
+ setIn(OpenApi.nullIfEmpty(p.in().toString()));
setDescription(OpenApi.nullIfEmpty(p.description()));
setRequired(p.required());
setDeprecated(p.deprecated());
setAllowEmptyValue(p.allowEmptyValue());
- setStyle(OpenApi.nullIfEmpty(p.style()));
+ setStyle(OpenApi.nullIfEmpty(p.style().toString()));
setExplode(p.explode() == Explode.TRUE);
setAllowReserved(p.allowReserved());
setSchema(new Schema(p.schema()));
@@ -43,7 +43,7 @@ public Parameter(io.swagger.oas.annotations.Parameter p) {
setSchema(null);
}
setExample(OpenApi.nullIfEmpty(p.example()));
- for(io.swagger.oas.annotations.media.ExampleObject e : p.examples()) {
+ for(io.swagger.v3.oas.annotations.media.ExampleObject e : p.examples()) {
if(e.name().length() > 0) {
getExamples().put(e.name(), new Example(e));
}
diff --git a/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/RequestBody.java b/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/RequestBody.java
index e072828..1fdabac 100644
--- a/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/RequestBody.java
+++ b/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/RequestBody.java
@@ -15,9 +15,9 @@ public RequestBody(String ref) {
super(ref);
}
- public RequestBody(io.swagger.oas.annotations.parameters.RequestBody rb) {
+ public RequestBody(io.swagger.v3.oas.annotations.parameters.RequestBody rb) {
setDescription(OpenApi.nullIfEmpty(rb.description()));
- for(io.swagger.oas.annotations.media.Content c : rb.content()) {
+ for(io.swagger.v3.oas.annotations.media.Content c : rb.content()) {
if(OpenApi.nullIfEmpty(c.mediaType()) != null) {
getContent().put(c.mediaType(), new MediaType(c));
}
diff --git a/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/Response.java b/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/Response.java
index 7336b13..1b65ff9 100644
--- a/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/Response.java
+++ b/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/Response.java
@@ -3,7 +3,7 @@
import java.util.HashMap;
import java.util.Map;
-import io.swagger.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
/**
* @see https://swagger.io/specification/#responsesObject
@@ -19,21 +19,21 @@ public class Response {
public Response(ApiResponse r) {
setDescription(OpenApi.nullIfEmpty(r.description()));
- for(io.swagger.oas.annotations.headers.Header h : r.headers()) {
+ for(io.swagger.v3.oas.annotations.headers.Header h : r.headers()) {
String name = OpenApi.nullIfEmpty(h.name());
if(name != null) {
getHeaders().put(name, new Header(h));
}
}
- for(io.swagger.oas.annotations.media.Content c : r.content()) {
+ for(io.swagger.v3.oas.annotations.media.Content c : r.content()) {
String name = OpenApi.nullIfEmpty(c.mediaType());
if(name != null) {
getContent().put(c.mediaType(), new MediaType(c));
}
}
- for(io.swagger.oas.annotations.links.Link l : r.links()) {
+ for(io.swagger.v3.oas.annotations.links.Link l : r.links()) {
String name = OpenApi.nullIfEmpty(l.name());
if(name != null) {
getLinks().put(name, new Link(l));
diff --git a/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/Schema.java b/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/Schema.java
index 1fbdb96..f050d39 100644
--- a/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/Schema.java
+++ b/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/Schema.java
@@ -44,7 +44,7 @@ public Schema(String ref) {
super(ref);
}
- public Schema(io.swagger.oas.annotations.media.Schema schema) {
+ public Schema(io.swagger.v3.oas.annotations.media.Schema schema) {
setRef(OpenApi.nullIfEmpty(schema.ref()));
setTitle(OpenApi.nullIfEmpty(schema.title()));
setMultipleOf(schema.multipleOf());
diff --git a/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/Server.java b/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/Server.java
index b9cff66..c330f84 100644
--- a/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/Server.java
+++ b/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/Server.java
@@ -16,11 +16,11 @@ public Server(String url, String description) {
setDescription(description);
}
- public Server(io.swagger.oas.annotations.servers.Server s) {
+ public Server(io.swagger.v3.oas.annotations.servers.Server s) {
setUrl(OpenApi.nullIfEmpty(s.url()));
setDescription(OpenApi.nullIfEmpty(s.description()));
- for(io.swagger.oas.annotations.servers.ServerVariable sv : s.variables()) {
+ for(io.swagger.v3.oas.annotations.servers.ServerVariable sv : s.variables()) {
String name = OpenApi.nullIfEmpty(sv.name());
if(name != null) {
getVariables().put(name, new ServerVariable(sv));
diff --git a/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/ServerVariable.java b/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/ServerVariable.java
index c88ac78..1c4d0cd 100644
--- a/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/ServerVariable.java
+++ b/swagger/src/main/java/com/strategicgains/restexpress/plugin/swagger/wrapper/ServerVariable.java
@@ -20,7 +20,7 @@ public ServerVariable(String defaultValue) {
setDefault(defaultValue);
}
- public ServerVariable(io.swagger.oas.annotations.servers.ServerVariable sv) {
+ public ServerVariable(io.swagger.v3.oas.annotations.servers.ServerVariable sv) {
if(sv.allowableValues() != null && sv.allowableValues().length > 0) {
setEnumVar(Arrays.asList(sv.allowableValues()));
}
diff --git a/swagger/src/main/java/io/swagger/oas/annotations/Hidden.java b/swagger/src/main/java/io/swagger/oas/annotations/Hidden.java
deleted file mode 100644
index f02a0a0..0000000
--- a/swagger/src/main/java/io/swagger/oas/annotations/Hidden.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package io.swagger.oas.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-
-@Target(value={ElementType.METHOD,ElementType.TYPE,ElementType.FIELD})
-@Retention(value=RetentionPolicy.RUNTIME)
-public @interface Hidden {
-
-}
diff --git a/swagger/src/main/java/io/swagger/oas/annotations/Operation.java b/swagger/src/main/java/io/swagger/oas/annotations/Operation.java
deleted file mode 100644
index 6454282..0000000
--- a/swagger/src/main/java/io/swagger/oas/annotations/Operation.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/**
- * Copyright 2017 SmartBear Software
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * https://raw.githubusercontent.com/swagger-api/swagger-core/bugfix/requestBody-Annotation/modules/swagger-annotations/src/main/java/io/swagger/oas/annotations/Operation.java
- */
-
-package io.swagger.oas.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import io.swagger.oas.annotations.extensions.Extension;
-import io.swagger.oas.annotations.parameters.RequestBody;
-import io.swagger.oas.annotations.responses.ApiResponse;
-import io.swagger.oas.annotations.security.SecurityRequirement;
-import io.swagger.oas.annotations.servers.Server;
-
-/**
- * Describes a single API operation on a path.
- **/
-@Target({ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@Inherited
-public @interface Operation {
- /**
- * The HTTP method for this operation.
- * @return the HTTP method of this operation
- **/
- String method() default "";
-
- /**
- * Tags can be used for logical grouping of operations by resources or any other qualifier.
- * @return the list of tags associated with this operation
- **/
- String[] tags() default {};
-
- /**
- * Provides a brief description of this operation. Should be 120 characters or less for proper visibility in Swagger-UI.
- * @return a summary of this operation
- **/
- String summary() default "";
-
- /**
- * A verbose description of the operation.
- * @return a description of this operation
- **/
- String description() default "";
-
- /**
- * Additional external documentation for this operation.
- * @return additional documentation about this operation
- **/
- ExternalDocumentation externalDocs() default @ExternalDocumentation();
-
- /**
- * The operationId is used by third-party tools to uniquely identify this operation.
- * @return the ID of this operation
- **/
- String operationId() default "";
-
- /**
- * An optional array of parameters which will be added to any automatically detected parameters in the method itself.
- * @return the list of parameters for this operation
- **/
- Parameter[] parameters() default {};
-
- /**
- * The request body applicable for this operation.
- * @return the requesty body of this operation
- **/
- RequestBody requestBody() default @RequestBody();
-
- /**
- * A declaration of which security mechanisms can be used for this operation.
- * @return the array of security requirements for this Operation
- */
- SecurityRequirement[] security() default {};
-
- /**
- * The list of possible responses as they are returned from executing this operation.
- * @return the list of responses for this operation
- **/
- ApiResponse[] responses() default {};
-
- /**
- * Allows an operation to be marked as deprecated. Alternatively use the @Deprecated annotation
- * @return whether or not this operation is deprecated
- **/
- boolean deprecated() default false;
-
- /**
- * An alternative server array to service this operation.
- * @return the list of servers hosting this operation
- **/
- Server[] servers() default {};
-
- /**
- * The list of optional extensions
- * @return an optional array of extensions
- */
- Extension[] extensions() default {};
-}
\ No newline at end of file