diff --git a/docs/api/sc-rollup-node-rpc-openapi.json b/docs/api/sc-rollup-node-rpc-openapi.json new file mode 100644 index 0000000000000000000000000000000000000000..039e9df8e57be7c9f0846a8edc31db08e87d3c89 --- /dev/null +++ b/docs/api/sc-rollup-node-rpc-openapi.json @@ -0,0 +1,4475 @@ +{ "openapi": "3.0.0", + "info": + { "title": "SC rollup node RPC", + "description": "Smart contracts rollup node RPC API", + "version": "060fc372 (2022-10-17 11:11:04 +0200) (15.0~rc1+dev)" }, + "paths": + { "/describe": + { "get": + { "description": "RPCs documentation and input/output schema", + "parameters": + [ { "name": "recurse", "in": "query", "required": true, + "schema": { "type": "string" } } ], + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "$ref": "#/components/schemas/service_tree" } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/global/block/{block_id}/dal/slot_headers": + { "get": + { "description": "Availability slots for a given block", + "parameters": + [ { "name": "block_id", "in": "path", + "description": "An L1 block identifier.", + "required": true, "schema": { "type": "string" } } ], + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "type": "array", + "items": + { "type": "object", + "properties": + { "level": + { "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 }, + "index": + { "type": "integer", + "minimum": 0, "maximum": 255 }, + "commitment": + { "$ref": + "#/components/schemas/DAL_commitment" } }, + "required": + [ "level", "index", "commitment" ] } } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/global/block/{block_id}/dal/slot_page": + { "get": + { "description": + "Data availability downloaded slot pages for a given block hash", + "parameters": + [ { "name": "block_id", "in": "path", + "description": "An L1 block identifier.", + "required": true, "schema": { "type": "string" } }, + { "name": "index", "in": "query", "required": false, + "schema": { "type": "string" } }, + { "name": "slot_page", "in": "query", "required": false, + "schema": { "type": "string" } } ], + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "type": "object", + "properties": + { "result": + { "$ref": + "#/components/schemas/unistring" }, + "contents": + { "type": "string", + "pattern": + "^([a-zA-Z0-9][a-zA-Z0-9])*$" } }, + "required": [ "result" ] } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/global/block/{block_id}/dal/slot_pages": + { "get": + { "description": + "Data availability downloaded slot pages for a given block hash", + "parameters": + [ { "name": "block_id", "in": "path", + "description": "An L1 block identifier.", + "required": true, "schema": { "type": "string" } } ], + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "type": "array", + "items": + { "type": "object", + "properties": + { "index": + { "type": "integer", + "minimum": 0, "maximum": 255 }, + "contents": + { "type": "array", + "items": + { "nullable": true, + "oneOf": + [ { "title": "Some", + "type": "string", + "pattern": + "^([a-zA-Z0-9][a-zA-Z0-9])*$" } ] } } }, + "required": [ "index", "contents" ] } } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/global/block/{block_id}/dal/slot_subscriptions": + { "get": + { "description": + "Data availability layer slot subscriptions at block", + "parameters": + [ { "name": "block_id", "in": "path", + "description": "An L1 block identifier.", + "required": true, "schema": { "type": "string" } } ], + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "nullable": true, + "oneOf": + [ { "title": "Some", "type": "array", + "items": + { "type": "integer", "minimum": 0, + "maximum": 255 } } ] } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/global/block/{block_id}/hash": + { "get": + { "description": + "Tezos block hash of block known to the smart-contract rollup node", + "parameters": + [ { "name": "block_id", "in": "path", + "description": "An L1 block identifier.", + "required": true, "schema": { "type": "string" } } ], + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "title": + "A block identifier (Base58Check-encoded)", + "oneOf": + [ { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/global/block/{block_id}/inbox": + { "get": + { "description": "Rollup inbox for block", + "parameters": + [ { "name": "block_id", "in": "path", + "description": "An L1 block identifier.", + "required": true, "schema": { "type": "string" } } ], + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "type": "object", + "properties": + { "rollup": + { "$ref": + "#/components/schemas/alpha.rollup_address" }, + "message_counter": + { "$ref": + "#/components/schemas/positive_bignum" }, + "nb_messages_in_commitment_period": + { "$ref": + "#/components/schemas/int64" }, + "starting_level_of_current_commitment_period": + { "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 }, + "level": + { "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 }, + "current_level_hash": + { "$ref": + "#/components/schemas/inbox_hash" }, + "old_levels_messages": + { "type": "object", + "properties": + { "index": + { "type": "integer", + "minimum": -1073741824, + "maximum": 1073741823 }, + "content": + { "$ref": + "#/components/schemas/inbox_hash" }, + "back_pointers": + { "type": "array", + "items": + { "$ref": + "#/components/schemas/inbox_hash" } } }, + "required": + [ "index", "content", + "back_pointers" ] } }, + "required": + [ "rollup", "message_counter", + "nb_messages_in_commitment_period", + "starting_level_of_current_commitment_period", + "level", "current_level_hash", + "old_levels_messages" ] } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/global/block/{block_id}/level": + { "get": + { "description": + "Level of Tezos block known to the smart-contract rollup node", + "parameters": + [ { "name": "block_id", "in": "path", + "description": "An L1 block identifier.", + "required": true, "schema": { "type": "string" } } ], + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "type": "integer", "minimum": -2147483648, + "maximum": 2147483647 } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/global/block/{block_id}/num_messages": + { "get": + { "description": "Number of messages for specified block", + "parameters": + [ { "name": "block_id", "in": "path", + "description": "An L1 block identifier.", + "required": true, "schema": { "type": "string" } } ], + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "title": "Big number", + "description": + "Decimal representation of a big number", + "type": "string" } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/global/block/{block_id}/outbox": + { "get": + { "description": "Outbox at block", + "parameters": + [ { "name": "block_id", "in": "path", + "description": "An L1 block identifier.", + "required": true, "schema": { "type": "string" } } ], + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "type": "array", + "items": + { "type": "object", + "properties": + { "outbox_level": + { "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 }, + "message_index": + { "$ref": + "#/components/schemas/positive_bignum" }, + "message": + { "type": "object", + "properties": + { "transactions": + { "type": "array", + "items": + { "type": "object", + "properties": + { "parameters": + { "$ref": + "#/components/schemas/micheline.alpha.michelson_v1.expression" }, + "destination": + { "$ref": + "#/components/schemas/alpha.contract_id.originated" }, + "entrypoint": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "parameters", + "destination" ] } } }, + "required": [ "transactions" ] } }, + "required": + [ "outbox_level", "message_index", + "message" ] } } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/global/block/{block_id}/state": + { "get": + { "description": + "Retrieve value from key is PVM state of specified block", + "parameters": + [ { "name": "block_id", "in": "path", + "description": "An L1 block identifier.", + "required": true, "schema": { "type": "string" } }, + { "name": "key", "in": "query", "required": true, + "schema": { "type": "string" } } ], + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "type": "string", + "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/global/block/{block_id}/state_hash": + { "get": + { "description": "State hash for this block", + "parameters": + [ { "name": "block_id", "in": "path", + "description": "An L1 block identifier.", + "required": true, "schema": { "type": "string" } } ], + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "title": + "The hash of the VM state of a smart contract rollup (Base58Check-encoded)", + "oneOf": + [ { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/global/block/{block_id}/status": + { "get": + { "description": "PVM status at block", + "parameters": + [ { "name": "block_id", "in": "path", + "description": "An L1 block identifier.", + "required": true, "schema": { "type": "string" } } ], + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "title": "Universal string representation", + "description": + "Either a plain UTF8 string, or a sequence of bytes for strings that contain invalid byte sequences.", + "oneOf": + [ { "type": "string" }, + { "type": "object", + "properties": + { "invalid_utf8_string": + { "type": "array", + "items": + { "type": "integer", + "minimum": 0, + "maximum": 255 } } }, + "required": [ "invalid_utf8_string" ] } ] } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/global/block/{block_id}/ticks": + { "get": + { "description": "Number of ticks for specified level", + "parameters": + [ { "name": "block_id", "in": "path", + "description": "An L1 block identifier.", + "required": true, "schema": { "type": "string" } } ], + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "title": "Big number", + "description": + "Decimal representation of a big number", + "type": "string" } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/global/block/{block_id}/total_ticks": + { "get": + { "description": "Total number of ticks at specified block", + "parameters": + [ { "name": "block_id", "in": "path", + "description": "An L1 block identifier.", + "required": true, "schema": { "type": "string" } } ], + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "title": "Positive big number", + "description": + "Decimal representation of a positive big number", + "type": "string" } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/global/last_stored_commitment": + { "get": + { "description": "Last commitment computed by the node", + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "nullable": true, + "oneOf": + [ { "title": "Some", "type": "object", + "properties": + { "commitment": + { "type": "object", + "properties": + { "compressed_state": + { "$ref": + "#/components/schemas/state_hash" }, + "inbox_level": + { "type": "integer", + "minimum": + -2147483648, + "maximum": 2147483647 }, + "predecessor": + { "$ref": + "#/components/schemas/commitment_hash" }, + "number_of_ticks": + { "$ref": + "#/components/schemas/int64" } }, + "required": + [ "compressed_state", + "inbox_level", + "predecessor", + "number_of_ticks" ] }, + "hash": + { "$ref": + "#/components/schemas/commitment_hash" }, + "published_at_level": + { "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 } }, + "required": [ "commitment", "hash" ] } ] } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/global/proofs/outbox": + { "get": + { "description": + "Generate serialized output proof for some outbox message", + "parameters": + [ { "name": "outbox_level", "in": "query", "required": false, + "schema": { "type": "string" } }, + { "name": "message_index", "in": "query", + "required": false, "schema": { "type": "string" } }, + { "name": "serialized_outbox_message", "in": "query", + "required": false, "schema": { "type": "string" } } ], + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "type": "object", + "properties": + { "commitment": + { "$ref": + "#/components/schemas/commitment_hash" }, + "proof": + { "type": "string", + "pattern": + "^([a-zA-Z0-9][a-zA-Z0-9])*$" } }, + "required": [ "commitment", "proof" ] } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/global/sc_rollup_address": + { "get": + { "description": "Smart-contract rollup address", + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "title": + "A smart contract rollup address (Base58Check-encoded)", + "oneOf": + [ { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/global/tezos_head": + { "get": + { "description": + "Tezos head known to the smart-contract rollup node", + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "nullable": true, + "oneOf": + [ { "title": "Some", + "oneOf": + [ { "$ref": + "#/components/schemas/block_hash" } ] } ] } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/global/tezos_level": + { "get": + { "description": + "Tezos level known to the smart-contract rollup node", + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "nullable": true, + "oneOf": + [ { "title": "Some", "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 } ] } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/local/last_published_commitment": + { "get": + { "description": "Last commitment published by the node", + "responses": + { "200": + { "description": "", + "content": + { "application/json": + { "schema": + { "nullable": true, + "oneOf": + [ { "title": "Some", "type": "object", + "properties": + { "commitment": + { "type": "object", + "properties": + { "compressed_state": + { "$ref": + "#/components/schemas/state_hash" }, + "inbox_level": + { "type": "integer", + "minimum": + -2147483648, + "maximum": 2147483647 }, + "predecessor": + { "$ref": + "#/components/schemas/commitment_hash" }, + "number_of_ticks": + { "$ref": + "#/components/schemas/int64" } }, + "required": + [ "compressed_state", + "inbox_level", + "predecessor", + "number_of_ticks" ] }, + "hash": + { "$ref": + "#/components/schemas/commitment_hash" }, + "published_at_level": + { "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 } }, + "required": [ "commitment", "hash" ] } ] } } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } }, + "/openapi": + { "get": + { "description": "OpenAPI specification of RPCs for rollup node", + "responses": + { "200": + { "description": "", + "content": { "application/json": { "schema": {} } } }, + "default": + { "description": "", + "content": + { "application/json": + { "schema": + { "description": + "The full list of errors is available with the global RPC `GET errors`" } } } } } } } }, + "components": + { "schemas": + { "DAL_commitment": + { "title": + "Commitment representation for the DAL (Base58Check-encoded)", + "oneOf": [ { "$ref": "#/components/schemas/unistring" } ] }, + "alpha.contract_id.originated": + { "title": "A contract handle -- originated account", + "description": + "A contract notation as given to an RPC or inside scripts. Can be a base58 originated contract hash.", + "oneOf": [ { "$ref": "#/components/schemas/unistring" } ] }, + "alpha.michelson.v1.primitives": + { "type": "string", + "enum": + [ "SHA512", "HASH_KEY", "SIZE", "SAPLING_VERIFY_UPDATE", + "False", "SAPLING_EMPTY_STATE", "RENAME", "sapling_state", + "UNPACK", "contract", "address", "chest_key", "Pair", + "IF_NONE", "key_hash", "operation", "storage", "UNPAIR", + "view", "BLAKE2B", "AMOUNT", "DUP", "or", "NEG", "int", + "SELF_ADDRESS", "ISNAT", "DIG", "CHAIN_ID", "string", + "LSR", "lambda", "sapling_transaction", "ABS", + "CREATE_CONTRACT", "SHA256", "JOIN_TICKETS", "LEVEL", + "bls12_381_fr", "sapling_transaction_deprecated", + "tx_rollup_l2_address", "mutez", "CHECK_SIGNATURE", + "STEPS_TO_QUOTA", "SELF", "DIP", "map", "AND", "COMPARE", + "bls12_381_g1", "MAP", "APPLY", "Elt", "bool", "NOT", + "IMPLICIT_ACCOUNT", "LT", "UNIT", "EMIT", "SET_DELEGATE", + "Some", "parameter", "bytes", "chest", "EMPTY_BIG_MAP", + "None", "SUB", "list", "ADD", "nat", "VOTING_POWER", + "option", "CDR", "GT", "IF_CONS", "CONS", "LSL", "DUG", + "PACK", "SHA3", "SOURCE", "set", "SUB_MUTEZ", "LAMBDA", + "RIGHT", "CREATE_ACCOUNT", "Unit", "CAST", "NEQ", "ITER", + "FAILWITH", "PUSH", "OPEN_CHEST", "SOME", "big_map", + "BALANCE", "NIL", "signature", "CAR", "UPDATE", + "TOTAL_VOTING_POWER", "PAIR", "LAMBDA_REC", "ADDRESS", + "True", "Right", "Lambda_rec", "IF", "NEVER", "chain_id", + "SWAP", "EMPTY_MAP", "MUL", "INT", "pair", "KECCAK", + "LEFT", "Left", "SPLIT_TICKET", "constant", "ticket", + "EDIV", "LOOP", "timestamp", "TICKET", "LE", + "PAIRING_CHECK", "MIN_BLOCK_TIME", "OR", "key", + "GET_AND_UPDATE", "unit", "never", "NONE", "IF_LEFT", + "GET", "NOW", "TRANSFER_TOKENS", "LOOP_LEFT", "CONTRACT", + "TICKET_DEPRECATED", "VIEW", "EMPTY_SET", "XOR", + "bls12_381_g2", "READ_TICKET", "EQ", "GE", "MEM", "SENDER", + "DROP", "CONCAT", "EXEC", "SLICE", "code" ] }, + "alpha.rollup_address": + { "title": "A smart contract rollup address", + "description": + "A smart contract rollup is identified by a base58 address starting with scr1", + "oneOf": [ { "$ref": "#/components/schemas/unistring" } ] }, + "bignum": + { "title": "Big number", + "description": "Decimal representation of a big number", + "type": "string" }, + "block_hash": + { "title": "A block identifier (Base58Check-encoded)", + "oneOf": [ { "$ref": "#/components/schemas/unistring" } ] }, + "commitment_hash": + { "title": + "The hash of a commitment of a smart contract rollup (Base58Check-encoded)", + "oneOf": [ { "$ref": "#/components/schemas/unistring" } ] }, + "inbox_hash": + { "title": + "The hash of an inbox of a smart contract rollup (Base58Check-encoded)", + "oneOf": [ { "$ref": "#/components/schemas/unistring" } ] }, + "int64": + { "title": "64 bit integers", + "description": "Decimal representation of 64 bit integers", + "type": "string" }, + "layout": + { "oneOf": + [ { "title": "Zero_width", "type": "object", + "properties": + { "kind": + { "type": "string", "enum": [ "Zero_width" ] } }, + "required": [ "kind" ] }, + { "title": "Int", "type": "object", + "properties": + { "size": + { "type": "string", + "enum": + [ "Int32", "Int16", "Uint16", "Int64", "Int8", + "Uint8" ] }, + "kind": { "type": "string", "enum": [ "Int" ] } }, + "required": [ "size", "kind" ] }, + { "title": "Bool", "type": "object", + "properties": + { "kind": { "type": "string", "enum": [ "Bool" ] } }, + "required": [ "kind" ] }, + { "title": "RangedInt", "type": "object", + "properties": + { "min": + { "type": "integer", "minimum": -1073741824, + "maximum": 1073741823 }, + "max": + { "type": "integer", "minimum": -1073741824, + "maximum": 1073741823 }, + "kind": { "type": "string", "enum": [ "RangedInt" ] } }, + "required": [ "min", "max", "kind" ] }, + { "title": "RangedFloat", "type": "object", + "properties": + { "min": { "type": "number" }, + "max": { "type": "number" }, + "kind": + { "type": "string", "enum": [ "RangedFloat" ] } }, + "required": [ "min", "max", "kind" ] }, + { "title": "Float", "type": "object", + "properties": + { "kind": { "type": "string", "enum": [ "Float" ] } }, + "required": [ "kind" ] }, + { "title": "Bytes", "type": "object", + "properties": + { "kind": { "type": "string", "enum": [ "Bytes" ] } }, + "required": [ "kind" ] }, + { "title": "String", "type": "object", + "properties": + { "kind": { "type": "string", "enum": [ "String" ] } }, + "required": [ "kind" ] }, + { "title": "Enum", "type": "object", + "properties": + { "size": + { "type": "string", + "enum": [ "Int16", "Uint16", "Int8", "Uint8" ] }, + "reference": + { "$ref": "#/components/schemas/unistring" }, + "kind": { "type": "string", "enum": [ "Enum" ] } }, + "required": [ "size", "reference", "kind" ] }, + { "title": "Seq", "type": "object", + "properties": + { "layout": { "$ref": "#/components/schemas/layout" }, + "kind": { "type": "string", "enum": [ "Seq" ] }, + "length_limit": + { "oneOf": + [ { "title": "No_limit", "type": "object", + "properties": + { "kind": + { "type": "string", + "enum": [ "no-limit" ] } }, + "required": [ "kind" ] }, + { "title": "At_most", "type": "object", + "properties": + { "kind": + { "type": "string", + "enum": [ "at-most" ] }, + "at_most": + { "type": "integer", + "minimum": -1073741824, + "maximum": 1073741823 } }, + "required": [ "kind", "at_most" ] }, + { "title": "Exactly", "type": "object", + "properties": + { "kind": + { "type": "string", + "enum": [ "exactly" ] }, + "exactly": + { "type": "integer", + "minimum": -1073741824, + "maximum": 1073741823 } }, + "required": [ "kind", "exactly" ] } ] } }, + "required": [ "layout", "kind" ] }, + { "title": "Ref", "type": "object", + "properties": + { "name": { "$ref": "#/components/schemas/unistring" }, + "kind": { "type": "string", "enum": [ "Ref" ] } }, + "required": [ "name", "kind" ] }, + { "title": "Padding", "type": "object", + "properties": + { "kind": { "type": "string", "enum": [ "Padding" ] } }, + "required": [ "kind" ] } ] }, + "micheline.alpha.michelson_v1.expression": + { "oneOf": + [ { "title": "Int", "type": "object", + "properties": + { "int": { "$ref": "#/components/schemas/bignum" } }, + "required": [ "int" ] }, + { "title": "String", "type": "object", + "properties": + { "string": + { "$ref": "#/components/schemas/unistring" } }, + "required": [ "string" ] }, + { "title": "Bytes", "type": "object", + "properties": + { "bytes": + { "type": "string", + "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" } }, + "required": [ "bytes" ] }, + { "title": "Sequence", "type": "array", + "items": + { "$ref": + "#/components/schemas/micheline.alpha.michelson_v1.expression" } }, + { "title": "Prim__generic", + "description": + "Generic primitive (any number of args with or without annotations)", + "type": "object", + "properties": + { "prim": + { "$ref": + "#/components/schemas/alpha.michelson.v1.primitives" }, + "args": + { "type": "array", + "items": + { "$ref": + "#/components/schemas/micheline.alpha.michelson_v1.expression" } }, + "annots": + { "type": "array", "items": { "type": "string" } } }, + "required": [ "prim" ] } ] }, + "positive_bignum": + { "title": "Positive big number", + "description": + "Decimal representation of a positive big number", + "type": "string" }, + "schema.field": + { "oneOf": + [ { "title": "Named_field", "type": "object", + "properties": + { "name": { "$ref": "#/components/schemas/unistring" }, + "layout": { "$ref": "#/components/schemas/layout" }, + "data_kind": + { "$ref": "#/components/schemas/schema.kind" }, + "kind": { "type": "string", "enum": [ "named" ] } }, + "required": [ "name", "layout", "data_kind", "kind" ] }, + { "title": "Anonymous_field", "type": "object", + "properties": + { "layout": { "$ref": "#/components/schemas/layout" }, + "kind": { "type": "string", "enum": [ "anon" ] }, + "data_kind": + { "$ref": "#/components/schemas/schema.kind" } }, + "required": [ "layout", "kind", "data_kind" ] }, + { "title": "Dynamic_field", "type": "object", + "properties": + { "kind": { "type": "string", "enum": [ "dyn" ] }, + "name": { "$ref": "#/components/schemas/unistring" }, + "num_fields": + { "type": "integer", "minimum": -1073741824, + "maximum": 1073741823 }, + "size": + { "type": "string", + "enum": [ "Uint30", "Uint16", "Uint8" ] } }, + "required": [ "kind", "num_fields", "size" ] }, + { "title": "Optional_field", "type": "object", + "properties": + { "kind": + { "type": "string", + "enum": [ "option_indicator" ] }, + "name": { "$ref": "#/components/schemas/unistring" } }, + "required": [ "kind", "name" ] } ] }, + "schema.kind": + { "oneOf": + [ { "title": "Fixed", "type": "object", + "properties": + { "size": + { "type": "integer", "minimum": -1073741824, + "maximum": 1073741823 }, + "kind": { "type": "string", "enum": [ "Float" ] } }, + "required": [ "size", "kind" ] }, + { "title": "Dynamic", "type": "object", + "properties": + { "kind": { "type": "string", "enum": [ "Dynamic" ] } }, + "required": [ "kind" ] }, + { "title": "Variable", "type": "object", + "properties": + { "kind": { "type": "string", "enum": [ "Variable" ] } }, + "required": [ "kind" ] } ] }, + "service_tree": + { "oneOf": + [ { "title": "Static", "type": "object", + "properties": + { "static": + { "type": "object", + "properties": + { "get_service": + { "type": "object", + "properties": + { "meth": + { "type": "string", + "enum": + [ "PATCH", "GET", "POST", + "PUT", "DELETE" ] }, + "path": + { "type": "array", + "items": + { "oneOf": + [ { "title": "PStatic", + "oneOf": + [ { "$ref": + "#/components/schemas/unistring" } ] }, + { "title": "PDynamic", + "type": "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", "name" ] }, + { "title": "PDynamicTail", + "type": "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "multiple" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", "name" ] } ] } }, + "description": + { "$ref": + "#/components/schemas/unistring" }, + "query": + { "type": "array", + "items": + { "type": "object", + "properties": + { "name": + { "$ref": + "#/components/schemas/unistring" }, + "description": + { "$ref": + "#/components/schemas/unistring" }, + "kind": + { "oneOf": + [ { "title": + "Single", + "type": + "object", + "properties": + { "single": + { "type": + "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", + "name" ] } }, + "required": + [ "single" ] }, + { "title": + "Optional", + "type": + "object", + "properties": + { "optional": + { "type": + "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", + "name" ] } }, + "required": + [ "optional" ] }, + { "title": "Flag", + "type": + "object", + "properties": + { "flag": + { "type": + "object", + "properties": + {} } }, + "required": + [ "flag" ] }, + { "title": + "Multi", + "type": + "object", + "properties": + { "multi": + { "type": + "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", + "name" ] } }, + "required": + [ "multi" ] } ] } }, + "required": + [ "name", "kind" ] } }, + "input": + { "type": "object", + "properties": + { "json_schema": {}, + "binary_schema": + { "type": "object", + "properties": + { "toplevel": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] }, + "fields": + { "type": "array", + "items": + { "type": + "object", + "properties": + { "description": + { "type": + "object", + "properties": + { "title": + { "$ref": + "#/components/schemas/unistring" }, + "description": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "title" ] }, + "encoding": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] } }, + "required": + [ "description", + "encoding" ] } } }, + "required": + [ "toplevel", + "fields" ] } }, + "required": + [ "json_schema", + "binary_schema" ] }, + "output": + { "type": "object", + "properties": + { "json_schema": {}, + "binary_schema": + { "type": "object", + "properties": + { "toplevel": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] }, + "fields": + { "type": "array", + "items": + { "type": + "object", + "properties": + { "description": + { "type": + "object", + "properties": + { "title": + { "$ref": + "#/components/schemas/unistring" }, + "description": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "title" ] }, + "encoding": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] } }, + "required": + [ "description", + "encoding" ] } } }, + "required": + [ "toplevel", + "fields" ] } }, + "required": + [ "json_schema", + "binary_schema" ] }, + "error": + { "type": "object", + "properties": + { "json_schema": {}, + "binary_schema": + { "type": "object", + "properties": + { "toplevel": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] }, + "fields": + { "type": "array", + "items": + { "type": + "object", + "properties": + { "description": + { "type": + "object", + "properties": + { "title": + { "$ref": + "#/components/schemas/unistring" }, + "description": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "title" ] }, + "encoding": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] } }, + "required": + [ "description", + "encoding" ] } } }, + "required": + [ "toplevel", + "fields" ] } }, + "required": + [ "json_schema", + "binary_schema" ] } }, + "required": + [ "meth", "path", "query", "output", + "error" ] }, + "post_service": + { "type": "object", + "properties": + { "meth": + { "type": "string", + "enum": + [ "PATCH", "GET", "POST", + "PUT", "DELETE" ] }, + "path": + { "type": "array", + "items": + { "oneOf": + [ { "title": "PStatic", + "oneOf": + [ { "$ref": + "#/components/schemas/unistring" } ] }, + { "title": "PDynamic", + "type": "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", "name" ] }, + { "title": "PDynamicTail", + "type": "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "multiple" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", "name" ] } ] } }, + "description": + { "$ref": + "#/components/schemas/unistring" }, + "query": + { "type": "array", + "items": + { "type": "object", + "properties": + { "name": + { "$ref": + "#/components/schemas/unistring" }, + "description": + { "$ref": + "#/components/schemas/unistring" }, + "kind": + { "oneOf": + [ { "title": + "Single", + "type": + "object", + "properties": + { "single": + { "type": + "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", + "name" ] } }, + "required": + [ "single" ] }, + { "title": + "Optional", + "type": + "object", + "properties": + { "optional": + { "type": + "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", + "name" ] } }, + "required": + [ "optional" ] }, + { "title": "Flag", + "type": + "object", + "properties": + { "flag": + { "type": + "object", + "properties": + {} } }, + "required": + [ "flag" ] }, + { "title": + "Multi", + "type": + "object", + "properties": + { "multi": + { "type": + "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", + "name" ] } }, + "required": + [ "multi" ] } ] } }, + "required": + [ "name", "kind" ] } }, + "input": + { "type": "object", + "properties": + { "json_schema": {}, + "binary_schema": + { "type": "object", + "properties": + { "toplevel": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] }, + "fields": + { "type": "array", + "items": + { "type": + "object", + "properties": + { "description": + { "type": + "object", + "properties": + { "title": + { "$ref": + "#/components/schemas/unistring" }, + "description": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "title" ] }, + "encoding": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] } }, + "required": + [ "description", + "encoding" ] } } }, + "required": + [ "toplevel", + "fields" ] } }, + "required": + [ "json_schema", + "binary_schema" ] }, + "output": + { "type": "object", + "properties": + { "json_schema": {}, + "binary_schema": + { "type": "object", + "properties": + { "toplevel": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] }, + "fields": + { "type": "array", + "items": + { "type": + "object", + "properties": + { "description": + { "type": + "object", + "properties": + { "title": + { "$ref": + "#/components/schemas/unistring" }, + "description": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "title" ] }, + "encoding": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] } }, + "required": + [ "description", + "encoding" ] } } }, + "required": + [ "toplevel", + "fields" ] } }, + "required": + [ "json_schema", + "binary_schema" ] }, + "error": + { "type": "object", + "properties": + { "json_schema": {}, + "binary_schema": + { "type": "object", + "properties": + { "toplevel": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] }, + "fields": + { "type": "array", + "items": + { "type": + "object", + "properties": + { "description": + { "type": + "object", + "properties": + { "title": + { "$ref": + "#/components/schemas/unistring" }, + "description": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "title" ] }, + "encoding": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] } }, + "required": + [ "description", + "encoding" ] } } }, + "required": + [ "toplevel", + "fields" ] } }, + "required": + [ "json_schema", + "binary_schema" ] } }, + "required": + [ "meth", "path", "query", "output", + "error" ] }, + "delete_service": + { "type": "object", + "properties": + { "meth": + { "type": "string", + "enum": + [ "PATCH", "GET", "POST", + "PUT", "DELETE" ] }, + "path": + { "type": "array", + "items": + { "oneOf": + [ { "title": "PStatic", + "oneOf": + [ { "$ref": + "#/components/schemas/unistring" } ] }, + { "title": "PDynamic", + "type": "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", "name" ] }, + { "title": "PDynamicTail", + "type": "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "multiple" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", "name" ] } ] } }, + "description": + { "$ref": + "#/components/schemas/unistring" }, + "query": + { "type": "array", + "items": + { "type": "object", + "properties": + { "name": + { "$ref": + "#/components/schemas/unistring" }, + "description": + { "$ref": + "#/components/schemas/unistring" }, + "kind": + { "oneOf": + [ { "title": + "Single", + "type": + "object", + "properties": + { "single": + { "type": + "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", + "name" ] } }, + "required": + [ "single" ] }, + { "title": + "Optional", + "type": + "object", + "properties": + { "optional": + { "type": + "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", + "name" ] } }, + "required": + [ "optional" ] }, + { "title": "Flag", + "type": + "object", + "properties": + { "flag": + { "type": + "object", + "properties": + {} } }, + "required": + [ "flag" ] }, + { "title": + "Multi", + "type": + "object", + "properties": + { "multi": + { "type": + "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", + "name" ] } }, + "required": + [ "multi" ] } ] } }, + "required": + [ "name", "kind" ] } }, + "input": + { "type": "object", + "properties": + { "json_schema": {}, + "binary_schema": + { "type": "object", + "properties": + { "toplevel": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] }, + "fields": + { "type": "array", + "items": + { "type": + "object", + "properties": + { "description": + { "type": + "object", + "properties": + { "title": + { "$ref": + "#/components/schemas/unistring" }, + "description": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "title" ] }, + "encoding": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] } }, + "required": + [ "description", + "encoding" ] } } }, + "required": + [ "toplevel", + "fields" ] } }, + "required": + [ "json_schema", + "binary_schema" ] }, + "output": + { "type": "object", + "properties": + { "json_schema": {}, + "binary_schema": + { "type": "object", + "properties": + { "toplevel": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] }, + "fields": + { "type": "array", + "items": + { "type": + "object", + "properties": + { "description": + { "type": + "object", + "properties": + { "title": + { "$ref": + "#/components/schemas/unistring" }, + "description": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "title" ] }, + "encoding": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] } }, + "required": + [ "description", + "encoding" ] } } }, + "required": + [ "toplevel", + "fields" ] } }, + "required": + [ "json_schema", + "binary_schema" ] }, + "error": + { "type": "object", + "properties": + { "json_schema": {}, + "binary_schema": + { "type": "object", + "properties": + { "toplevel": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] }, + "fields": + { "type": "array", + "items": + { "type": + "object", + "properties": + { "description": + { "type": + "object", + "properties": + { "title": + { "$ref": + "#/components/schemas/unistring" }, + "description": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "title" ] }, + "encoding": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] } }, + "required": + [ "description", + "encoding" ] } } }, + "required": + [ "toplevel", + "fields" ] } }, + "required": + [ "json_schema", + "binary_schema" ] } }, + "required": + [ "meth", "path", "query", "output", + "error" ] }, + "put_service": + { "type": "object", + "properties": + { "meth": + { "type": "string", + "enum": + [ "PATCH", "GET", "POST", + "PUT", "DELETE" ] }, + "path": + { "type": "array", + "items": + { "oneOf": + [ { "title": "PStatic", + "oneOf": + [ { "$ref": + "#/components/schemas/unistring" } ] }, + { "title": "PDynamic", + "type": "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", "name" ] }, + { "title": "PDynamicTail", + "type": "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "multiple" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", "name" ] } ] } }, + "description": + { "$ref": + "#/components/schemas/unistring" }, + "query": + { "type": "array", + "items": + { "type": "object", + "properties": + { "name": + { "$ref": + "#/components/schemas/unistring" }, + "description": + { "$ref": + "#/components/schemas/unistring" }, + "kind": + { "oneOf": + [ { "title": + "Single", + "type": + "object", + "properties": + { "single": + { "type": + "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", + "name" ] } }, + "required": + [ "single" ] }, + { "title": + "Optional", + "type": + "object", + "properties": + { "optional": + { "type": + "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", + "name" ] } }, + "required": + [ "optional" ] }, + { "title": "Flag", + "type": + "object", + "properties": + { "flag": + { "type": + "object", + "properties": + {} } }, + "required": + [ "flag" ] }, + { "title": + "Multi", + "type": + "object", + "properties": + { "multi": + { "type": + "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", + "name" ] } }, + "required": + [ "multi" ] } ] } }, + "required": + [ "name", "kind" ] } }, + "input": + { "type": "object", + "properties": + { "json_schema": {}, + "binary_schema": + { "type": "object", + "properties": + { "toplevel": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] }, + "fields": + { "type": "array", + "items": + { "type": + "object", + "properties": + { "description": + { "type": + "object", + "properties": + { "title": + { "$ref": + "#/components/schemas/unistring" }, + "description": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "title" ] }, + "encoding": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] } }, + "required": + [ "description", + "encoding" ] } } }, + "required": + [ "toplevel", + "fields" ] } }, + "required": + [ "json_schema", + "binary_schema" ] }, + "output": + { "type": "object", + "properties": + { "json_schema": {}, + "binary_schema": + { "type": "object", + "properties": + { "toplevel": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] }, + "fields": + { "type": "array", + "items": + { "type": + "object", + "properties": + { "description": + { "type": + "object", + "properties": + { "title": + { "$ref": + "#/components/schemas/unistring" }, + "description": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "title" ] }, + "encoding": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] } }, + "required": + [ "description", + "encoding" ] } } }, + "required": + [ "toplevel", + "fields" ] } }, + "required": + [ "json_schema", + "binary_schema" ] }, + "error": + { "type": "object", + "properties": + { "json_schema": {}, + "binary_schema": + { "type": "object", + "properties": + { "toplevel": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] }, + "fields": + { "type": "array", + "items": + { "type": + "object", + "properties": + { "description": + { "type": + "object", + "properties": + { "title": + { "$ref": + "#/components/schemas/unistring" }, + "description": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "title" ] }, + "encoding": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] } }, + "required": + [ "description", + "encoding" ] } } }, + "required": + [ "toplevel", + "fields" ] } }, + "required": + [ "json_schema", + "binary_schema" ] } }, + "required": + [ "meth", "path", "query", "output", + "error" ] }, + "patch_service": + { "type": "object", + "properties": + { "meth": + { "type": "string", + "enum": + [ "PATCH", "GET", "POST", + "PUT", "DELETE" ] }, + "path": + { "type": "array", + "items": + { "oneOf": + [ { "title": "PStatic", + "oneOf": + [ { "$ref": + "#/components/schemas/unistring" } ] }, + { "title": "PDynamic", + "type": "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", "name" ] }, + { "title": "PDynamicTail", + "type": "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "multiple" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", "name" ] } ] } }, + "description": + { "$ref": + "#/components/schemas/unistring" }, + "query": + { "type": "array", + "items": + { "type": "object", + "properties": + { "name": + { "$ref": + "#/components/schemas/unistring" }, + "description": + { "$ref": + "#/components/schemas/unistring" }, + "kind": + { "oneOf": + [ { "title": + "Single", + "type": + "object", + "properties": + { "single": + { "type": + "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", + "name" ] } }, + "required": + [ "single" ] }, + { "title": + "Optional", + "type": + "object", + "properties": + { "optional": + { "type": + "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", + "name" ] } }, + "required": + [ "optional" ] }, + { "title": "Flag", + "type": + "object", + "properties": + { "flag": + { "type": + "object", + "properties": + {} } }, + "required": + [ "flag" ] }, + { "title": + "Multi", + "type": + "object", + "properties": + { "multi": + { "type": + "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", + "name" ] } }, + "required": + [ "multi" ] } ] } }, + "required": + [ "name", "kind" ] } }, + "input": + { "type": "object", + "properties": + { "json_schema": {}, + "binary_schema": + { "type": "object", + "properties": + { "toplevel": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] }, + "fields": + { "type": "array", + "items": + { "type": + "object", + "properties": + { "description": + { "type": + "object", + "properties": + { "title": + { "$ref": + "#/components/schemas/unistring" }, + "description": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "title" ] }, + "encoding": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] } }, + "required": + [ "description", + "encoding" ] } } }, + "required": + [ "toplevel", + "fields" ] } }, + "required": + [ "json_schema", + "binary_schema" ] }, + "output": + { "type": "object", + "properties": + { "json_schema": {}, + "binary_schema": + { "type": "object", + "properties": + { "toplevel": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] }, + "fields": + { "type": "array", + "items": + { "type": + "object", + "properties": + { "description": + { "type": + "object", + "properties": + { "title": + { "$ref": + "#/components/schemas/unistring" }, + "description": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "title" ] }, + "encoding": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] } }, + "required": + [ "description", + "encoding" ] } } }, + "required": + [ "toplevel", + "fields" ] } }, + "required": + [ "json_schema", + "binary_schema" ] }, + "error": + { "type": "object", + "properties": + { "json_schema": {}, + "binary_schema": + { "type": "object", + "properties": + { "toplevel": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] }, + "fields": + { "type": "array", + "items": + { "type": + "object", + "properties": + { "description": + { "type": + "object", + "properties": + { "title": + { "$ref": + "#/components/schemas/unistring" }, + "description": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "title" ] }, + "encoding": + { "oneOf": + [ { "title": + "Obj", + "type": + "object", + "properties": + { "fields": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/schema.field" } } }, + "required": + [ "fields" ] }, + { "title": + "Cases", + "type": + "object", + "properties": + { "tag_size": + { "type": + "string", + "enum": + [ "Uint16", + "Uint8" ] }, + "kind": + { "$ref": + "#/components/schemas/schema.kind" }, + "cases": + { "type": + "array", + "items": + { "$ref": + "#/components/schemas/union case" } } }, + "required": + [ "tag_size", + "kind", + "cases" ] }, + { "title": + "Int_enum", + "type": + "object", + "properties": + { "size": + { "type": + "string", + "enum": + [ "Int16", + "Uint16", + "Int8", + "Uint8" ] }, + "cases": + { "type": + "array", + "items": + { "type": + "array", + "items": + { "oneOf": + [ { "type": + "integer", + "minimum": + -1073741824, + "maximum": + 1073741823 }, + { "$ref": + "#/components/schemas/unistring" } ] } } } }, + "required": + [ "size", + "cases" ] } ] } }, + "required": + [ "description", + "encoding" ] } } }, + "required": + [ "toplevel", + "fields" ] } }, + "required": + [ "json_schema", + "binary_schema" ] } }, + "required": + [ "meth", "path", "query", "output", + "error" ] }, + "subdirs": + { "oneOf": + [ { "title": "Suffixes", + "type": "object", + "properties": + { "suffixes": + { "type": "array", + "items": + { "type": "object", + "properties": + { "name": + { "$ref": + "#/components/schemas/unistring" }, + "tree": + { "$ref": + "#/components/schemas/service_tree" } }, + "required": + [ "name", "tree" ] } } }, + "required": [ "suffixes" ] }, + { "title": "Arg", "type": "object", + "properties": + { "dynamic_dispatch": + { "type": "object", + "properties": + { "arg": + { "type": "object", + "properties": + { "id": + { "type": + "string", + "enum": + [ "single" ] }, + "name": + { "$ref": + "#/components/schemas/unistring" }, + "descr": + { "$ref": + "#/components/schemas/unistring" } }, + "required": + [ "id", "name" ] }, + "tree": + { "$ref": + "#/components/schemas/service_tree" } }, + "required": + [ "arg", "tree" ] } }, + "required": [ "dynamic_dispatch" ] } ] } } } }, + "required": [ "static" ] }, + { "title": "Dynamic", "type": "object", + "properties": + { "dynamic": + { "nullable": true, + "oneOf": + [ { "title": "Some", + "oneOf": + [ { "$ref": + "#/components/schemas/unistring" } ] } ] } }, + "required": [ "dynamic" ] }, + { "title": "Empty", "type": "string", "enum": [ "empty" ] } ] }, + "state_hash": + { "title": + "The hash of the VM state of a smart contract rollup (Base58Check-encoded)", + "oneOf": [ { "$ref": "#/components/schemas/unistring" } ] }, + "union case": + { "type": "object", + "properties": + { "tag": + { "type": "integer", "minimum": -1073741824, + "maximum": 1073741823 }, + "fields": + { "type": "array", + "items": + { "$ref": "#/components/schemas/schema.field" } }, + "name": { "$ref": "#/components/schemas/unistring" } }, + "required": [ "tag", "fields" ] }, + "unistring": + { "title": "Universal string representation", + "description": + "Either a plain UTF8 string, or a sequence of bytes for strings that contain invalid byte sequences.", + "oneOf": + [ { "type": "string" }, + { "type": "object", + "properties": + { "invalid_utf8_string": + { "type": "array", + "items": + { "type": "integer", "minimum": 0, + "maximum": 255 } } }, + "required": [ "invalid_utf8_string" ] } ] } } } } diff --git a/manifest/main.ml b/manifest/main.ml index 66fe6814cfdfc86991e493889b2dfe4807de98ae..74c4724e33331f325721e257d4880e7d1d52b41d 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -4664,6 +4664,7 @@ module Protocol = Protocol ringo_lwt; injector |> if_some |> open_; octez_scoru_wasm; + octez_openapi; ] in let tx_rollup = diff --git a/opam/octez-sc-rollup-node-alpha.opam b/opam/octez-sc-rollup-node-alpha.opam index fc64c63c42b162349b84c997cd4446c0e8f7a138..f11b550eaf911050004b95f5355b8b31d68d238f 100644 --- a/opam/octez-sc-rollup-node-alpha.opam +++ b/opam/octez-sc-rollup-node-alpha.opam @@ -34,6 +34,7 @@ depends: [ "ringo-lwt" { >= "0.9" } "tezos-injector-alpha" "tezos-scoru-wasm" + "tezos-openapi" ] build: [ ["rm" "-r" "vendors"] diff --git a/src/lib_openapi/convert.ml b/src/lib_openapi/convert.ml index 0bd24de58f43738bc954915a6ff480fac8f93983..ac7c8e071801b959134ed405ab74f5afcfd7542e 100644 --- a/src/lib_openapi/convert.ml +++ b/src/lib_openapi/convert.ml @@ -359,12 +359,12 @@ let convert_endpoint (endpoint : Api.service Api.endpoint) : let env = merge_env_list [env_1; env_2; env_3; env_4; env_5] in (env, endpoint) -let convert_api version (endpoints : Api.service Api.endpoint list) : Openapi.t - = +let convert_api ?(title = "Tezos RPC") ?(description = "Tezos client RPC API.") + version (endpoints : Api.service Api.endpoint list) : Openapi.t = let envs, endpoints = List.map convert_endpoint endpoints |> List.split in Openapi.make - ~title:"Tezos RPC" - ~description:"Tezos client RPC API." + ~title + ~description ~version ~definitions:(String_map.bindings (merge_env_list envs)) endpoints diff --git a/src/proto_alpha/bin_sc_rollup_node/RPC_server.ml b/src/proto_alpha/bin_sc_rollup_node/RPC_server.ml index 0236d696526f69cde87582bd25cf8f2c0186dfcf..4fec9c537c50bfeab1ec66ed4490ba29de0a65dc 100644 --- a/src/proto_alpha/bin_sc_rollup_node/RPC_server.ml +++ b/src/proto_alpha/bin_sc_rollup_node/RPC_server.ml @@ -119,16 +119,30 @@ module type PARAM = sig val context_of_prefix : Node_context.t -> prefix -> context tzresult Lwt.t end +module type DIRECTORY = sig + val build_directory : Node_context.t -> unit RPC_directory.t + + val build_dummy_directory : unit -> unit RPC_directory.t +end + module Make_directory (S : PARAM) = struct open S let directory : context tzresult RPC_directory.t ref = ref RPC_directory.empty + (** This directory is used to generate the API description without handlers. *) + let dummy_directory : prefix RPC_directory.t ref = ref RPC_directory.empty + let register service f = directory := RPC_directory.register !directory service f + let register_dummy service = + dummy_directory := + RPC_directory.register !dummy_directory service (fun _ -> assert false) + let register0 service f = let open Lwt_result_syntax in + register_dummy (RPC_service.subst0 service) ; register (RPC_service.subst0 service) @@ fun ctxt query input -> let*? ctxt = ctxt in f ctxt query input @@ -137,8 +151,20 @@ module Make_directory (S : PARAM) = struct !directory |> RPC_directory.map (fun prefix -> context_of_prefix node_ctxt prefix) |> RPC_directory.prefix prefix + + let build_dummy_directory () = !dummy_directory |> RPC_directory.prefix prefix end +module Root_directory = Make_directory (struct + type prefix = unit + + let prefix = RPC_path.root + + type context = Node_context.t + + let context_of_prefix node_ctxt () = return node_ctxt +end) + module Global_directory = Make_directory (struct include Sc_rollup_services.Global @@ -173,6 +199,14 @@ module Block_directory = Make_directory (struct (node_ctxt, block) end) +let directory_modules = + [ + (module Root_directory : DIRECTORY); + (module Global_directory : DIRECTORY); + (module Local_directory : DIRECTORY); + (module Block_directory : DIRECTORY); + ] + module Common = struct let () = Block_directory.register0 Sc_rollup_services.Global.Block.num_messages @@ -333,14 +367,54 @@ module Make (PVM : Pvm.S) = struct @@ fun node_ctxt output () -> Outbox.proof_of_output node_ctxt output let register node_ctxt = - List.fold_left - (fun dir f -> RPC_directory.merge dir (f node_ctxt)) - RPC_directory.empty - [ - Global_directory.build_directory; - Local_directory.build_directory; - Block_directory.build_directory; - ] + let dir = + List.fold_left + (fun dir (module D : DIRECTORY) -> + RPC_directory.merge dir (D.build_directory node_ctxt)) + RPC_directory.empty + directory_modules + in + RPC_directory.register_describe_directory_service + dir + RPC_service.description_service + + let description_directory () = + let dir = + List.fold_left + (fun dir (module D : DIRECTORY) -> + RPC_directory.merge dir (D.build_dummy_directory ())) + RPC_directory.empty + directory_modules + in + RPC_directory.register_describe_directory_service + dir + RPC_service.description_service + + let generate_openapi () = + let open Lwt_syntax in + let dir = description_directory () in + let+ descr = RPC_directory.describe_directory ~recurse:true ~arg:() dir in + let json_api = + Data_encoding.Json.construct + RPC_encoding.description_answer_encoding + descr + in + let open Tezos_openapi in + json_api + |> Json.annotate ~origin:"description" + |> Api.parse_tree |> Api.parse_services |> Api.flatten + |> Convert.convert_api + ~title:"SC rollup node RPC" + ~description:"Smart contracts rollup node RPC API" + Tezos_version.Bin_version.version_string + |> Openapi.to_json + + let () = + Root_directory.register0 Sc_rollup_services.openapi + @@ fun _node_ctxt () () -> + let open Lwt_result_syntax in + let*! json_openapi = generate_openapi () in + return json_openapi let start node_ctxt configuration = let open Lwt_result_syntax in diff --git a/src/proto_alpha/bin_sc_rollup_node/RPC_server.mli b/src/proto_alpha/bin_sc_rollup_node/RPC_server.mli index e836b81e18134d5be945c6046b07ec254382fa55..a70e4f5a275268f4dfed9eb68e16a8a0f987603d 100644 --- a/src/proto_alpha/bin_sc_rollup_node/RPC_server.mli +++ b/src/proto_alpha/bin_sc_rollup_node/RPC_server.mli @@ -36,4 +36,7 @@ module Make (PVM : Pvm.S) : sig (** Shutdown a running RPC server. When this function is called, the rollup node will stop listening to incoming requests. *) val shutdown : RPC_server.server -> unit Lwt.t + + (** Generate the OpenAPI JSON specification for the RPC server. *) + val generate_openapi : unit -> Ezjsonm.value Lwt.t end diff --git a/src/proto_alpha/bin_sc_rollup_node/dune b/src/proto_alpha/bin_sc_rollup_node/dune index cc313ba82cd2af5d78546bff9834540ecc41980a..773071744e34f031e4d924e2bdf654e261afd0b4 100644 --- a/src/proto_alpha/bin_sc_rollup_node/dune +++ b/src/proto_alpha/bin_sc_rollup_node/dune @@ -34,7 +34,8 @@ ringo ringo-lwt tezos-injector-alpha - tezos-scoru-wasm) + tezos-scoru-wasm + tezos-openapi) (link_flags (:standard) (:include %{workspace_root}/static-link-flags.sexp)) diff --git a/src/proto_alpha/bin_sc_rollup_node/main_sc_rollup_node_alpha.ml b/src/proto_alpha/bin_sc_rollup_node/main_sc_rollup_node_alpha.ml index acd01d233166c4857b4ba9ae707ad8bedab89ab0..ffba1c244cde89737afaa6e375356c9fee2772fd 100644 --- a/src/proto_alpha/bin_sc_rollup_node/main_sc_rollup_node_alpha.ml +++ b/src/proto_alpha/bin_sc_rollup_node/main_sc_rollup_node_alpha.ml @@ -308,10 +308,29 @@ let import_command = cctxt#message "%a" Protocol.Alpha_context.Sc_rollup.Input_hash.pp hash >>= return) +let openapi_command = + let open Clic in + command + ~group + ~desc:"Generate OpenAPI specification." + (args1 pvm_name_arg) + (prefixes ["generate"; "openapi"] @@ stop) + (fun pvm_name cctxt -> + let open Lwt_result_syntax in + let*? pvm = + match Protocol.Alpha_context.Sc_rollup.Kind.of_name pvm_name with + | Some k -> Ok (Components.pvm_of_kind k) + | None -> error_with "Invalid pvm name: %S" pvm_name + in + let module RPC = RPC_server.Make ((val pvm)) in + let*! openapi_json = RPC.generate_openapi () in + let*! () = cctxt#message "%a" Data_encoding.Json.pp openapi_json in + return_unit) + let sc_rollup_commands () = List.map (Clic.map_command (new Protocol_client_context.wrap_full)) - [config_init_command; run_command; import_command] + [config_init_command; run_command; import_command; openapi_command] let select_commands _ _ = return (sc_rollup_commands () @ Client_helpers_commands.commands ()) diff --git a/src/proto_alpha/bin_sc_rollup_node/openapi/generate.sh b/src/proto_alpha/bin_sc_rollup_node/openapi/generate.sh new file mode 100755 index 0000000000000000000000000000000000000000..012b4b00da2545405d8e762a462a31a3b8192281 --- /dev/null +++ b/src/proto_alpha/bin_sc_rollup_node/openapi/generate.sh @@ -0,0 +1,89 @@ +#!/bin/sh + +set -x + +# This script launches a sandbox node, activates Protocol, starts rollup node +# and gets the RPC descriptions as JSON, and converts this JSON into an OpenAPI +# specification. + +# Ensure we are running from the root directory of the Tezos repository. +cd "$(dirname "$0")"/../../../.. || exit + +# Tezos binaries. +tezos_node=./tezos-node +tezos_client=./tezos-client +tezos_scoru_node=./tezos-sc-rollup-node-alpha + +# Protocol configuration. +protocol_hash=ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK +protocol_parameters=src/proto_alpha/parameters/sandbox-parameters.json + +# Secret key to activate the protocol. +activator_secret_key="unencrypted:edsk31vznjHSSpGExDMHYASz45VZqXN4DPxvsa4hAyY8dHM28cZzp6" +bootstrap1_secret_key="unencrypted:edsk3gUfUPyBSfrS9CCgmCiQsTCHGkviBDusMxDJstFtojtc1zcpsh" + +# RPC port of rollup node. +sc_rpc_port=9999 + +# Temporary files. +tmp=openapi-tmp +data_dir=$tmp/tezos-sandbox +client_dir=$tmp/tezos-client +sc_data_dir=$tmp/tezos-client +params=$tmp/params.json + +# Generated files. +sc_openapi_json=docs/api/sc-rollup-node-rpc-openapi.json + +# Get version = git revision. +version=$(git show -s --pretty=format:%H | head -c 8) + +# Start a sandbox node. +$tezos_node config init --data-dir $data_dir \ + --network sandbox \ + --expected-pow 0 \ + --rpc-addr localhost:8732 \ + --no-bootstrap-peer \ + --synchronisation-threshold 0 +$tezos_node identity generate --data-dir $data_dir +$tezos_node run --data-dir $data_dir & +node_pid="$!" + +# Wait for the node to be ready. +sleep 1 + +# Activate the protocol. +mkdir $client_dir +$tezos_client --base-dir $client_dir import secret key activator $activator_secret_key +$tezos_client --base-dir $client_dir import secret key bootstrap1 $bootstrap1_secret_key +cat $protocol_parameters | jq '.sc_rollup_enable = true' > $params +$tezos_client --base-dir $client_dir activate protocol $protocol_hash \ + with fitness 1 \ + and key activator \ + and parameters $params \ + --timestamp "$(TZ='AAA+1' date +%FT%TZ)" + +# Wait a bit again... +sleep 1 + +# Originate a sc rollup. +sc_addr=$($tezos_client -w none --base-dir $client_dir originate sc rollup from bootstrap1 of kind arith of type unit booting with '""' --burn-cap 10 | awk '/Address: / {print $NF}') +$tezos_client -w none --base-dir $client_dir bake for bootstrap1 --minimal-timestamp + +# Start the sc rollup node. +$tezos_scoru_node --base-dir $client_dir init observer config for $sc_addr with operators bootstrap1 --data-dir $sc_data_dir --rpc-port $sc_rpc_port +$tezos_scoru_node --base-dir $client_dir run --data-dir $sc_data_dir & +sc_node_pid="$!" + +# Wait for the sc rollup node to be ready. +sleep 1 + +# Get the RPC openapi. +curl -v "http://localhost:$sc_rpc_port/openapi" > $sc_openapi_json + +# Kill the nodes. +kill -9 "$node_pid" +kill -9 "$sc_node_pid" + +echo "Generated OpenAPI specification: $sc_openapi_json" +echo "You can now clean up with: rm -rf $tmp" diff --git a/src/proto_alpha/lib_sc_rollup/sc_rollup_services.ml b/src/proto_alpha/lib_sc_rollup/sc_rollup_services.ml index a006a9d9661bd1271886596ea4d080fb4493cfb3..a266a2812a13c44ee6a5f284f76a72447ad38869 100644 --- a/src/proto_alpha/lib_sc_rollup/sc_rollup_services.ml +++ b/src/proto_alpha/lib_sc_rollup/sc_rollup_services.ml @@ -383,3 +383,10 @@ module Local = struct ~output:(Data_encoding.option Encodings.commitment_with_hash_and_level) (path / "last_published_commitment") end + +let openapi = + RPC_service.get_service + ~description:"OpenAPI specification of RPCs for rollup node" + ~query:RPC_query.empty + ~output:Data_encoding.json + RPC_path.(root / "openapi")