Skip to content

Bump swagger-api to 2.2.32 and fix tests (wip) #3002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<central-publishing-maven-plugin.version>0.7.0
</central-publishing-maven-plugin.version>
<flatten-maven-plugin.version>1.5.0</flatten-maven-plugin.version>
<swagger-api.version>2.2.30</swagger-api.version>
<swagger-api.version>2.2.32</swagger-api.version>
<swagger-ui.version>5.21.0</swagger-ui.version>
<gmavenplus-plugin.version>1.13.1</gmavenplus-plugin.version>
<jjwt.version>0.9.1</jjwt.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,11 @@ public Class<?> contains() {
return parameterSchema.$dynamicAnchor();
}

@Override
public String $dynamicRef() {
return parameterSchema.$dynamicRef();
}

@Override
public String contentEncoding() {
return parameterSchema.contentEncoding();
Expand Down Expand Up @@ -836,6 +841,11 @@ public Class<?> contains() {
return schema.$dynamicAnchor();
}

@Override
public String $dynamicRef() {
return schema.$dynamicRef();
}

@Override
public String contentEncoding() {
return schema.contentEncoding();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ public class Builder {
*/
private String $dynamicAnchor = "";

/**
* The Dynamic ref
*/
private String $dynamicRef = "";

/**
* The Content encoding.
*/
Expand Down Expand Up @@ -1149,6 +1154,11 @@ public Class<?> contains() {
return $dynamicAnchor;
}

@Override
public String $dynamicRef() {
return $dynamicRef;
}

@Override
public String contentEncoding() {
return contentEncoding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ public class SpringDocApp110Test extends AbstractSpringDocV30Test {
static class SpringDocTestApp {

@Bean
public OpenAPI customOpenAPI(@Value("${application-description}") String appDesciption, @Value("${application-version}") String appVersion) {
public OpenAPI customOpenAPI(@Value("${application-description}") String appDescription, @Value("${application-version}") String appVersion) {

return new OpenAPI()
.info(new Info()
.title("sample application API")
.version(appVersion)
.description(appDesciption)
.description(appDescription)
.termsOfService("http://swagger.io/terms/")
.license(new License().name("Apache 2.0").url("http://springdoc.org")));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@
"type": "string"
},
"email1": {
"type": "string"
"type": "string",
"format": "email"
},
"age": {
"maximum": 30,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
"type": "string"
},
"email1": {
"type": "string"
"type": "string",
"format": "email"
},
"age": {
"maximum": 30,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@
"type": "string"
},
"email1": {
"type": "string"
"type": "string",
"format": "email"
},
"age": {
"maximum": 30,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@
"type": "string"
},
"email1": {
"type": "string"
"type": "string",
"format": "email"
},
"age": {
"maximum": 30,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"in": "query",
"required": true,
"schema": {
"type": "string",
"maxLength": 10,
"minLength": 0,
"type": "string"
"minLength": 0
}
}
],
Expand Down Expand Up @@ -94,9 +94,9 @@
"in": "query",
"required": true,
"schema": {
"type": "string",
"maxLength": 10,
"minLength": 0,
"type": "string"
"minLength": 0
}
}
],
Expand Down Expand Up @@ -151,43 +151,44 @@
"components": {
"schemas": {
"Person": {
"required": [
"lastName"
],
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"firstName": {
"type": "string",
"maxLength": 2147483647,
"minLength": 2,
"type": "string"
"minLength": 2
},
"lastName": {
"type": "string",
"maxLength": 10,
"minLength": 0,
"type": "string"
"minLength": 0
},
"email": {
"pattern": ".+@.+\\..+",
"type": "string"
"type": "string",
"pattern": ".+@.+\\..+"
},
"email1": {
"type": "string"
"type": "string",
"format": "email"
},
"age": {
"maximum": 30,
"minimum": 18,
"type": "integer",
"format": "int32"
"format": "int32",
"maximum": 30,
"minimum": 18
},
"creditCardNumber": {
"type": "string"
}
}
},
"required": [
"lastName"
]
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@
"type": "string"
},
"email1": {
"type": "string"
"type": "string",
"format": "email"
},
"age": {
"maximum": 30,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
"content": {
"*/*": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/Books"
"type": "object",
"properties": {
"test.org.springdoc.api.v31.app193.Knowledge": {
"$ref": "#/components/schemas/Knowledge"
}
]
}
}
}
}
Expand All @@ -51,14 +52,12 @@
"content": {
"*/*": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/Cat"
},
{
"$ref": "#/components/schemas/Dog"
"type": "object",
"properties": {
"Animal": {
"$ref": "#/components/schemas/Animal"
}
]
}
}
}
}
Expand All @@ -69,80 +68,12 @@
},
"components": {
"schemas": {
"Book": {
"type": "object",
"description": "Represents a Book.",
"properties": {
"title": {
"type": "string"
}
}
},
"Books": {
"allOf": [
{
"$ref": "#/components/schemas/Knowledge"
},
{
"type": "object",
"properties": {
"empty": {
"type": "boolean"
},
"first": {
"$ref": "#/components/schemas/Book"
},
"last": {
"$ref": "#/components/schemas/Book"
}
}
}
],
"description": "Represents a list of Books."
},
"Knowledge": {
"description": "Represents the knowledge."
},
"Animal": {
"description": "Represents an Animal class."
},
"Cat": {
"allOf": [
{
"$ref": "#/components/schemas/Animal"
},
{
"type": "object",
"properties": {
"speed": {
"type": "integer",
"format": "int32"
}
}
}
],
"description": "Represents a Cat class."
},
"Dog": {
"allOf": [
{
"$ref": "#/components/schemas/Animal"
},
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"age": {
"type": "integer",
"format": "int32"
}
}
}
],
"description": "Represents a Dog class."
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@
"description": "This API exposes endpoints for testing anything",
"termsOfService": "https://www.test.ca/terms",
"version": "1.0",
"x-amazon-apigateway-integration": {
"x-${api.extensions.name}": {
"passthroughBehavior": "${api.extensions.properties.passthroughBehavior}",
"connectionId": "${api.extensions.properties.connectionId}",
"type": "${api.extensions.properties.type}",
"httpMethod": "GET",
"uri": "${api.extensions.properties.uri}/testcontroller/getTest",
"connectionType": "${api.extensions.properties.connectionType}"
},
"x-x-amazon-apigateway-integration": {
"passthroughBehavior": "when_no_match",
"connectionId": "1rqafw",
"type": "http_proxy",
Expand Down Expand Up @@ -47,7 +55,7 @@
}
}
},
"x-amazon-apigateway-integration": {
"x-x-amazon-apigateway-integration": {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't seem correct, but that's what we get as a response

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bnasslahsen any idea why the response here is like that?

"passthroughBehavior": "when_no_match",
"connectionId": "1rqafw",
"type": "http_proxy",
Expand Down Expand Up @@ -76,4 +84,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ static class SpringDocTestApp {
/**
* Custom open api open api.
*
* @param appDesciption the app desciption
* @param appDescription the app description
* @param appVersion the app version
* @return the open api
*/
@Bean
public OpenAPI customOpenAPI(@Value("${application-description}") String appDesciption, @Value("${application-version}") String appVersion) {
public OpenAPI customOpenAPI(@Value("${application-description}") String appDescription, @Value("${application-version}") String appVersion) {
return new OpenAPI()
.info(new Info()
.title("sample application API")
.version(appVersion)
.description(appDesciption)
.description(appDescription)
.termsOfService("http://swagger.io/terms/")
.license(new License().name("Apache 2.0").url("http://springdoc.org")));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@
},
"email1": {
"type": "string",
"description": "The Email 1."
"description": "The Email 1.",
"format": "email"
},
"age": {
"maximum": 30,
Expand Down
Loading