Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Commit b88ca55

Browse files
committed
tweak README
1 parent 494184b commit b88ca55

File tree

5 files changed

+70
-67
lines changed

5 files changed

+70
-67
lines changed

.gitignore

+4-6
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,11 @@ classes
7676
# Ignore generated JS and .jar
7777
/js/module/webapi-parser.js
7878
/examples/java/libs/*.jar
79-
80-
# Fat jar
81-
./*.jar
79+
webapi-parser-*.jar
8280

8381
# Files generated by examples
84-
generated.raml
85-
generated.json
82+
examples/*/generated.raml
83+
examples/*/generated.json
8684

8785
# Generated docs
88-
docs/
86+
docs/

CONTRIBUTING.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## Contribution Guidelines
2+
3+
### Contributor Agreement
4+
5+
To contribute source code to this repository, please read our [Contributor Agreement](http://www.mulesoft.org/legal/contributor-agreement.html), and then execute it by running [this notebook](https://api-notebook.anypoint.mulesoft.com/notebooks/#380297ed0e474010ff43) and following the instructions.
6+
7+
## Setting-up this project locally
8+
9+
### Requirements
10+
* Scala 2.12.2
11+
* sbt 0.13.15
12+
13+
### Generate artifacts
14+
To generate JavaScript artifact (generated at `./js/module/webapi-parser.js`), run:
15+
```sh
16+
sbt buildJS
17+
```
18+
19+
To generate regular (not "fat") `.jar`, run:
20+
```sh
21+
sbt package
22+
```
23+
24+
To generate a "fat" `.jar` (generated at `./webapi-parser-X.Y.Z.jar`), run:
25+
```sh
26+
sbt assembleFatJar
27+
```
28+
and then you can copy/move that JAR to your `libs` directory and depend on it directly:
29+
30+
```groovy
31+
dependencies {
32+
compile files('libs/webapi-parser-X.Y.Z.jar')
33+
}
34+
```
35+
36+
## Running tests
37+
```sh
38+
sbt test
39+
```

README.md

+22-52
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,38 @@
11
# webapi-parser
2-
API Spec parser based on AMF. Supports OAS 2.0, and RAML 0.8, 1.0.
2+
API Spec parser based on [AMF](https://github.com/aml-org/amf). Currently supports RAML 0.8, 1.0 and OAS 2.0.
33

4-
## API documentation
5-
[JavaScript API](https://raml-org.github.io/webapi-parser/js/modules/_webapi_parser_.html)
4+
This project is a thin wrapper that exposes API Spec-related capabilities from [AMF](https://github.com/aml-org/amf). It is written in Scala and offered in two versions: [JavaScript](#javascript) and [Java](#java).
65

7-
[Java API](https://raml-org.github.io/webapi-parser/java/index.html)
6+
## JavaScript
87

9-
[AMF Model API](https://raml-org.github.io/webapi-parser/js/classes/_amf_client_js_.model.document.baseunit.html)
8+
### Documentation
9+
* [JavaScript API](https://raml-org.github.io/webapi-parser/js/modules/_webapi_parser_.html)
10+
* [AMF Model](https://raml-org.github.io/webapi-parser/js/classes/_amf_client_js_.model.document.baseunit.html)
1011

11-
## Installation
12-
13-
### JS
14-
Install npm package with
12+
### Installation
13+
Install the npm package:
1514

1615
```sh
1716
$ npm install webapi-parser
1817
```
1918

20-
Start using it with
21-
19+
and then require/reference as follows:
2220
```js
2321
const wap = require('webapi-parser').WebApiParser
2422
```
2523

26-
Check [JS examples directory](examples/js/) for more usage examples.
24+
You can check the [JavaScript examples directory](examples/js/) for some usage examples.
25+
26+
## Java
2727

28-
### Java
29-
To use, specify `webapi-parser` dependency.
28+
### Documentation
29+
* [Java API](https://raml-org.github.io/webapi-parser/java/index.html)
30+
* [AMF Model](https://raml-org.github.io/webapi-parser/js/classes/_amf_client_js_.model.document.baseunit.html)
3031

31-
Gradle example:
32+
### Installation
33+
To use, you'll need to specify `webapi-parser` as a dependency and set both MuleSoft and Jitpack repositories.
3234

35+
Gradle:
3336
```groovy
3437
dependencies {
3538
compile 'org.raml:webapi-parser_2.12:x.y.z'
@@ -46,8 +49,7 @@ repositories {
4649
}
4750
```
4851

49-
Maven example:
50-
52+
Maven:
5153
```xml
5254
<dependency>
5355
<groupId>org.raml</groupId>
@@ -67,39 +69,7 @@ Maven example:
6769
</repositories>
6870
```
6971

70-
To use locally built "fat" jar, copy it to your `libs` directory and depend on it like so
71-
72-
```groovy
73-
dependencies {
74-
compile files('libs/webapi-parser-X.Y.Z.jar')
75-
}
76-
```
77-
78-
Check [Java examples directory](examples/java/) for more usage examples.
79-
80-
81-
## Generate artifacts directly from cloned repository
82-
83-
### Requirements
84-
* Scala 2.12.2
85-
* sbt 0.13.15
86-
87-
### Generate JS artifact
88-
To generate JS artifact to `./js/module/webapi-parser.js` run
89-
90-
```sh
91-
sbt buildJS
92-
```
93-
94-
### Generate Java artifact
95-
To generate regular (not "fat") `.jar` run
72+
You can check the [Java examples directory](examples/java/) for some usage examples.
9673

97-
```sh
98-
sbt package
99-
```
100-
101-
To generate "fat" `.jar` to `./webapi-parser-X.Y.Z.jar` run
102-
103-
```sh
104-
sbt assembleFatJar
105-
```
74+
---
75+
If you wish to contribute to this project, see our [Contribution Guidelines](./CONTRIBUTING.md).

examples/java/README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
## About
2-
This code aims to provide some usage examples to learn how to use `webapi-parser` in Java projects.
2+
This code provides some examples of how to use `webapi-parser` in Java projects.
33

44
## Installation
5-
Please follow `webapi-parser` [Java installation instructions](../../README.md#java).
5+
See [Java installation instructions](../../README.md#java).
66

77
Build project and install dependencies:
8-
98
```sh
109
$ ./gradlew build
1110
```

examples/js/README.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
## About
2-
This code aims to provide some usage examples to learn how to use `webapi-parser` in JS projects.
3-
4-
Each file contains example of parsing, generation, validation and/or resolving of different WebApi formats.
2+
This folder provides some examples of how to use `webapi-parser` in JavaScript projects. Those examples showcase: parsing, generation, validation and/or resolving of different WebApi formats.
53

64
## Installation
7-
Please follow `webapi-parser` [JS installation instructions](../../README.md#js).
5+
See [JavaScript installation instructions](../../README.md#javascript).
86

97
## How to run
10-
Run desired script with `node <script_name>.js`. E.g.
11-
8+
Run any script with `node <script_name>.js`. E.g.
129
```sh
1310
$ node raml10-string.js
1411
```

0 commit comments

Comments
 (0)