Skip to content

Commit 35fe0c7

Browse files
committed
Update README.md
1 parent e4a9b11 commit 35fe0c7

File tree

1 file changed

+47
-11
lines changed

1 file changed

+47
-11
lines changed

README.md

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,64 @@
11
# OpenAPI-diff
22

3-
Compare two OpenAPI specifications(3.x) and render the difference to html file or markdown file.
3+
Compare two OpenAPI specifications (3.x) and render the difference to HTML plaintext, or Markdown files.
44

55
[![Test](https://github.com/joschi/openapi-diff/workflows/Test/badge.svg)](https://github.com/joschi/openapi-diff/actions?query=branch%3Amaster+workflow%3ATest+)
66

77
# Requirements
8-
`jdk1.8+`
8+
9+
* Java 8
910

1011
# Feature
11-
* Supports OpenAPi spec v3.0.
12-
* Depth comparison of parameters, responses, endpoint, http method(GET,POST,PUT,DELETE...)
12+
13+
* Supports OpenAPI spec v3.0.
14+
* Depth comparison of parameters, responses, endpoint, http method (GET,POST,PUT,DELETE...)
1315
* Supports swagger api Authorization
1416
* Render difference of property with Expression Language
15-
* html & markdown render
17+
* HTML & Markdown render
1618

1719
# Maven
1820

19-
Available on [Maven Central](https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.qdesrame%22%20AND%20a%3A%22openapi-diff%22)
21+
Available on [Maven Central](https://search.maven.org/artifact/com.github.joschi.openapi-diff/core)
2022

2123
```xml
2224
<dependency>
23-
<groupId>com.qdesrame</groupId>
24-
<artifactId>openapi-diff</artifactId>
25-
<version>1.2.0</version>
25+
<groupId>com.github.joschi.openapi-diff</groupId>
26+
<artifactId>core</artifactId>
27+
<version>${openapi-diff-version}</version>
2628
</dependency>
2729
```
2830

2931
# Docker
3032

3133
Available on [Docker Hub](https://hub.docker.com/r/joschi/openapi-diff/) as `joschi/openapi-diff`.
3234

35+
```bash
36+
# docker run joschi/openapi-diff:latest
37+
usage: openapi-diff <old> <new>
38+
--debug Print debugging information
39+
--error Print error information
40+
--fail-on-changed Fail if API changed but is backward
41+
compatible
42+
--fail-on-incompatible Fail only if API changes broke backward
43+
compatibility
44+
-h,--help print this message
45+
--header <property=value> use given header for authorisation
46+
--html <file> export diff as html in given file
47+
--info Print additional information
48+
-l,--log <level> use given level for log (TRACE, DEBUG,
49+
INFO, WARN, ERROR, OFF). Default: ERROR
50+
--markdown <file> export diff as markdown in given file
51+
--off No information printed
52+
--query <property=value> use query param for authorisation
53+
--state Only output diff state: no_changes,
54+
incompatible, compatible
55+
--text <file> export diff as text in given file
56+
--trace be extra verbose
57+
--version print the version information and exit
58+
--warn Print warning information
59+
```
60+
61+
3362
## Build the image
3463
3564
This is only required if you want to try new changes in the Dockerfile of this project.
@@ -54,7 +83,8 @@ docker run -t \
5483
The remote name `joschi/openapi-diff` can be replaced with `local-openapi-diff` or the name you gave to your local image.
5584
5685
# Usage
57-
OpenDiff can read swagger api spec from json file or http.
86+
87+
openapi-diff can read OpenAPI specs from JSON files or HTTP URLs.
5888
5989
## Command Line
6090
@@ -99,6 +129,7 @@ public class Main {
99129
### Render difference
100130
---
101131
#### HTML
132+
102133
```java
103134
String html = new HtmlRender("Changelog",
104135
"http://deepoove.com/swagger-diff/stylesheets/demo.css")
@@ -116,6 +147,7 @@ try {
116147
```
117148
118149
#### Markdown
150+
119151
```java
120152
String render = new MarkdownRender().render(diff);
121153
try {
@@ -130,11 +162,13 @@ try {
130162
```
131163
132164
### Extensions
165+
133166
This project uses Java Service Provider Inteface (SPI) so additional extensions can be added.
134167
135168
To build your own extension, you simply need to create a `src/main/resources/META-INF/services/com.qdesrame.openapi.diff.core.compare.ExtensionDiff` file with the full classname of your implementation. Your class must also implement the `com.qdesrame.openapi.diff.core.compare.ExtensionDiff` interface. Then, including your library with the `openapi-diff` module will cause it to be triggered automatically.
136169
137-
# Example
170+
# Examples
171+
138172
### CLI Output
139173
140174
```text
@@ -233,6 +267,7 @@ To build your own extension, you simply need to create a `src/main/resources/MET
233267
```
234268
235269
### Markdown
270+
236271
```markdown
237272
### What's New
238273
---
@@ -307,6 +342,7 @@ To build your own extension, you simply need to create a `src/main/resources/MET
307342
```
308343
309344
# License
345+
310346
openapi-diff is released under the Apache License 2.0.
311347
312348
# Thanks

0 commit comments

Comments
 (0)