Skip to content

Commit 95f4168

Browse files
committed
docs
1 parent a5fc2ff commit 95f4168

2 files changed

Lines changed: 37 additions & 3 deletions

File tree

docs/generatr/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ has_children: true
88
# The generatr
99

1010
The 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

1313
Let's take a look at a very simple example. The following open api yaml describes a very simple
1414
endpoint. A call to the `/ping` endpoint will simply respond with a plain text string result.

docs/generatr/interfaces.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff 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`.

0 commit comments

Comments
 (0)