Skip to content

Commit 6ecf147

Browse files
improved the documentation
1 parent b1a4c1f commit 6ecf147

1 file changed

Lines changed: 50 additions & 5 deletions

File tree

README.md

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
# API Post Processing Maven Plugin
22

3+
The long story short: this module avoids annotation clutter in your code and gives you the ability to process your Open API specification
4+
in your continous build or pipeline before piublishing your Open API specification.
5+
6+
The plugin allows you to include resposes like 301 to allow for future changes to resources and e.g. 202 for
7+
deferred processing and so on.
8+
9+
## Status
10+
311
This plugin is intended to use the [Swagger Core library](https://github.com/swagger-api/swagger-core) to extend
412
OpenAPI specification with request and reponse headers, reponse codes etc. in order for a build pipeline to extend
513
REST services with defaults.
614

715
[![Build status](https://travis-ci.org/openapi-tools/api-pp-maven-plugin.svg?branch=master)](https://travis-ci.org/openapi-tools/api-pp-maven-plugin)
816

17+
Module is ready as an initial version
18+
919

1020
# Where to apply
1121

@@ -15,18 +25,15 @@ Thus this could be used during continous integration or as a step in the contino
1525
which makes it possible for the API to evolve whilst keeping consumers happy. The optimal situation is obtained if the content versioning
1626
paradigm (having support for multiple versions in same endpoint) is used.
1727

18-
# Status
19-
20-
Module is under development..
21-
2228
# Future
23-
The initial version supports a rudimentary standard collection of reponse and request codes and headers.
29+
The initial version supports a rudimentary standard and mininmal collection of reponse and request codes and headers.
2430
The module will be extended with a more fine grained support for individual request headers, response status codes and headers, if this is found useful.
2531

2632
# Usage
2733

2834
To have Swagger generate the OpenAPI specifications as part of the build add in the plugin to the POM.
2935

36+
The standard collection of status codes and headers
3037
```xml
3138
<build>
3239
<plugins>
@@ -142,6 +149,44 @@ The fully populated configuration example giving the _minimal_ post processing c
142149
</build>
143150
```
144151

152+
### Inidividual Codes Configuration - Post Processing
153+
154+
The fully populated configuration example giving the _minimal_ post processing collection of the Open API.
155+
```xml
156+
<build>
157+
<plugins>
158+
...
159+
<plugin>
160+
<groupId>io.openapitools.swagger</groupId>
161+
<artifactId>api-pp-maven-plugin</artifactId>
162+
<configuration>
163+
<packages/>
164+
<codes>
165+
<code>200</code>
166+
<code>201</code>
167+
<code>202</code>
168+
<code>204</code>
169+
<code>301</code>
170+
<code>304</code>
171+
<code>400</code>
172+
<code>415</code>
173+
<code>500</code>
174+
</codes>
175+
<inputDirectory>sample-api</inputDirectory>
176+
<inputFilename>petstore</inputFilename>
177+
<outputDirectory>target/api-codes-min</outputDirectory>
178+
<outputFilename>open-api-specs-codes-min</outputFilename>
179+
<outputFormats>
180+
<outputFormat>JSON</outputFormat>
181+
<outputFormat>YAML</outputFormat>
182+
</outputFormats>
183+
</configuration>
184+
</plugin>
185+
...
186+
</plugins>
187+
</build>
188+
```
189+
145190
## Deploying
146191

147192
The generated post processed OpenAPI specifications may be installed and deployed as Maven artifact.

0 commit comments

Comments
 (0)