{ "$id": "common-http", "description": "Definitions used by method definitions in pronghorn.json", "definitions": { "commonFieldNames": { "enum": [ "_id" ] }, "commonFields": { "type": "object", "properties": { "_id": { "$ref": "common#/definitions/ObjectIdLikeString" } } }, "commonFieldsRequired": { "type": "object", "required": [ "_id" ] }, "document-identifier": { "$ref": "common#/definitions/ObjectId" }, "account-identifier": { "oneOf": [ { "const": "Pronghorn" }, { "$ref": "#/definitions/document-identifier" } ] }, "dereferenced-account": { "type": "object", "properties": { "_id": { "$ref": "common-http#/definitions/account-identifier" }, "username": { "oneOf": [ { "type": "null" }, { "type": "string" } ] }, "provenance": { "type": "string" }, "firstname": { "type": "string" } }, "required": [ "_id", "username", "provenance", "firstname" ], "additionalProperties": false }, "search-parameter-equals": { "description": "This parameter requires the results returned by the search to have the exact specified value for the given field(s)", "type": "object", "patternProperties": { ".*": { "type": "string" } }, "examples": [ { "name": "Name to search for" } ] }, "search-parameter-starts-with": { "description": "This parameter requires the results returned by the search to have the specified prefix for the given field(s). This parameter may only be applied to string values.", "type": "object", "patternProperties": { ".*": { "type": "string" } }, "examples": [ { "name": "Prefix to search for" } ] }, "search-parameter-lt": { "description": "This parameter requires the results returned by the search to have a value less than the specified value for the given field(s).", "type": "object", "examples": [ { "created": "2022-03-01T12:00:00.000Z" }, { "lastUpdated": "2022-03-01T12:00:00.000Z" } ] }, "search-parameter-lte": { "description": "This parameter requires the results returned by the search to have a value less or equal to than the specified value for the given field(s).", "type": "object", "examples": [ { "created": "2022-03-01T12:00:00.000Z" }, { "lastUpdated": "2022-03-01T12:00:00.000Z" } ] }, "search-parameter-gt": { "description": "This parameter requires the results returned by the search to have a value greater than the specified value for the given field(s).", "type": "object", "examples": [ { "created": "2022-03-01T12:00:00.000Z" }, { "lastUpdated": "2022-03-01T12:00:00.000Z" } ] }, "search-parameter-gte": { "description": "This parameter requires the results returned by the search to have a value greater than or equal to the specified value for the given field(s).", "type": "object", "examples": [ { "created": "2022-03-01T12:00:00.000Z" }, { "lastUpdated": "2022-03-01T12:00:00.000Z" } ] }, "search-parameter-in": { "description": "This parameter specifies a comma-delimited list of values to search for in the given field(s).", "type": "object", "examples": [ { "stateId": "1234,53fe,0000" }, { "name": "name1,name2,name3" } ] }, "search-parameter-sort": { "description": "This parameter specifies the field to sort the search results over.", "type": "string", "examples": [ "name", "created" ] }, "search-parameter-order": { "description": "This parameter specifies the direction to sort the search results over.", "enum": [ "asc", "desc" ] }, "search-parameter-skip": { "description": "This parameter specifies where to start the returned page of search results.", "type": "string" }, "search-parameter-limit": { "description": "This parameter specifies how many items to return in the search results.", "type": "string" }, "sort-parameters": { "type": "object", "properties": { "sort": { "$ref": "common-http#/definitions/search-parameter-sort" }, "order": { "$ref": "common-http#/definitions/search-parameter-order" } } }, "pagination-parameters": { "type": "object", "properties": { "skip": { "$ref": "common-http#/definitions/search-parameter-skip" }, "limit": { "$ref": "common-http#/definitions/search-parameter-limit" } } }, "pagination-metadata": { "description": "Properties describing search result pagination", "type": "object", "properties": { "skip": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "nextPageSkip": { "type": "integer" }, "previousPageSkip": { "type": "integer" }, "currentPageSize": { "type": "integer" } } }, "response": { "oneOf": [ { "$ref": "#/definitions/success-response" }, { "$ref": "#/definitions/failure-response" } ] }, "success-response": { "description": "A success response from an API method", "type": "object", "additionalProperties": false, "required": [ "message", "data", "metadata" ], "properties": { "message": { "description": "A human-readable message summarizing the result of the operation", "type": "string", "examples": [ "Successfully created the requested item", "Successfully imported 3 of 4 documents", "Successfully retrieved search results" ] }, "data": { "const": "null", "description": "Any successfully retrieved information related to the request." }, "metadata": { "description": "Any structured, wordy or machine-readable information related to the result of the operation. For success responses, this may contain information like pagination values from a search operation.", "type": "object", "additionalProperties": true } } }, "failure-response": { "description": "A failure response from an API method", "type": "object", "additionalProperties": false, "required": [ "message", "data", "metadata" ], "properties": { "message": { "description": "A human-readable message summarizing the result of the operation", "type": "string", "examples": [ "A server error occurred while processing this request" ] }, "data": { "const": "null", "description": "Any successfully retrieved information related to the request. For error responses, this is always 'null'." }, "metadata": { "description": "Any structured, wordy or machine-readable information related to the result of the operation. For error responses, this will always at least contain an 'errors' array, even if it is empty.", "type": "object", "properties": { "errors": { "type": "array" } }, "additionalProperties": true } } } } }