Skip to content

Commit 41f9442

Browse files
authored
Merge pull request #36 from arojunior/readme-update
Readme update
2 parents b99c8b3 + c6616bd commit 41f9442

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![npm version](https://badge.fury.io/js/%40api-platform%2Fapi-doc-parser.svg)](https://badge.fury.io/js/%40api-platform%2Fapi-doc-parser)
55
[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php)
66

7-
`api-doc-parser` is a JavaScript (ES6) library to parse [Hydra](http://hydra-cg.com) API documentations and transform them
7+
`api-doc-parser` is a JavaScript (ES6) library to parse [Hydra](http://hydra-cg.com) or Swagger API documentations and transform them
88
in an intermediate representation. This data structure can then be used for various tasks such as creating smart API clients,
99
scaffolding code or building administration interfaces.
1010

@@ -26,16 +26,24 @@ If you plan to use the library with Node, you also need a polyfill for the `fetc
2626

2727
## Usage
2828

29+
**Hydra**
2930
```javascript
3031
import parseHydraDocumentation from 'api-doc-parser/lib/hydra/parseHydraDocumentation';
3132

3233
parseHydraDocumentation('https://demo.api-platform.com').then(({api}) => console.log(api));
3334
```
3435

35-
## Support for other formats (GraphQL, Swagger/OpenAPI, JSONAPI...)
36+
**Swagger**
37+
```javascript
38+
import parseSwaggerDocumentation from 'api-doc-parser/lib/swagger/parseSwaggerDocumentation';
39+
40+
parseSwaggerDocumentation('https://demo.api-platform.com/docs.json').then(({api}) => console.log(api));
41+
```
42+
43+
## Support for other formats (GraphQL, JSONAPI...)
3644

3745
API Doc Parser is designed to parse any API documentation format and convert it in the same intermediate representation.
38-
For now, only Hydra is supported but if you develop a parser for another format, please [open a Pull Request](https://github.com/dunglas/api-doc-parser/pulls)
46+
For now, only Hydra and Swagger is supported but if you develop a parser for another format, please [open a Pull Request](https://github.com/dunglas/api-doc-parser/pulls)
3947
to include it in the library.
4048

4149
## Run tests

0 commit comments

Comments
 (0)