{ "$schema": "http://json-schema.org/draft-07/schema", "type": "object", "title": "Hyperledger Fabric Contract Definition JSON Schema", "required": [ "info", "contracts" ], "properties": { "info": { "$ref": "#/definitions/info" }, "contracts": { "type": "object", "patternProperties": { "^.*$": { "$ref": "#/definitions/contract" } } }, "components": { "$ref": "#/definitions/components" } }, "definitions": { "info": { "type": "object", "description": "General information about the API.", "required": [ "version", "title" ], "properties": { "title": { "type": "string", "description": "A unique and precise title of the API." }, "version": { "type": "string", "description": "A semantic version number of the API." }, "description": { "type": "string", "description": "A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed." }, "termsOfService": { "type": "string", "description": "The terms of service for the API." }, "contact": { "$ref": "#/definitions/contact" }, "license": { "$ref": "#/definitions/license" } } }, "contact": { "type": "object", "description": "Contact information for the owners of the API.", "properties": { "name": { "type": "string", "description": "The identifying name of the contact person/organization." }, "url": { "type": "string", "description": "The URL pointing to the contact information.", "format": "uri" }, "email": { "type": "string", "description": "The email address of the contact person/organization.", "format": "email" } } }, "license": { "type": "object", "required": [ "name" ], "additionalProperties": false, "properties": { "name": { "type": "string", "description": "The name of the license type. It's encouraged to use an OSI compatible license." }, "url": { "type": "string", "description": "The URL pointing to the license.", "format": "uri" } } }, "contract": { "type": "object", "description": "", "required": [ "name", "transactions" ], "properties": { "default": { "type": "boolean" }, "info": { "$ref": "#/definitions/info" }, "name": { "type": "string", "description": "A unique and precise title of the API." }, "transactions": { "type": "array", "items": { "$ref": "#/definitions/transaction" } } } }, "objecttype": { "type": "object", "description": "A complex type used in a domain", "required": [ "$id", "properties" ], "properties": { "properties": { "^.*$": { "$ref": "#/definitions/schema" } }, "required": { "$ref": "http://json-schema.org/draft-07/schema#/definitions/stringArray" } } }, "parametersList": { "type": "array", "description": "The parameters needed to send a valid API call.", "additionalItems": false, "items": { "oneOf": [ { "$ref": "#/definitions/parameter" }, { "$ref": "#/definitions/jsonReference" } ] }, "uniqueItems": true }, "transaction": { "type": "object", "description": "single transaction specification", "required": [ "name" ], "properties": { "name": { "type": "string", "description": "name of the transaction " }, "tag": { "type": "array", "items": { "type": "string", "description": "free format tags" } }, "parameters": { "$ref": "#/definitions/parametersList" }, "returns": { "$ref": "#/definitions/schema" } } }, "parameter": { "type": "object", "required": [ "name", "schema" ], "properties": { "description": { "type": "string", "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." }, "name": { "type": "string", "description": "The name of the parameter." }, "required": { "type": "boolean", "description": "Determines whether or not this parameter is required or optional.", "default": false }, "schema": { "$ref": "#/definitions/schema" } }, "additionalProperties": false }, "jsonReference": { "type": "object", "required": [ "$ref" ], "additionalProperties": false, "properties": { "$ref": { "type": "string" } } }, "schema": { "type": "object", "description": "A deterministic version of a JSON Schema object.", "properties": { "$ref": { "type": "string" }, "format": { "type": "string" }, "title": { "$ref": "http://json-schema.org/draft-07/schema#/properties/title" }, "description": { "$ref": "http://json-schema.org/draft-07/schema#/properties/description" }, "default": { "$ref": "http://json-schema.org/draft-07/schema#/properties/default" }, "multipleOf": { "$ref": "http://json-schema.org/draft-07/schema#/properties/multipleOf" }, "maximum": { "$ref": "http://json-schema.org/draft-07/schema#/properties/maximum" }, "exclusiveMaximum": { "$ref": "http://json-schema.org/draft-07/schema#/properties/exclusiveMaximum" }, "minimum": { "$ref": "http://json-schema.org/draft-07/schema#/properties/minimum" }, "exclusiveMinimum": { "$ref": "http://json-schema.org/draft-07/schema#/properties/exclusiveMinimum" }, "maxLength": { "$ref": "http://json-schema.org/draft-07/schema#/definitions/nonNegativeInteger" }, "minLength": { "$ref": "http://json-schema.org/draft-07/schema#/definitions/nonNegativeIntegerDefault0" }, "pattern": { "$ref": "http://json-schema.org/draft-07/schema#/properties/pattern" }, "maxItems": { "$ref": "http://json-schema.org/draft-07/schema#/definitions/nonNegativeInteger" }, "minItems": { "$ref": "http://json-schema.org/draft-07/schema#/definitions/nonNegativeIntegerDefault0" }, "uniqueItems": { "$ref": "http://json-schema.org/draft-07/schema#/properties/uniqueItems" }, "maxProperties": { "$ref": "http://json-schema.org/draft-07/schema#/definitions/nonNegativeInteger" }, "minProperties": { "$ref": "http://json-schema.org/draft-07/schema#/definitions/nonNegativeIntegerDefault0" }, "required": { "$ref": "http://json-schema.org/draft-07/schema#/definitions/stringArray" }, "enum": { "$ref": "http://json-schema.org/draft-07/schema#/properties/enum" }, "additionalProperties": { "anyOf": [ { "$ref": "#/definitions/schema" }, { "type": "boolean" } ], "default": {} }, "type": { "$ref": "http://json-schema.org/draft-07/schema#/properties/type" }, "items": { "anyOf": [ { "$ref": "#/definitions/schema" }, { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/schema" } } ], "default": {} }, "allOf": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/schema" } }, "properties": { "type": "object", "additionalProperties": { "$ref": "#/definitions/schema" }, "default": {} }, "discriminator": { "type": "string" }, "readOnly": { "type": "boolean", "default": false }, "example": {} }, "additionalProperties": false }, "components": { "type": "object", "properties": { "schemas": { "type": "object", "patternProperties": { "^.*$": { "$ref": "#/definitions/objecttype" } } } } } } }