github.com/s7techlab/cckit@v0.10.5/examples/token/service/config/config.swagger.json (about)

     1  {
     2    "swagger": "2.0",
     3    "info": {
     4      "title": "token/service/config/config.proto",
     5      "version": "version not set"
     6    },
     7    "consumes": [
     8      "application/json"
     9    ],
    10    "produces": [
    11      "application/json"
    12    ],
    13    "paths": {
    14      "/token/config": {
    15        "get": {
    16          "operationId": "ConfigService_GetConfig",
    17          "responses": {
    18            "200": {
    19              "description": "A successful response.",
    20              "schema": {
    21                "$ref": "#/definitions/balanceConfig"
    22              }
    23            },
    24            "default": {
    25              "description": "An unexpected error response.",
    26              "schema": {
    27                "$ref": "#/definitions/runtimeError"
    28              }
    29            }
    30          },
    31          "tags": [
    32            "ConfigService"
    33          ]
    34        },
    35        "put": {
    36          "operationId": "ConfigService_SetConfig",
    37          "responses": {
    38            "200": {
    39              "description": "A successful response.",
    40              "schema": {
    41                "$ref": "#/definitions/balanceConfig"
    42              }
    43            },
    44            "default": {
    45              "description": "An unexpected error response.",
    46              "schema": {
    47                "$ref": "#/definitions/runtimeError"
    48              }
    49            }
    50          },
    51          "parameters": [
    52            {
    53              "name": "body",
    54              "in": "body",
    55              "required": true,
    56              "schema": {
    57                "$ref": "#/definitions/balanceConfig"
    58              }
    59            }
    60          ],
    61          "tags": [
    62            "ConfigService"
    63          ]
    64        }
    65      },
    66      "/token/default": {
    67        "get": {
    68          "operationId": "ConfigService_GetDefaultToken",
    69          "responses": {
    70            "200": {
    71              "description": "A successful response.",
    72              "schema": {
    73                "$ref": "#/definitions/balanceToken"
    74              }
    75            },
    76            "default": {
    77              "description": "An unexpected error response.",
    78              "schema": {
    79                "$ref": "#/definitions/runtimeError"
    80              }
    81            }
    82          },
    83          "tags": [
    84            "ConfigService"
    85          ]
    86        }
    87      },
    88      "/token/tokens/{token_name}/groups/{name}": {
    89        "get": {
    90          "operationId": "ConfigService_GetTokenGroup",
    91          "responses": {
    92            "200": {
    93              "description": "A successful response.",
    94              "schema": {
    95                "$ref": "#/definitions/balanceTokenGroup"
    96              }
    97            },
    98            "default": {
    99              "description": "An unexpected error response.",
   100              "schema": {
   101                "$ref": "#/definitions/runtimeError"
   102              }
   103            }
   104          },
   105          "parameters": [
   106            {
   107              "name": "token_name",
   108              "in": "path",
   109              "required": true,
   110              "type": "string"
   111            },
   112            {
   113              "name": "name",
   114              "in": "path",
   115              "required": true,
   116              "type": "array",
   117              "items": {
   118                "type": "string"
   119              },
   120              "collectionFormat": "csv",
   121              "minItems": 1
   122            }
   123          ],
   124          "tags": [
   125            "ConfigService"
   126          ]
   127        },
   128        "delete": {
   129          "operationId": "ConfigService_DeleteTokenGroup",
   130          "responses": {
   131            "200": {
   132              "description": "A successful response.",
   133              "schema": {
   134                "$ref": "#/definitions/balanceToken"
   135              }
   136            },
   137            "default": {
   138              "description": "An unexpected error response.",
   139              "schema": {
   140                "$ref": "#/definitions/runtimeError"
   141              }
   142            }
   143          },
   144          "parameters": [
   145            {
   146              "name": "token_name",
   147              "in": "path",
   148              "required": true,
   149              "type": "string"
   150            },
   151            {
   152              "name": "name",
   153              "in": "path",
   154              "required": true,
   155              "type": "array",
   156              "items": {
   157                "type": "string"
   158              },
   159              "collectionFormat": "csv",
   160              "minItems": 1
   161            }
   162          ],
   163          "tags": [
   164            "ConfigService"
   165          ]
   166        }
   167      },
   168      "/token/tokens/{token}": {
   169        "get": {
   170          "operationId": "ConfigService_GetToken",
   171          "responses": {
   172            "200": {
   173              "description": "A successful response.",
   174              "schema": {
   175                "$ref": "#/definitions/balanceToken"
   176              }
   177            },
   178            "default": {
   179              "description": "An unexpected error response.",
   180              "schema": {
   181                "$ref": "#/definitions/runtimeError"
   182              }
   183            }
   184          },
   185          "parameters": [
   186            {
   187              "name": "token",
   188              "in": "path",
   189              "required": true,
   190              "type": "array",
   191              "items": {
   192                "type": "string"
   193              },
   194              "collectionFormat": "csv",
   195              "minItems": 1
   196            }
   197          ],
   198          "tags": [
   199            "ConfigService"
   200          ]
   201        }
   202      },
   203      "/token/types": {
   204        "get": {
   205          "operationId": "ConfigService_ListTokenTypes",
   206          "responses": {
   207            "200": {
   208              "description": "A successful response.",
   209              "schema": {
   210                "$ref": "#/definitions/balanceTokenTypes"
   211              }
   212            },
   213            "default": {
   214              "description": "An unexpected error response.",
   215              "schema": {
   216                "$ref": "#/definitions/runtimeError"
   217              }
   218            }
   219          },
   220          "tags": [
   221            "ConfigService"
   222          ]
   223        },
   224        "post": {
   225          "operationId": "ConfigService_CreateTokenType",
   226          "responses": {
   227            "200": {
   228              "description": "A successful response.",
   229              "schema": {
   230                "$ref": "#/definitions/balanceTokenType"
   231              }
   232            },
   233            "default": {
   234              "description": "An unexpected error response.",
   235              "schema": {
   236                "$ref": "#/definitions/runtimeError"
   237              }
   238            }
   239          },
   240          "parameters": [
   241            {
   242              "name": "body",
   243              "in": "body",
   244              "required": true,
   245              "schema": {
   246                "$ref": "#/definitions/balanceCreateTokenTypeRequest"
   247              }
   248            }
   249          ],
   250          "tags": [
   251            "ConfigService"
   252          ]
   253        }
   254      },
   255      "/token/types/{name}": {
   256        "get": {
   257          "operationId": "ConfigService_GetTokenType",
   258          "responses": {
   259            "200": {
   260              "description": "A successful response.",
   261              "schema": {
   262                "$ref": "#/definitions/balanceTokenType"
   263              }
   264            },
   265            "default": {
   266              "description": "An unexpected error response.",
   267              "schema": {
   268                "$ref": "#/definitions/runtimeError"
   269              }
   270            }
   271          },
   272          "parameters": [
   273            {
   274              "name": "name",
   275              "in": "path",
   276              "required": true,
   277              "type": "string"
   278            }
   279          ],
   280          "tags": [
   281            "ConfigService"
   282          ]
   283        },
   284        "delete": {
   285          "operationId": "ConfigService_DeleteTokenType",
   286          "responses": {
   287            "200": {
   288              "description": "A successful response.",
   289              "schema": {
   290                "$ref": "#/definitions/balanceTokenType"
   291              }
   292            },
   293            "default": {
   294              "description": "An unexpected error response.",
   295              "schema": {
   296                "$ref": "#/definitions/runtimeError"
   297              }
   298            }
   299          },
   300          "parameters": [
   301            {
   302              "name": "name",
   303              "in": "path",
   304              "required": true,
   305              "type": "string"
   306            }
   307          ],
   308          "tags": [
   309            "ConfigService"
   310          ]
   311        },
   312        "put": {
   313          "operationId": "ConfigService_UpdateTokenType",
   314          "responses": {
   315            "200": {
   316              "description": "A successful response.",
   317              "schema": {
   318                "$ref": "#/definitions/balanceTokenType"
   319              }
   320            },
   321            "default": {
   322              "description": "An unexpected error response.",
   323              "schema": {
   324                "$ref": "#/definitions/runtimeError"
   325              }
   326            }
   327          },
   328          "parameters": [
   329            {
   330              "name": "name",
   331              "in": "path",
   332              "required": true,
   333              "type": "string"
   334            },
   335            {
   336              "name": "body",
   337              "in": "body",
   338              "required": true,
   339              "schema": {
   340                "$ref": "#/definitions/balanceUpdateTokenTypeRequest"
   341              }
   342            }
   343          ],
   344          "tags": [
   345            "ConfigService"
   346          ]
   347        }
   348      },
   349      "/token/types/{name}/groups": {
   350        "get": {
   351          "operationId": "ConfigService_GetTokenGroups",
   352          "responses": {
   353            "200": {
   354              "description": "A successful response.",
   355              "schema": {
   356                "$ref": "#/definitions/balanceTokenGroups"
   357              }
   358            },
   359            "default": {
   360              "description": "An unexpected error response.",
   361              "schema": {
   362                "$ref": "#/definitions/runtimeError"
   363              }
   364            }
   365          },
   366          "parameters": [
   367            {
   368              "name": "name",
   369              "in": "path",
   370              "required": true,
   371              "type": "string"
   372            }
   373          ],
   374          "tags": [
   375            "ConfigService"
   376          ]
   377        },
   378        "post": {
   379          "operationId": "ConfigService_CreateTokenGroup",
   380          "responses": {
   381            "200": {
   382              "description": "A successful response.",
   383              "schema": {
   384                "$ref": "#/definitions/balanceTokenGroup"
   385              }
   386            },
   387            "default": {
   388              "description": "An unexpected error response.",
   389              "schema": {
   390                "$ref": "#/definitions/runtimeError"
   391              }
   392            }
   393          },
   394          "parameters": [
   395            {
   396              "name": "name",
   397              "in": "path",
   398              "required": true,
   399              "type": "array",
   400              "items": {
   401                "type": "string"
   402              },
   403              "collectionFormat": "csv",
   404              "minItems": 1
   405            },
   406            {
   407              "name": "body",
   408              "in": "body",
   409              "required": true,
   410              "schema": {
   411                "$ref": "#/definitions/balanceCreateTokenGroupRequest"
   412              }
   413            }
   414          ],
   415          "tags": [
   416            "ConfigService"
   417          ]
   418        }
   419      }
   420    },
   421    "definitions": {
   422      "balanceConfig": {
   423        "type": "object",
   424        "properties": {
   425          "default_token": {
   426            "type": "array",
   427            "items": {
   428              "type": "string"
   429            }
   430          },
   431          "max_token_types_num": {
   432            "type": "integer",
   433            "format": "int32"
   434          },
   435          "max_token_groups_num": {
   436            "type": "integer",
   437            "format": "int32"
   438          }
   439        }
   440      },
   441      "balanceCreateTokenGroupRequest": {
   442        "type": "object",
   443        "properties": {
   444          "name": {
   445            "type": "array",
   446            "items": {
   447              "type": "string"
   448            }
   449          },
   450          "token_type": {
   451            "type": "string"
   452          },
   453          "total_supply": {
   454            "type": "string",
   455            "format": "uint64"
   456          },
   457          "meta": {
   458            "type": "array",
   459            "items": {
   460              "$ref": "#/definitions/balanceTokenMetaRequest"
   461            }
   462          }
   463        }
   464      },
   465      "balanceCreateTokenTypeRequest": {
   466        "type": "object",
   467        "properties": {
   468          "name": {
   469            "type": "string"
   470          },
   471          "symbol": {
   472            "type": "string"
   473          },
   474          "decimals": {
   475            "type": "integer",
   476            "format": "int64"
   477          },
   478          "group_type": {
   479            "$ref": "#/definitions/balanceTokenGroupType"
   480          },
   481          "total_supply": {
   482            "type": "string",
   483            "format": "uint64"
   484          },
   485          "meta": {
   486            "type": "array",
   487            "items": {
   488              "$ref": "#/definitions/balanceTokenMetaRequest"
   489            }
   490          }
   491        }
   492      },
   493      "balanceToken": {
   494        "type": "object",
   495        "properties": {
   496          "token": {
   497            "type": "array",
   498            "items": {
   499              "type": "string"
   500            }
   501          },
   502          "type": {
   503            "$ref": "#/definitions/balanceTokenType"
   504          },
   505          "group": {
   506            "$ref": "#/definitions/balanceTokenGroup"
   507          }
   508        }
   509      },
   510      "balanceTokenGroup": {
   511        "type": "object",
   512        "properties": {
   513          "name": {
   514            "type": "array",
   515            "items": {
   516              "type": "string"
   517            }
   518          },
   519          "token_type": {
   520            "type": "string"
   521          },
   522          "total_supply": {
   523            "type": "string",
   524            "format": "uint64"
   525          },
   526          "meta": {
   527            "type": "array",
   528            "items": {
   529              "$ref": "#/definitions/balanceTokenMeta"
   530            }
   531          }
   532        },
   533        "title": "State: TokenGroup"
   534      },
   535      "balanceTokenGroupType": {
   536        "type": "string",
   537        "enum": [
   538          "OPTIONAL",
   539          "REQUIRED",
   540          "NOT_ALLOWED"
   541        ],
   542        "default": "OPTIONAL"
   543      },
   544      "balanceTokenGroups": {
   545        "type": "object",
   546        "properties": {
   547          "groups": {
   548            "type": "array",
   549            "items": {
   550              "$ref": "#/definitions/balanceTokenGroup"
   551            }
   552          }
   553        }
   554      },
   555      "balanceTokenMeta": {
   556        "type": "object",
   557        "properties": {
   558          "key": {
   559            "type": "string"
   560          },
   561          "value": {
   562            "type": "string"
   563          }
   564        }
   565      },
   566      "balanceTokenMetaRequest": {
   567        "type": "object",
   568        "properties": {
   569          "key": {
   570            "type": "string"
   571          },
   572          "value": {
   573            "type": "string"
   574          }
   575        }
   576      },
   577      "balanceTokenType": {
   578        "type": "object",
   579        "properties": {
   580          "name": {
   581            "type": "string"
   582          },
   583          "symbol": {
   584            "type": "string"
   585          },
   586          "decimals": {
   587            "type": "integer",
   588            "format": "int64"
   589          },
   590          "total_supply": {
   591            "type": "string",
   592            "format": "uint64"
   593          },
   594          "group_type": {
   595            "$ref": "#/definitions/balanceTokenGroupType"
   596          },
   597          "meta": {
   598            "type": "array",
   599            "items": {
   600              "$ref": "#/definitions/balanceTokenMeta"
   601            }
   602          }
   603        },
   604        "title": "State: TokenType"
   605      },
   606      "balanceTokenTypes": {
   607        "type": "object",
   608        "properties": {
   609          "types": {
   610            "type": "array",
   611            "items": {
   612              "$ref": "#/definitions/balanceTokenType"
   613            }
   614          }
   615        }
   616      },
   617      "balanceUpdateTokenTypeRequest": {
   618        "type": "object",
   619        "properties": {
   620          "name": {
   621            "type": "string"
   622          },
   623          "symbol": {
   624            "type": "string"
   625          },
   626          "total_supply": {
   627            "type": "string",
   628            "format": "uint64"
   629          },
   630          "meta": {
   631            "type": "array",
   632            "items": {
   633              "$ref": "#/definitions/balanceTokenMetaRequest"
   634            }
   635          }
   636        }
   637      },
   638      "protobufAny": {
   639        "type": "object",
   640        "properties": {
   641          "type_url": {
   642            "type": "string"
   643          },
   644          "value": {
   645            "type": "string",
   646            "format": "byte"
   647          }
   648        }
   649      },
   650      "runtimeError": {
   651        "type": "object",
   652        "properties": {
   653          "error": {
   654            "type": "string"
   655          },
   656          "code": {
   657            "type": "integer",
   658            "format": "int32"
   659          },
   660          "message": {
   661            "type": "string"
   662          },
   663          "details": {
   664            "type": "array",
   665            "items": {
   666              "$ref": "#/definitions/protobufAny"
   667            }
   668          }
   669        }
   670      }
   671    }
   672  }