File tree Expand file tree Collapse file tree 5 files changed +111
-0
lines changed
springdoc-openapi-webmvc-core/src/test
java/test/org/springdoc/api/app71 Expand file tree Collapse file tree 5 files changed +111
-0
lines changed Original file line number Diff line number Diff line change
1
+ package test .org .springdoc .api .app71 ;
2
+
3
+ import com .fasterxml .jackson .annotation .JsonProperty ;
4
+ import io .swagger .v3 .oas .annotations .media .Schema ;
5
+
6
+
7
+ @ Schema (name = "Dog" )
8
+ public class Dog {
9
+
10
+ @ JsonProperty ("display_name" )
11
+ @ Schema (
12
+ name = "display_name" ,
13
+ description = "A name given to the Dog" ,
14
+ example = "Fido"
15
+ )
16
+ String displayName ;
17
+
18
+
19
+
20
+ }
Original file line number Diff line number Diff line change
1
+ package test .org .springdoc .api .app71 ;
2
+
3
+ import org .springframework .web .bind .annotation .PostMapping ;
4
+ import org .springframework .web .bind .annotation .RestController ;
5
+
6
+ @ RestController
7
+ public class HelloController {
8
+
9
+ @ PostMapping ("/persons" )
10
+ public String persons (Dog dog ) {
11
+ return null ;
12
+ }
13
+
14
+
15
+ }
Original file line number Diff line number Diff line change
1
+ package test .org .springdoc .api .app71 ;
2
+
3
+ import test .org .springdoc .api .AbstractSpringDocTest ;
4
+
5
+ public class SpringDocApp71Test extends AbstractSpringDocTest {
6
+ }
Original file line number Diff line number Diff line change
1
+ package test .org .springdoc .api .app71 ;
2
+
3
+ import org .springframework .boot .SpringApplication ;
4
+ import org .springframework .boot .autoconfigure .SpringBootApplication ;
5
+
6
+ @ SpringBootApplication
7
+ public class SpringDocTestApp {
8
+
9
+ public static void main (String [] args ) {
10
+ SpringApplication .run (SpringDocTestApp .class , args );
11
+ }
12
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "openapi" : " 3.0.1" ,
3
+ "info" : {
4
+ "title" : " OpenAPI definition" ,
5
+ "version" : " v0"
6
+ },
7
+ "servers" : [
8
+ {
9
+ "url" : " http://localhost" ,
10
+ "description" : " Generated server url"
11
+ }
12
+ ],
13
+ "paths" : {
14
+ "/persons" : {
15
+ "post" : {
16
+ "tags" : [
17
+ " hello-controller"
18
+ ],
19
+ "operationId" : " persons" ,
20
+ "requestBody" : {
21
+ "content" : {
22
+ "application/json" : {
23
+ "schema" : {
24
+ "$ref" : " #/components/schemas/Dog"
25
+ }
26
+ }
27
+ }
28
+ },
29
+ "responses" : {
30
+ "200" : {
31
+ "description" : " default response" ,
32
+ "content" : {
33
+ "*/*" : {
34
+ "schema" : {
35
+ "type" : " string"
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
42
+ }
43
+ },
44
+ "components" : {
45
+ "schemas" : {
46
+ "Dog" : {
47
+ "type" : " object" ,
48
+ "properties" : {
49
+ "display_name" : {
50
+ "type" : " string" ,
51
+ "description" : " A name given to the Dog" ,
52
+ "example" : " Fido"
53
+ }
54
+ }
55
+ }
56
+ }
57
+ }
58
+ }
You can’t perform that action at this time.
0 commit comments