feat: automatically generate postman collection from the openapi spec

* feat: add speccy and openapi2postmanv2 as deps

* feat: organize postman folders like our docs

* chore: generate postman on gh-pages action

* chore: change link to download Postman collection from local file
This commit is contained in:
Rafael Cárdenas
2021-09-15 10:01:19 -05:00
committed by GitHub
parent cebeda0e37
commit 5f07d7455f
4 changed files with 1246 additions and 2 deletions

View File

@@ -31,7 +31,7 @@ jobs:
working-directory: docs
- name: Generate and deploy gh-pages
run: npm run generate:types && npm run generate:docs
run: npm run generate:types && npm run generate:docs && npm run generate:postman
working-directory: docs
- name: Publish test coverage report

View File

@@ -16,7 +16,7 @@ info:
It is comprised of two parts; the Stacks Blockchain API and the Stacks Core API.
[![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/614feab5c108d292bffa#?env%5BStacks%20Blockchain%20API%5D=W3sia2V5Ijoic3R4X2FkZHJlc3MiLCJ2YWx1ZSI6IlNUMlRKUkhESE1ZQlE0MTdIRkIwQkRYNDMwVFFBNVBYUlg2NDk1RzFWIiwiZW5hYmxlZCI6dHJ1ZX0seyJrZXkiOiJibG9ja19pZCIsInZhbHVlIjoiMHgiLCJlbmFibGVkIjp0cnVlfSx7ImtleSI6Im9mZnNldCIsInZhbHVlIjoiMCIsImVuYWJsZWQiOnRydWV9LHsia2V5IjoibGltaXRfdHgiLCJ2YWx1ZSI6IjIwMCIsImVuYWJsZWQiOnRydWV9LHsia2V5IjoibGltaXRfYmxvY2siLCJ2YWx1ZSI6IjMwIiwiZW5hYmxlZCI6dHJ1ZX0seyJrZXkiOiJ0eF9pZCIsInZhbHVlIjoiMHg1NDA5MGMxNmE3MDJiNzUzYjQzMTE0ZTg4NGJjMTlhODBhNzk2MzhmZDQ0OWE0MGY4MDY4Y2RmMDAzY2RlNmUwIiwiZW5hYmxlZCI6dHJ1ZX0seyJrZXkiOiJjb250cmFjdF9pZCIsInZhbHVlIjoiU1RKVFhFSlBKUFBWRE5BOUIwNTJOU1JSQkdRQ0ZOS1ZTMTc4VkdIMS5oZWxsb193b3JsZFxuIiwiZW5hYmxlZCI6dHJ1ZX0seyJrZXkiOiJidGNfYWRkcmVzcyIsInZhbHVlIjoiYWJjIiwiZW5hYmxlZCI6dHJ1ZX0seyJrZXkiOiJjb250cmFjdF9hZGRyZXNzIiwidmFsdWUiOiJTVEpUWEVKUEpQUFZETkE5QjA1Mk5TUlJCR1FDRk5LVlMxNzhWR0gxIiwiZW5hYmxlZCI6dHJ1ZX0seyJrZXkiOiJjb250cmFjdF9uYW1lIiwidmFsdWUiOiJoZWxsb193b3JsZCIsImVuYWJsZWQiOnRydWV9LHsia2V5IjoiY29udHJhY3RfbWFwIiwidmFsdWUiOiJzdG9yZSIsImVuYWJsZWQiOnRydWV9LHsia2V5IjoiY29udHJhY3RfbWV0aG9kIiwidmFsdWUiOiJnZXQtdmFsdWUiLCJlbmFibGVkIjp0cnVlfV0=)
<a href="collection.json" download="collection.json">Download Postman collection</a>
paths:
/extended/v1/faucets/stx:

1241
docs/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -14,6 +14,7 @@
"generate:types": "ts-node ./scripts/generate-types.ts",
"generate:schemas": "gulp && npm run generate:types",
"generate:docs": "redoc-cli bundle --output .tmp/index.html ./openapi.yaml",
"generate:postman": "speccy resolve --output .tmp/openapi.resolved.yaml openapi.yaml && openapi2postmanv2 --spec .tmp/openapi.resolved.yaml --output .tmp/collection.json --options folderStrategy=Tags,requestParametersResolution=Example,exampleParametersResolution=Example",
"validate:schemas": "rimraf .tmp && gulp flattenSchemas --silent && ts-node ./scripts/validate-schemas.ts",
"deploy:docs": "npm run generate:types && npm run generate:docs && gulp deployDocs"
},
@@ -47,7 +48,9 @@
"json-schema-merge-allof": "^0.7.0",
"json-schema-to-typescript": "^10.1.4",
"jsonlint-cli": "^1.0.1",
"openapi-to-postmanv2": "^2.10.1",
"redoc-cli": "^0.9.8",
"speccy": "^0.11.0",
"ts-node": "^9.1.1",
"typescript": "^4.2.4",
"yaml-lint": "^1.2.4"