Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpenAPI document generation #386

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion services/account/apps/api/src/build-openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ process.env.PROVIDER_ACCOUNT_SEED_PHRASE =
'offer debate skin describe light badge fish turtle actual inject struggle border';
process.env.PROVIDER_ID = '0';
process.env.WEBHOOK_BASE_URL = 'http://127.0.0.1';
process.env.CAPACITY_LIMIT = '{"type":"amount","value":0}';
process.env.CAPACITY_LIMIT = '{"type":"amount","value":"1"}';

// eslint-disable-next-line
import { ApiModule } from './api.module';
Expand Down
113 changes: 88 additions & 25 deletions services/account/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
}
}
},
"tags": ["v1/accounts"]
"tags": [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: npm run format will update this file.

"v1/accounts"
]
},
"post": {
"operationId": "AccountsControllerV1_postSignInWithFrequency",
Expand Down Expand Up @@ -46,7 +48,9 @@
}
}
},
"tags": ["v1/accounts"]
"tags": [
"v1/accounts"
]
}
},
"/v1/accounts/{msaId}": {
Expand Down Expand Up @@ -75,7 +79,9 @@
}
}
},
"tags": ["v1/accounts"]
"tags": [
"v1/accounts"
]
}
},
"/v1/accounts/account/{publicKey}": {
Expand Down Expand Up @@ -104,7 +110,9 @@
}
}
},
"tags": ["v1/accounts"]
"tags": [
"v1/accounts"
]
}
},
"/v1/delegation/{msaId}": {
Expand All @@ -126,7 +134,9 @@
"description": "Found delegation information."
}
},
"tags": ["v1/delegation"]
"tags": [
"v1/delegation"
]
}
},
"/v1/handles": {
Expand All @@ -149,7 +159,9 @@
"description": "Handle creation request enqueued"
}
},
"tags": ["v1/handles"]
"tags": [
"v1/handles"
]
}
},
"/v1/handles/change": {
Expand All @@ -172,7 +184,9 @@
"description": "Handle change request enqueued"
}
},
"tags": ["v1/handles"]
"tags": [
"v1/handles"
]
}
},
"/v1/handles/{msaId}": {
Expand All @@ -194,7 +208,9 @@
"description": "Found a handle"
}
},
"tags": ["v1/handles"]
"tags": [
"v1/handles"
]
}
},
"/v1/keys/add": {
Expand All @@ -217,7 +233,9 @@
"description": "Found public keys."
}
},
"tags": ["v1/keys"]
"tags": [
"v1/keys"
]
}
},
"/v1/keys/{msaId}": {
Expand All @@ -239,7 +257,9 @@
"description": "Found public keys."
}
},
"tags": ["v1/keys"]
"tags": [
"v1/keys"
]
}
},
"/healthz": {
Expand All @@ -252,7 +272,9 @@
"description": "Service is healthy"
}
},
"tags": ["health"]
"tags": [
"health"
]
}
},
"/livez": {
Expand All @@ -265,7 +287,9 @@
"description": "Service is live"
}
},
"tags": ["health"]
"tags": [
"health"
]
}
},
"/readyz": {
Expand All @@ -278,7 +302,9 @@
"description": "Service is ready"
}
},
"tags": ["health"]
"tags": [
"health"
]
}
}
},
Expand Down Expand Up @@ -318,7 +344,11 @@
"type": "string"
}
},
"required": ["providerId", "siwfUrl", "frequencyRpcUrl"]
"required": [
"providerId",
"siwfUrl",
"frequencyRpcUrl"
]
},
"HandleResponseDTO": {
"type": "object",
Expand All @@ -333,7 +363,11 @@
"type": "number"
}
},
"required": ["base_handle", "canonical_base", "suffix"]
"required": [
"base_handle",
"canonical_base",
"suffix"
]
},
"AccountResponse": {
"type": "object",
Expand All @@ -345,7 +379,9 @@
"$ref": "#/components/schemas/HandleResponseDTO"
}
},
"required": ["msaId"]
"required": [
"msaId"
]
},
"SiwsPayloadDto": {
"type": "object",
Expand All @@ -357,7 +393,10 @@
"type": "string"
}
},
"required": ["message", "signature"]
"required": [
"message",
"signature"
]
},
"ErrorResponseDto": {
"type": "object",
Expand All @@ -366,7 +405,9 @@
"type": "string"
}
},
"required": ["message"]
"required": [
"message"
]
},
"SignInResponseDto": {
"type": "object",
Expand All @@ -392,7 +433,11 @@
"type": "string"
}
},
"required": ["pallet", "extrinsicName", "encodedExtrinsic"]
"required": [
"pallet",
"extrinsicName",
"encodedExtrinsic"
]
},
"SignUpResponseDto": {
"type": "object",
Expand Down Expand Up @@ -446,7 +491,9 @@
"type": "string"
}
},
"required": ["referenceId"]
"required": [
"referenceId"
]
},
"HandlePayload": {
"type": "object",
Expand All @@ -458,7 +505,10 @@
"type": "number"
}
},
"required": ["baseHandle", "expiration"]
"required": [
"baseHandle",
"expiration"
]
},
"HandleRequest": {
"type": "object",
Expand All @@ -473,7 +523,11 @@
"type": "string"
}
},
"required": ["accountId", "payload", "proof"]
"required": [
"accountId",
"payload",
"proof"
]
},
"KeysRequestPayload": {
"type": "object",
Expand All @@ -488,7 +542,11 @@
"type": "string"
}
},
"required": ["msaId", "expiration", "newPublicKey"]
"required": [
"msaId",
"expiration",
"newPublicKey"
]
},
"KeysRequest": {
"type": "object",
Expand All @@ -506,8 +564,13 @@
"$ref": "#/components/schemas/KeysRequestPayload"
}
},
"required": ["msaOwnerAddress", "msaOwnerSignature", "newKeyOwnerSignature", "payload"]
"required": [
"msaOwnerAddress",
"msaOwnerSignature",
"newKeyOwnerSignature",
"payload"
]
}
}
}
}
}
2 changes: 1 addition & 1 deletion services/content-publishing/apps/api/src/build-openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ process.env.PROVIDER_ACCOUNT_SEED_PHRASE =
'offer debate skin describe light badge fish turtle actual inject struggle border';
process.env.PROVIDER_ID = '0';
process.env.PROVIDER_BASE_URL = 'http://127.0.0.1';
process.env.CAPACITY_LIMIT = '{"type":"amount","value":0}';
process.env.CAPACITY_LIMIT = '{"type":"amount","value":"1"}';

// eslint-disable-next-line
import { ApiModule } from './api.module';
Expand Down
2 changes: 1 addition & 1 deletion services/content-publishing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build": "nest build api && nest build worker",
"build:api": "nest build api",
"build:worker": "nest build worker",
"generate:openapi": "set -a ; . ./env.template ; npx ts-node -r tsconfig-paths/register apps/api/src/build-openapi.ts",
"generate:openapi": "npx ts-node -r tsconfig-paths/register apps/api/src/build-openapi.ts",
"generate:metadata": "set -a ; . ./env.template ; npx ts-node apps/api/src/generate-metadata.ts",
"generate:swagger-": "set -a ; . ./env.template ; npx --yes @redocly/cli build-docs swagger.json --output=./docs/index.html",
"generate:swagger-ui": "npx --yes @redocly/cli build-docs swagger.json --output=./docs/index.html",
Expand Down
Loading
Loading