File tree Expand file tree Collapse file tree 4 files changed +86
-0
lines changed
spring-boot-modules/spring-boot-springdoc/src/main
java/com/baeldung/swaggeryml Expand file tree Collapse file tree 4 files changed +86
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .baeldung .swaggeryml ;
2+
3+ import org .springframework .boot .autoconfigure .SpringBootApplication ;
4+ import org .springframework .boot .builder .SpringApplicationBuilder ;
5+
6+ @ SpringBootApplication
7+ public class SwaggerYMLApplication {
8+ public static void main (String [] args ) {
9+ new SpringApplicationBuilder (SwaggerYMLApplication .class )
10+ .properties ("spring.config.name=application-yml" )
11+ .run (args );
12+ }
13+ }
Original file line number Diff line number Diff line change 1+ spring.application.name =swaggeryml
2+ springdoc.api-docs.enabled =true
3+ springdoc.api-docs.path =/v3/api-docs
4+ springdoc.api-docs.resolve-schema-properties =false
5+ springdoc.swagger-ui.url =/openapi.yml
6+ springdoc.swagger-ui.path =/swagger-ui.html
Original file line number Diff line number Diff line change 1+ type : object
2+ properties :
3+ id :
4+ type : integer
5+ format : int64
6+ name :
7+ type : string
8+ rollNo :
9+ type : string
Original file line number Diff line number Diff line change 1+ openapi : 3.1.0
2+ info :
3+ title : Student API
4+ description : Following documentation explain the API's supported by the [student server](http://localhost:8080).
5+ version : 1.1.9
6+ servers :
7+ - url : http://localhost:8080/v1
8+ description : Prod server
9+ variables :
10+ region :
11+ default : us-west
12+ enum :
13+ - us-west
14+ - us-east
15+ - url : http://localhost:8080/test
16+ description : Test server
17+ paths :
18+ /students :
19+ get :
20+ tags :
21+ - Students
22+ summary : Returns all the students.
23+ description : Following path gives all the data related to students
24+ responses :
25+ " 200 " :
26+ description : A JSON array of student objects
27+ content :
28+ application/json :
29+ schema :
30+ type : array
31+ items :
32+ $ref : ' ./components/schemas/Student.yml'
33+ /students/{id} :
34+ get :
35+ tags :
36+ - Students
37+ summary : Gets a student by ID.
38+ description : >
39+ Gives the details of specific student based on **ID**
40+ operationId : getStudentById
41+ parameters :
42+ - name : id
43+ in : path
44+ description : Student ID
45+ required : true
46+ schema :
47+ type : integer
48+ format : int64
49+ responses :
50+ " 200 " :
51+ description : Successful operation
52+ content :
53+ application/json :
54+ schema :
55+ $ref : ' ./components/schemas/Student.yml'
56+ externalDocs :
57+ description : Learn more about student operations provided by this API.
58+ url : http://localhost:8080/swagger-ui/index.html
You can’t perform that action at this time.
0 commit comments