forked from apache/shenyu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Improve] [ISSUE apache#5628] Migrate Admin swagger from springfox to…
… springdoc (apache#5630) * [Improve] Migrate Admin swagger from springfox to springdoc * [Fix] try fix ci * [Fix] fix test case * [Fix] fix test case * [Fix] fix test case
- Loading branch information
1 parent
3c326cd
commit 4824cd1
Showing
35 changed files
with
327 additions
and
455 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,165 +32,86 @@ | |
public class SwaggerDocParserTest { | ||
|
||
public static final String DOC_INFO_JSON = "{\n" | ||
+ " \"swagger\":\"2.0\",\n" | ||
+ " \"info\":{\n" | ||
+ " \"description\":\"shenyu-examples-http-swagger2 API\",\n" | ||
+ " \"version\":\"2.3.0\",\n" | ||
+ " \"title\":\"shenyu-examples-http-swagger2 API\",\n" | ||
+ " \"contact\":{\n" | ||
+ " \"name\":\"ShenYu\",\n" | ||
+ " \"url\":\"https://github.com/apache/shenyu\",\n" | ||
+ " \"email\":\"[email protected]\"\n" | ||
+ " }\n" | ||
+ " },\n" | ||
+ " \"host\":\"127.0.0.1:8190\",\n" | ||
+ " \"basePath\":\"/\",\n" | ||
+ " \"tags\":[\n" | ||
+ " {\n" | ||
+ " \"name\":\"Order API\",\n" | ||
+ " \"description\":\"Order Controller\"\n" | ||
+ " },\n" | ||
+ " {\n" | ||
+ " \"name\":\"http-test-controller\",\n" | ||
+ " \"description\":\"Http Test Controller\"\n" | ||
+ " }\n" | ||
+ " ],\n" | ||
+ " \"paths\":{\n" | ||
+ " \"/order/path/{id}/{name}\":{\n" | ||
+ " \"get\":{\n" | ||
+ " \"tags\":[\n" | ||
+ " \"Order API\"\n" | ||
+ " ],\n" | ||
+ " \"summary\":\"getPathVariable\",\n" | ||
+ " \"description\":\"get path variable.\",\n" | ||
+ " \"operationId\":\"getPathVariableUsingGET_1\",\n" | ||
+ " \"produces\":[\n" | ||
+ " \"*/*\"\n" | ||
+ " ],\n" | ||
+ " \"parameters\":[\n" | ||
+ " {\n" | ||
+ " \"name\":\"X-Access-Token\",\n" | ||
+ " \"in\":\"header\",\n" | ||
+ " \"description\":\"user auth\",\n" | ||
+ " \"required\":false,\n" | ||
+ " \"type\":\"string\"\n" | ||
+ " },\n" | ||
+ " {\n" | ||
+ " \"name\":\"id\",\n" | ||
+ " \"in\":\"path\",\n" | ||
+ " \"description\":\"id\",\n" | ||
+ " \"required\":true,\n" | ||
+ " \"type\":\"string\"\n" | ||
+ " },\n" | ||
+ " {\n" | ||
+ " \"name\":\"name\",\n" | ||
+ " \"in\":\"path\",\n" | ||
+ " \"description\":\"name\",\n" | ||
+ " \"required\":true,\n" | ||
+ " \"type\":\"string\"\n" | ||
+ " }\n" | ||
+ " ],\n" | ||
+ " \"responses\":{\n" | ||
+ " \"200\":{\n" | ||
+ " \"description\":\"OK\",\n" | ||
+ " \"schema\":{\n" | ||
+ " \"$ref\":\"#/definitions/OrderDTO\"\n" | ||
+ " }\n" | ||
+ " },\n" | ||
+ " \"deprecated\":false\n" | ||
+ " }\n" | ||
+ " }\n" | ||
+ " },\n" | ||
+ " \"/test/payment\":{\n" | ||
+ " \"post\":{\n" | ||
+ " \"tags\":[\n" | ||
+ " \"http-test-controller\"\n" | ||
+ " ],\n" | ||
+ " \"summary\":\"payment\",\n" | ||
+ " \"description\":\"The user pays the order.\",\n" | ||
+ " \"operationId\":\"postUsingPOST\",\n" | ||
+ " \"consumes\":[\n" | ||
+ " \"application/json\"\n" | ||
+ " ],\n" | ||
+ " \"produces\":[\n" | ||
+ " \"*/*\"\n" | ||
+ " ],\n" | ||
+ " \"parameters\":[\n" | ||
+ " {\n" | ||
+ " \"name\":\"X-Access-Token\",\n" | ||
+ " \"in\":\"header\",\n" | ||
+ " \"description\":\"user auth\",\n" | ||
+ " \"required\":false,\n" | ||
+ " \"type\":\"string\"\n" | ||
+ " },\n" | ||
+ " {\n" | ||
+ " \"in\":\"body\",\n" | ||
+ " \"name\":\"userDTO\",\n" | ||
+ " \"description\":\"userDTO\",\n" | ||
+ " \"required\":true,\n" | ||
+ " \"schema\":{\n" | ||
+ " \"$ref\":\"#/definitions/UserDTO\"\n" | ||
+ " }\n" | ||
+ " }\n" | ||
+ " ],\n" | ||
+ " \"responses\":{\n" | ||
+ " \"200\":{\n" | ||
+ " \"description\":\"OK\",\n" | ||
+ " \"schema\":{\n" | ||
+ " \"$ref\":\"#/definitions/UserDTO\"\n" | ||
+ " }\n" | ||
+ " }\n" | ||
+ " },\n" | ||
+ " \"deprecated\":false\n" | ||
+ " }\n" | ||
+ " }\n" | ||
+ " },\n" | ||
+ " \"definitions\":{\n" | ||
+ " \"Mono«string»\":{\n" | ||
+ " \"type\":\"object\",\n" | ||
+ " \"title\":\"Mono«string»\"\n" | ||
+ " },\n" | ||
+ " \"OrderDTO\":{\n" | ||
+ " \"type\":\"object\",\n" | ||
+ " \"required\":[\n" | ||
+ " \"id\",\n" | ||
+ " \"name\"\n" | ||
+ " ],\n" | ||
+ " \"properties\":{\n" | ||
+ " \"id\":{\n" | ||
+ " \"type\":\"string\",\n" | ||
+ " \"example\":100000,\n" | ||
+ " \"description\":\"id\"\n" | ||
+ " },\n" | ||
+ " \"name\":{\n" | ||
+ " \"type\":\"string\",\n" | ||
+ " \"example\":\"jack\",\n" | ||
+ " \"description\":\"name\"\n" | ||
+ " }\n" | ||
+ " },\n" | ||
+ " \"title\":\"OrderDTO\"\n" | ||
+ " },\n" | ||
+ " \"UserDTO\":{\n" | ||
+ " \"type\":\"object\",\n" | ||
+ " \"required\":[\n" | ||
+ " \"userId\"\n" | ||
+ " ],\n" | ||
+ " \"properties\":{\n" | ||
+ " \"userId\":{\n" | ||
+ " \"type\":\"string\",\n" | ||
+ " \"example\":100000,\n" | ||
+ " \"description\":\"user id\"\n" | ||
+ " },\n" | ||
+ " \"userName\":{\n" | ||
+ " \"type\":\"string\",\n" | ||
+ " \"example\":\"shenyu\",\n" | ||
+ " \"description\":\"user name\"\n" | ||
+ " }\n" | ||
+ " },\n" | ||
+ " \"title\":\"UserDTO\"\n" | ||
+ " }\n" | ||
+ " }\n" | ||
+ "}"; | ||
+ " \"openapi\": \"3.0.1\",\n" | ||
+ " \"info\": {\n" | ||
+ " \"title\": \"shenyu-examples-http-swagger3 API\",\n" | ||
+ " \"description\": \"shenyu-examples-http-swagger3 API\",\n" | ||
+ " \"version\": \"3.0.1\",\n" | ||
+ " \"contact\": {\n" | ||
+ " \"name\": \"ShenYu\",\n" | ||
+ " \"url\": \"https://github.com/apache/shenyu\",\n" | ||
+ " \"email\": \"[email protected]\"\n" | ||
+ " }\n" | ||
+ " },\n" | ||
+ " \"servers\": [\n" | ||
+ " {\n" | ||
+ " \"url\": \"http://127.0.0.1:8190\",\n" | ||
+ " \"description\": \"Local server\"\n" | ||
+ " }\n" | ||
+ " ],\n" | ||
+ " \"tags\": [\n" | ||
+ " {\n" | ||
+ " \"name\": \"Order API\",\n" | ||
+ " \"description\": \"Order Controller\"\n" | ||
+ " }\n" | ||
+ " ],\n" | ||
+ " \"paths\": {\n" | ||
+ " \"/order/path/{id}/{name}\": {\n" | ||
+ " \"get\": {\n" | ||
+ " \"tags\": [\"Order API\"],\n" | ||
+ " \"summary\": \"Get path variable\",\n" | ||
+ " \"parameters\": [\n" | ||
+ " {\n" | ||
+ " \"name\": \"id\",\n" | ||
+ " \"in\": \"path\",\n" | ||
+ " \"required\": true,\n" | ||
+ " \"schema\": {\n" | ||
+ " \"type\": \"string\"\n" | ||
+ " }\n" | ||
+ " },\n" | ||
+ " {\n" | ||
+ " \"name\": \"name\",\n" | ||
+ " \"in\": \"path\",\n" | ||
+ " \"required\": true,\n" | ||
+ " \"schema\": {\n" | ||
+ " \"type\": \"string\"\n" | ||
+ " }\n" | ||
+ " }\n" | ||
+ " ],\n" | ||
+ " \"responses\": {\n" | ||
+ " \"200\": {\n" | ||
+ " \"description\": \"Successful response\",\n" | ||
+ " \"content\": {\n" | ||
+ " \"application/json\": {\n" | ||
+ " \"schema\": {\n" | ||
+ " \"$ref\": \"#/components/schemas/OrderDTO\"\n" | ||
+ " }\n" | ||
+ " }\n" | ||
+ " }\n" | ||
+ " }\n" | ||
+ " }\n" | ||
+ " }\n" | ||
+ " }\n" | ||
+ " },\n" | ||
+ " \"components\": {\n" | ||
+ " \"schemas\": {\n" | ||
+ " \"OrderDTO\": {\n" | ||
+ " \"type\": \"object\",\n" | ||
+ " \"required\": [\"id\", \"name\"],\n" | ||
+ " \"properties\": {\n" | ||
+ " \"id\": {\n" | ||
+ " \"type\": \"string\",\n" | ||
+ " \"example\": \"100000\"\n" | ||
+ " },\n" | ||
+ " \"name\": {\n" | ||
+ " \"type\": \"string\",\n" | ||
+ " \"example\": \"jack\"\n" | ||
+ " }\n" | ||
+ " }\n" | ||
+ " }\n" | ||
+ " }\n" | ||
+ " }\n" | ||
+ "}\n"; | ||
|
||
@InjectMocks | ||
private SwaggerDocParser swaggerDocParser; | ||
|
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
Oops, something went wrong.