-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2060 from oasisprotocol/lw/oasisscan-readme
Improve OasisScan's swagger README
- Loading branch information
Showing
2 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Improve OasisScan's swagger README |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,39 @@ | ||
# Oasis Scan | ||
# Typescript bindings for Oasis Scan | ||
|
||
See [../explorer/README.md](../explorer/README.md) | ||
This folder contains generated typescript bindings for OasisScan. | ||
|
||
To update the bindings: | ||
|
||
1. Update swagger.yml based on | ||
- <https://api.oasisscan.com/mainnet/swagger-ui/> | ||
- <https://api.oasisscan.com/mainnet/v2/api-docs> | ||
- <https://github.com/bitcat365/oasisscan-backend> | ||
|
||
2. Generate the bindings: | ||
|
||
```sh | ||
npx @openapitools/openapi-generator-cli generate \ | ||
-i swagger.yml \ | ||
-g typescript-fetch \ | ||
-o . \ | ||
--additional-properties=modelPropertyNaming=original,typescriptThreePlus=true | ||
``` | ||
|
||
or | ||
|
||
```sh | ||
docker run --rm --user "${UID}:${GID}" \ | ||
-v ${PWD}:/local \ | ||
--workdir /local \ | ||
openapitools/openapi-generator-cli:v5.1.0 generate \ | ||
-i swagger.yml \ | ||
-g typescript-fetch \ | ||
-o . \ | ||
--additional-properties=modelPropertyNaming=original,typescriptThreePlus=true | ||
``` | ||
|
||
3. Lint: | ||
|
||
```sh | ||
yarn lint:fix | ||
``` |