-
-
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.
Merge branch 'main' of https://github.com/BokoEnos/springdoc-openapi …
…into BokoEnos-main
- Loading branch information
Showing
8 changed files
with
235 additions
and
14 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
21 changes: 21 additions & 0 deletions
21
.../springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/Example.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.app173; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
/** | ||
* The Example object | ||
*/ | ||
@Schema | ||
public class Example { | ||
|
||
private String name; | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
...-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/ExampleController.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,38 @@ | ||
package test.org.springdoc.api.app173; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.PatchMapping; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.PutMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.UUID; | ||
|
||
import static org.springframework.http.HttpStatus.OK; | ||
|
||
/** | ||
* The Example Controller | ||
*/ | ||
@RestController | ||
public class ExampleController { | ||
|
||
@PostMapping("/example") | ||
@Operation(summary = "insert example", description = "Allows to insert an example") | ||
public ResponseEntity<UUID> postExample(@io.swagger.v3.oas.annotations.parameters.RequestBody(description = "${example.description}") @RequestBody Example example) { | ||
return new ResponseEntity<>(UUID.randomUUID(), OK); | ||
} | ||
|
||
@PutMapping("/example") | ||
@Operation(summary = "update example", description = "Allows to update an example") | ||
public ResponseEntity<UUID> putExample(@io.swagger.v3.oas.annotations.parameters.RequestBody(description = "${example2.description:Default description for example}") @RequestBody Example example) { | ||
return new ResponseEntity<>(UUID.randomUUID(), OK); | ||
} | ||
|
||
@PatchMapping("/example") | ||
@Operation(summary = "patch example", description = "Allows to patch an example") | ||
public ResponseEntity<UUID> patchExample(@io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Description without the use of variables") @RequestBody Example example) { | ||
return new ResponseEntity<>(UUID.randomUUID(), OK); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...penapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/SpringDocApp173Test.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,20 @@ | ||
package test.org.springdoc.api.app173; | ||
|
||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.test.context.TestPropertySource; | ||
import test.org.springdoc.api.AbstractSpringDocTest; | ||
|
||
/** | ||
* The type Spring doc app 173 test. | ||
*/ | ||
@TestPropertySource(properties = "example.description=The example object") | ||
public class SpringDocApp173Test extends AbstractSpringDocTest { | ||
|
||
/** | ||
* The type Spring doc test app. | ||
*/ | ||
@SpringBootApplication | ||
static class SpringDocTestApp { | ||
} | ||
|
||
} |
132 changes: 132 additions & 0 deletions
132
...gdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app173.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,132 @@ | ||
{ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"title": "OpenAPI definition", | ||
"version": "v0" | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "http://localhost", | ||
"description": "Generated server url" | ||
} | ||
], | ||
"tags": [ | ||
{ | ||
"name": "example-controller", | ||
"description": "The Example Controller" | ||
} | ||
], | ||
"paths": { | ||
"/example": { | ||
"put": { | ||
"tags": [ | ||
"example-controller" | ||
], | ||
"summary": "update example", | ||
"description": "Allows to update an example", | ||
"operationId": "putExample", | ||
"requestBody": { | ||
"description": "Default description for example", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Example" | ||
} | ||
} | ||
}, | ||
"required": true | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"content": { | ||
"*/*": { | ||
"schema": { | ||
"type": "string", | ||
"format": "uuid" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"post": { | ||
"tags": [ | ||
"example-controller" | ||
], | ||
"summary": "insert example", | ||
"description": "Allows to insert an example", | ||
"operationId": "postExample", | ||
"requestBody": { | ||
"description": "The example object", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Example" | ||
} | ||
} | ||
}, | ||
"required": true | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"content": { | ||
"*/*": { | ||
"schema": { | ||
"type": "string", | ||
"format": "uuid" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"patch": { | ||
"tags": [ | ||
"example-controller" | ||
], | ||
"summary": "patch example", | ||
"description": "Allows to patch an example", | ||
"operationId": "patchExample", | ||
"requestBody": { | ||
"description": "Description without the use of variables", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Example" | ||
} | ||
} | ||
}, | ||
"required": true | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"content": { | ||
"*/*": { | ||
"schema": { | ||
"type": "string", | ||
"format": "uuid" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"Example": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
} | ||
}, | ||
"description": "The Example object" | ||
} | ||
} | ||
} | ||
} |