File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ has_children: true
88# The generatr
99
1010The openapi-generatr-spring is an ** interface only** open api generatr. That means it will only
11- generate a java interfaces for the endpoints. It is the projects task to implement them.
11+ generate java interfaces for the endpoints. It is the projects task to implement them.
1212
1313Let's take a look at a very simple example. The following open api yaml describes a very simple
1414endpoint. A call to the ` /ping ` endpoint will simply respond with a plain text string result.
Original file line number Diff line number Diff line change @@ -7,5 +7,39 @@ nav_order: 5
77
88# Interfaces
99
10- todo
11- {: .label .label-yellow }
10+ The generatr groups endpoints based on their _ first_ tag. Using the ` /ping ` example again its first
11+ (and only) tag is ** ping** :
12+
13+ ``` yaml
14+ openapi : 3.0.2
15+ info :
16+ title : sample api for openapi-generatr-spring
17+ version : 1.0.0
18+
19+ paths :
20+ /ping :
21+ get :
22+ tags :
23+ - ping
24+ summary : returns a single "pong" string.
25+ description : very simple sample endpoint
26+ responses :
27+ ' 200 ' :
28+ description : pong
29+ content :
30+ text/plain :
31+ schema :
32+ type : string
33+ ` ` `
34+
35+ The interface name used for this api will be ` PingApi`. `Ping` because `ping` is the tags name and
36+ ` Api` as a fixed string added to `Ping`.
37+
38+ In case no tags are given, all endpoints will be added to an `Api` interface.
39+
40+ The package name gets created from the configurable `packageName` parameter of the generatr and a
41+ sub package named `api`.
42+
43+ If the `packageName` is configured as `com.github.hauner.openapi` the final package name for the
44+ interface is `com.github.hauner.openapi.api` and the full class & package name is
45+ ` com.github.hauner.openapi.api.PingApi` .
You can’t perform that action at this time.
0 commit comments