-
-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support of {*param} path patterns is broken in 1.6.15. Fixes #2188
- Loading branch information
1 parent
3c34e5f
commit c06fcdc
Showing
7 changed files
with
352 additions
and
1 deletion.
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
128 changes: 128 additions & 0 deletions
128
springdoc-openapi-starter-webflux-ui/src/test/resources/results/app70.json
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,128 @@ | ||
{ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"title": "OpenAPI definition", | ||
"version": "v0" | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "", | ||
"description": "Generated server url" | ||
} | ||
], | ||
"paths": { | ||
"/coffees": { | ||
"get": { | ||
"tags": [ | ||
"coffee-service" | ||
], | ||
"operationId": "getAllCoffees", | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"content": { | ||
"*/*": { | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/Coffee" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/coffees/{id}": { | ||
"get": { | ||
"tags": [ | ||
"coffee-service" | ||
], | ||
"operationId": "getCoffeeById", | ||
"parameters": [ | ||
{ | ||
"name": "id", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"content": { | ||
"*/*": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Coffee" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/coffees/{id}/orders": { | ||
"get": { | ||
"tags": [ | ||
"coffee-service" | ||
], | ||
"operationId": "getOrdersForCoffeeById", | ||
"parameters": [ | ||
{ | ||
"name": "id", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"content": { | ||
"*/*": { | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/CoffeeOrder" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"Coffee": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"name": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"CoffeeOrder": { | ||
"type": "object", | ||
"properties": { | ||
"coffeeId": { | ||
"type": "string" | ||
}, | ||
"whenOrdered": { | ||
"type": "string", | ||
"format": "date-time" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
128 changes: 128 additions & 0 deletions
128
springdoc-openapi-starter-webflux-ui/src/test/resources/results/app83.json
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,128 @@ | ||
{ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"title": "OpenAPI definition", | ||
"version": "v0" | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "", | ||
"description": "Generated server url" | ||
} | ||
], | ||
"paths": { | ||
"/coffees": { | ||
"get": { | ||
"tags": [ | ||
"coffee-service" | ||
], | ||
"operationId": "getAllCoffees", | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"content": { | ||
"*/*": { | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/Coffee" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/coffees/{id}": { | ||
"get": { | ||
"tags": [ | ||
"coffee-service" | ||
], | ||
"operationId": "getCoffeeById", | ||
"parameters": [ | ||
{ | ||
"name": "id", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"content": { | ||
"*/*": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Coffee" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/coffees/{id}/orders": { | ||
"get": { | ||
"tags": [ | ||
"coffee-service" | ||
], | ||
"operationId": "getOrdersForCoffeeById", | ||
"parameters": [ | ||
{ | ||
"name": "id", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"content": { | ||
"*/*": { | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/CoffeeOrder" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"Coffee": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"name": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"CoffeeOrder": { | ||
"type": "object", | ||
"properties": { | ||
"coffeeId": { | ||
"type": "string" | ||
}, | ||
"whenOrdered": { | ||
"type": "string", | ||
"format": "date-time" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app205/OrderDemo.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,23 @@ | ||
package test.org.springdoc.api.v30.app205; | ||
|
||
/** | ||
* @author bnasslahsen | ||
*/ | ||
|
||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
|
||
public class OrderDemo { | ||
|
||
@RestController | ||
public static class MyController { | ||
|
||
@GetMapping("/test/{*param}") | ||
public String testingMethod(@PathVariable("param") String param) { | ||
return "foo"; | ||
} | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
...arter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app205/SpringdocApp205Test.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,21 @@ | ||
package test.org.springdoc.api.v30.app205; | ||
|
||
/** | ||
* @author bnasslahsen | ||
*/ | ||
|
||
import test.org.springdoc.api.v30.AbstractSpringDocV30Test; | ||
|
||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.test.context.TestPropertySource; | ||
|
||
/** | ||
* Fix regression in #2031 | ||
*/ | ||
@TestPropertySource(properties = { "springdoc.group-configs[0].group=mygroup", "springdoc.group-configs[0].paths-to-match=/test" }) | ||
public class SpringdocApp205Test extends AbstractSpringDocV30Test { | ||
|
||
@SpringBootApplication | ||
static class SpringDocTestApp {} | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app205.json
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,46 @@ | ||
{ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"title": "OpenAPI definition", | ||
"version": "v0" | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "http://localhost", | ||
"description": "Generated server url" | ||
} | ||
], | ||
"paths": { | ||
"/test/{*param}": { | ||
"get": { | ||
"tags": [ | ||
"my-controller" | ||
], | ||
"operationId": "testingMethod", | ||
"parameters": [ | ||
{ | ||
"name": "param", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"content": { | ||
"*/*": { | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": {} | ||
} |
4 changes: 4 additions & 0 deletions
4
...rc/test/resources/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
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,4 @@ | ||
org.springdoc.webmvc.ui.SwaggerConfig | ||
org.springdoc.core.properties.SwaggerUiConfigProperties | ||
org.springdoc.core.properties.SwaggerUiConfigParameters | ||
org.springdoc.core.properties.SwaggerUiOAuthProperties |