Skip to content

Commit e90e33c

Browse files
authored
Merge pull request #2060 from oasisprotocol/lw/oasisscan-readme
Improve OasisScan's swagger README
2 parents 37331e1 + 55c5331 commit e90e33c

2 files changed

Lines changed: 39 additions & 2 deletions

File tree

.changelog/2060.trivial.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve OasisScan's swagger README

src/vendors/oasisscan/README.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1-
# Oasis Scan
1+
# Typescript bindings for Oasis Scan
22

3-
See [../explorer/README.md](../explorer/README.md)
3+
This folder contains generated typescript bindings for OasisScan.
4+
5+
To update the bindings:
6+
7+
1. Update swagger.yml based on
8+
- <https://api.oasisscan.com/mainnet/swagger-ui/>
9+
- <https://api.oasisscan.com/mainnet/v2/api-docs>
10+
- <https://github.com/bitcat365/oasisscan-backend>
11+
12+
2. Generate the bindings:
13+
14+
```sh
15+
npx @openapitools/openapi-generator-cli generate \
16+
-i swagger.yml \
17+
-g typescript-fetch \
18+
-o . \
19+
--additional-properties=modelPropertyNaming=original,typescriptThreePlus=true
20+
```
21+
22+
or
23+
24+
```sh
25+
docker run --rm --user "${UID}:${GID}" \
26+
-v ${PWD}:/local \
27+
--workdir /local \
28+
openapitools/openapi-generator-cli:v5.1.0 generate \
29+
-i swagger.yml \
30+
-g typescript-fetch \
31+
-o . \
32+
--additional-properties=modelPropertyNaming=original,typescriptThreePlus=true
33+
```
34+
35+
3. Lint:
36+
37+
```sh
38+
yarn lint:fix
39+
```

0 commit comments

Comments
 (0)