You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: openapi/README.md
+70-11Lines changed: 70 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,32 +5,91 @@ The API is implemented in the [`nis`](../nis) module in this repository.
5
5
6
6
## Requirements
7
7
8
-
* Node.js 20 LTS
8
+
* Node.js 20 LTS or higher
9
9
10
-
## Installation (in the monorepo)
10
+
YAML style and syntax for files under `spec/` are checked by the monorepo**Linters** job (`linters/scripts/lint_yaml.sh` -> `yamllint` with `linters/yaml/.yamllint`). Run that from the repository root if you need the same check locally:
11
11
12
-
From the root of the `nem` repository:
12
+
```sh
13
+
./linters/scripts/lint_yaml.sh
14
+
```
15
+
16
+
## Installation
17
+
18
+
1. Clone the monorepo and enter this package.
13
19
14
-
```bash
15
-
cd openapi
20
+
```
21
+
git clone https://github.com/NemProject/nem.git
22
+
cd nem/openapi
23
+
```
24
+
25
+
2. Install dependencies.
26
+
27
+
```
16
28
npm install
17
29
```
18
30
19
31
## Commands
20
32
21
33
### Build
22
34
23
-
Compile the OpenAPI specification.
24
-
The generated output is saved under the `_build` directory.
35
+
Compile the specification. The generated output is saved under the `_build` directory.
25
36
26
-
```bash
37
+
```
27
38
npm run build
28
39
```
29
40
30
41
### Test
31
42
32
-
Check if the specification is valid.
43
+
Checks links in the built specification (`_build/openapi3.yml`).
33
44
34
-
```bash
45
+
```
35
46
npm run test
36
-
```
47
+
```
48
+
49
+
In CI the flow is split into dedicated stages:
50
+
51
+
-`scripts/ci/lint.sh` -> `npm run lint` (OpenAPI lint on `spec/openapi.yml`)
52
+
-`scripts/ci/build.sh` -> `npm run build` (bundle to `_build/openapi3.yml`)
53
+
-`scripts/ci/test.sh` -> `npm run test`
54
+
55
+
### Postman
56
+
57
+
Generate a Postman collection from the built specification.
58
+
59
+
```
60
+
npm run postman
61
+
```
62
+
63
+
### Release (monorepo)
64
+
65
+
Release in monorepo is component-scoped (`openapi/`) and produces versioned OpenAPI + Postman artifacts.
66
+
67
+
1. Bump `version` in `package.json` and update `CHANGELOG.md`.
68
+
2. Run publish script:
69
+
70
+
```
71
+
scripts/ci/publish.sh
72
+
```
73
+
74
+
This prepares:
75
+
76
+
-`_build/openapi3.yml`
77
+
-`_build/openapi3.json`
78
+
-`_build/postman.json`
79
+
-`_build/v<version>/openapi3.yml`
80
+
-`_build/v<version>/openapi3.json`
81
+
-`_build/v<version>/postman.json`
82
+
83
+
Optional: create a GitHub release with assets (requires authenticated `gh` CLI):
0 commit comments