Skip to content

Commit f4e3fe5

Browse files
author
bnasslahsen
committed
update test for #319
1 parent 0a2862c commit f4e3fe5

File tree

5 files changed

+111
-0
lines changed

5 files changed

+111
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package test.org.springdoc.api.app71;
2+
3+
import test.org.springdoc.api.AbstractSpringDocTest;
4+
5+
public class SpringDocApp71Test extends AbstractSpringDocTest {
6+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
}

0 commit comments

Comments
 (0)