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

build: add OpenAPI spec bundling, stop using URL references #3288

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
8 changes: 6 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@
"protos",
"qscc",
"recoverupdateackmessage",
"redoc",
"redocly",
"rogpeppe",
"RUSTC",
"Rwset",
Expand All @@ -163,8 +165,8 @@
"shrn",
"Smonitor",
"socketio",
"Soroban",
"soroban",
"Soroban",
"SPDX",
"Splug",
"Sprintf",
Expand Down Expand Up @@ -193,7 +195,9 @@
"Xdai",
"xeipuuv"
],
"dictionaries": ["typescript,node,npm,go,rust"],
"dictionaries": [
"typescript,node,npm,go,rust"
],
"ignorePaths": [
"**/node_modules/**",
"**/build/**",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
{
"openapi": "3.0.3",
"info": {
"title": "Hyperledger Cactus Example - Carbon Accounting App",
"description": "Demonstrates how a business use case can be satisfied with Cactus when multiple distinct ledgers are involved.",
"version": "v2.0.0-alpha.2",
"license": {
"name": "Apache-2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"components": {
"schemas": {
"AuthzScope": {
"type": "string",
"enum": ["group:admin", "group:user"],
"x-enum-descriptions": [
"Identities with the group:admin scope are administrators of the system.",
"Identities with the group:user scope are end users of the system who only have authorization to perform a limited set of actions."
],
"x-enum-varnames": ["GroupAdmin", "GroupUser"]
},
"AuthzJwtClaim": {
"description": "Stores global constants related to the authorization of the application. Specifically enumerates the claims to validate for as per RFC 7519, section 4.1. See: https://tools.ietf.org/html/rfc7519#section-4.1",
"type": "string",
"enum": ["Hyperledger Labs - Carbon Accounting Tool"],
"x-enum-descriptions": [
"The \"iss\" (issuer) claim identifies the principal that issued the JWT. The processing of this claim is generally application specific. The \"iss\" value is a case-sensitive string containing a StringOrURI value. Use of this claim is OPTIONAL."
],
"x-enum-varnames": ["iss"]
},
"Checkpoint": {
"required": ["fromBlock", "votes"],
"properties": {
"fromBlock": {
"type": "integer",
"format": "uint32",
"nullable": false
},
"votes": {
"type": "string",
"nullable": false,
"format": "uint96"
}
}
},
"EnrollAdminInfo": {
"type": "string",
"enum": [
"Successfully enrolled admin user and imported it into the wallet",
"ORG ADMIN REGISTERED"
],
"x-enum-varnames": [
"SUCCESSFULLY_ENROLLED_ADMIN",
"ORG_ADMIN_REGISTERED"
]
},
"EnrollAdminV1Request": {
"type": "object",
"required": ["orgName"],
"properties": {
"orgName": {
"type": "string",
"minLength": 1,
"maxLength": 1024
}
}
},
"EnrollAdminV1Response": {
"type": "object",
"required": ["info", "orgName", "msp", "caName"],
"properties": {
"info": {
"type": "string",
"minLength": 1,
"maxLength": 2048,
"nullable": false
},
"orgName": {
"type": "string",
"minLength": 1,
"maxLength": 2048,
"nullable": false
},
"msp": {
"type": "string",
"minLength": 1,
"maxLength": 2048,
"nullable": false
},
"caName": {
"type": "string",
"minLength": 1,
"maxLength": 2048,
"nullable": false
},
"identityId": {
"description": "The key under which the identity created will be persisted to the keychain for later retrieval.",
"type": "string",
"minLength": 1,
"maxLength": 2048,
"nullable": false
}
}
},
"DaoTokenGetAllowanceRequest": {
"type": "object",
"required": ["account", "spender"],
"properties": {
"account": {
"description": "The address of the account holding the funds",
"type": "string",
"minLength": 40,
"maxLength": 42
},
"spender": {
"description": "The address of the account spending the funds",
"type": "string",
"minLength": 40,
"maxLength": 42
}
}
},
"DaoTokenGetAllowanceResponse": {
"type": "object",
"required": ["allowance"],
"properties": {
"allowance": {
"type": "integer",
"nullable": false,
"description": "The number of tokens approved"
}
}
},
"DaoTokenGetAllowanceNotFoundResponse": {
"type": "object",
"required": ["accountFound", "spenderFound"],
"properties": {
"accountFound": {
"type": "boolean",
"nullable": false,
"description": "Indicates whether the account was found or not."
},
"spenderFound": {
"type": "boolean",
"nullable": false,
"description": "Indicates whether the spender was found or not."
}
}
}
}
},
"paths": {
"/api/v1/utilityemissionchannel/registerEnroll/admin": {
"post": {
"operationId": "enrollAdminV1",
"summary": "Registers an admin account within the Fabric organization specified.",
"x-hyperledger-cacti": {
"authz": {
"isProtected": true,
"requiredRoles": ["group:admin"]
},
"http": {
"verbLowerCase": "post",
"path": "/api/v1/utilityemissionchannel/registerEnroll/admin"
}
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/EnrollAdminV1Request"
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/EnrollAdminV1Response"
}
}
}
}
}
}
},
"/api/v1/plugins/@hyperledger/cactus-example-carbon-accounting-backend/dao-token/get-allowance": {
"post": {
"operationId": "daoTokenGetAllowanceV1",
"summary": "Get the number of tokens `spender` is approved to spend on behalf of `account`",
"x-hyperledger-cacti": {
"http": {
"verbLowerCase": "post",
"path": "/api/v1/plugins/@hyperledger/cactus-example-carbon-accounting-backend/dao-token/get-allowance"
}
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DaoTokenGetAllowanceRequest"
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DaoTokenGetAllowanceResponse"
}
}
}
},
"404": {
"description": "NOT_FOUND",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DaoTokenGetAllowanceNotFoundResponse"
}
}
}
}
}
}
}
}
}
Loading
Loading