docusaurus-openapi icon indicating copy to clipboard operation
docusaurus-openapi copied to clipboard

Missing request examples

Open maurolucc opened this issue 3 years ago • 0 comments

Issue Request examples values are not loaded. Examples can be loaded from reference but not directly from examples value which is a valid format.

Example

This is the .json:

"/trusted-ledgers-smart-contracts-registry/v1/jsonrpc":{
   "post":{
      "operationId":"post-trusted-ledgers-smart-contracts-registry-v2-jsonrpc",
      "tags":[
         "Trusted Ledgers & Smart Contracts Registry API"
      ],
      "summary":"Helper APIs",
      "description":"Helper APIs that assist the construction of blockchain transactions and interaction with\nthe ledger (Write operation on ledger).\n",
      "security":[
         {
            "bearerAuth":[
               
            ]
         }
      ],
      "requestBody":{
         "required":true,
         "description":"The body follows the\n[JSON-RPC 2.0 specification](https://www.jsonrpc.org/specification).\n\nIt requires the following fields:\n\n- **jsonrpc**: Must be exactly '2.0'\n- **method**: Method to be invoked. Possible values: 'insertLedgerInfo',\n'updateLedgerInfoById', 'insertSmartContractInfo', 'updateSmartContractInfoById',\n'updateSmartContractInfoByName', 'updateSmartContractName', 'sendSignedTransaction'\n- **params**: Array of parameters\n- **id**: Identifier stablished by the client\n",
         "content":{
            "application/json":{
               "schema":{
                  "required":[
                     "jsonrpc",
                     "id",
                     "method",
                     "params"
                  ],
                  "type":"object",
                  "properties":{
                     "jsonrpc":{
                        "description":"Must be exactly '2.0'",
                        "type":"string"
                     },
                     "method":{
                        "description":"Method that needs to be invoked",
                        "type":"string"
                     },
                     "params":{
                        "description":"Array of parameters",
                        "type":"array",
                        "items":{
                           "type":"object"
                        }
                     },
                     "id":{
                        "description":"Identifier established by the client",
                        "type":"integer",
                        "example":1
                     }
                  }
               },
               "examples":{ // <-------------------- THIS IS WHAT SHOULD BE LOADED
                  "Build tx to insertLedgerInfo":{
                     "description":"Call to build an unsigned transaction to insert ledger info in the registry. This method requires admin rights in the Trusted Apps Registry.\n\nParameters:\n- **from**: Ethereum address of the administrator\n- **name**: Name for the new ledger\n- **info**: Data information. This field must be a JSON stringified and converted into hex string\n",
                     "value":{
                        "jsonrpc":"2.0",
                        "method":"insertLedgerInfo",
                        "id":1,
                        "params":[
                           {
                              "from":"0x416e6e6162656c2e4c65652e452d412d506f652e",
                              "name":"EBSI Ethereum",
                              "info":"0x7b226e616d65223a224542534920657468657265756d227d"
                           }
                        ]
                     }
                  },
                  "Build tx to updateLedgerInfoById":{
                     "description":"Call to build an unsigned transaction to update a ledger info in the registry given its ID. This method requires admin rights in the Trusted Apps Registry.\n\nParameters:\n- **from**: Ethereum address of the administrator\n- **ledgerInfoId**: Ledger Info ID\n- **info**: Data information. This field must be a JSON stringified and converted into hex string\n",
                     "value":{
                        "jsonrpc":"2.0",
                        "method":"updateLedgerInfoById",
                        "id":1,
                        "params":[
                           {
                              "from":"0x416e6e6162656c2e4c65652e452d412d506f652e",
                              "ledgerInfoId":"0x94df19c1c654f4bca27545c2ab06647bb96356c4b771a6af0aa54b7bb8f6ffb7",
                              "info":"0x7b226e616d65223a224542534920657468657265756d227d"
                           }
                        ]
                     }
                  },
                 ... <-------------- MULTIPLE EXAMPLES
            }

This is the result: Captura de pantalla 2022-02-17 a les 14 47 39

Expected result

  • List of requests examples provided should appear in the description
  • List of requests examples provided should be loaded in "Execute" (dropdown)

maurolucc avatar Feb 17 '22 13:02 maurolucc