{
  "openapi": "3.0.2",
  "servers": [{ "url": "https://apis.<domain>" }],
  "info": {
    "version": "1.4.0",
    "title": "connhex-resources",
    "description": "Connhex Resources APIs are auto-generated from custom **Connhex JSON schemas** defined by the Connhex administrator.\nEach schema defines the attributes and the relationships of a given resource.\n\nHere, as an example, we present a set of APIs automatically generated from the following **Connhex JSON Schemas**:\n\n#### TypeOneResource\n```json\n{\n  \"$id\": \"https://connhex.com/type-one-resource.schema.json\",\n  \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"serial\": {\n      \"type\": \"string\",\n      \"title\": \"Serial\"\n    },\n    \"typeTwoResources\": {\n      \"type\": \"array\",\n      \"title\": \"TypeTwoResources\",\n      \"items\": {\n        \"type\": \"string\",\n        \"connhex\": {\n          \"id\": \"typeTwoResource\"\n        }\n      }\n    },\n    \"createdAt\": {\n      \"type\": \"string\",\n      \"title\": \"Creation Date\",\n      \"format\": \"date-time\"\n    }\n  }\n}\n```\n\n#### TypeTwoResource\n```json\n{\n  \"$id\": \"https://connhex.com/type-two-resource.schema.json\",\n  \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"name\": {\n      \"type\": \"string\",\n      \"title\": \"Name\"\n    },\n    \"typeOneResource\": {\n      \"type\": \"array\",\n      \"title\": \"TypeOneResource\",\n      \"connhex\": {\n        \"id\": \"typeOneResource\"\n      }\n    },\n    \"createdAt\": {\n      \"type\": \"string\",\n      \"title\": \"Creation Date\",\n      \"format\": \"date-time\"\n    }\n  }\n}\n```\n\n\nFor further details on how Connhex Resources works please check [here](https://connhex.com/docs/resources/intro).\n\n#### Tenants\n\nEvery resource schema must include a `tenants` field (`string[]`). This field is **required by the platform** to support multi-tenancy:\n\n- **On read / list**: results are automatically scoped to resources belonging to the caller's authorized tenants.\n- **On create**: if `tenants` is not provided in the request body, the resource is automatically assigned to the caller's authorized tenants. If provided, the value is intersected with the caller's authorized tenants.\n- **On update**: the `tenants` field can be updated to reassign a resource to different tenants (within the caller's authorized set).\n"
  },
  "paths": {
    "/resources/typeOneResources/": {
      "get": {
        "tags": ["TypeOneResources"],
        "description": "List typeOneResources.\n\nRequired Permission:\n\n - Resource: ```resource:typeOneResources```\n\n - Action: ```resource:typeOneResources:list```",
        "operationId": "List typeOneResources",
        "parameters": [
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/fields"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/filter"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/include"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/page[limit]"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/page[offset]"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TypeOneResource"
                      }
                    },
                    "included": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "$ref": "#/components/schemas/resource"
                      }
                    },
                    "links": {
                      "description": "Link members related to primary data",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/links"
                        },
                        {
                          "$ref": "#/components/schemas/pagination"
                        }
                      ]
                    },
                    "jsonapi": {
                      "$ref": "#/components/schemas/jsonapi"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "not authorized",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["TypeOneResources"],
        "description": "Create typeOneResources.\n\nRequired Permission:\n\n - Resource: ```resource:typeOneResources```\n\n - Action: ```resource:typeOneResources:create```",
        "operationId": "Create typeOneResources",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/vnd.api+json": {
              "schema": {
                "required": ["data"],
                "properties": {
                  "data": {
                    "type": "object",
                    "required": ["type"],
                    "additionalProperties": false,
                    "properties": {
                      "type": {
                        "$ref": "#/components/schemas/type"
                      },
                      "id": {
                        "$ref": "#/components/schemas/id"
                      },
                      "links": {
                        "type": "object",
                        "properties": {
                          "self": {
                            "$ref": "#/components/schemas/link"
                          }
                        }
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "createdAt": {
                            "type": "string",
                            "format": "date"
                          },
                          "serial": {
                            "type": "string"
                          },
                          "tenants": {
                            "type": "array",
                            "items": { "type": "string" },
                            "description": "Tenant IDs to assign to this resource. Filtered to the caller's authorized tenants. Defaults to caller's tenants if omitted."
                          }
                        },
                        "required": ["serial"]
                      },
                      "relationships": {
                        "type": "object",
                        "properties": {
                          "typeTwoResources": {
                            "$ref": "#/components/schemas/reltomany"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "[Created](https://jsonapi.org/format/#crud-creating-responses-201). Assigned `id` and/or any other changes are in this response.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TypeOneResource"
                    },
                    "included": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "$ref": "#/components/schemas/resource"
                      }
                    },
                    "links": {
                      "description": "Link members related to primary data",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/links"
                        },
                        {
                          "$ref": "#/components/schemas/pagination"
                        }
                      ]
                    },
                    "jsonapi": {
                      "$ref": "#/components/schemas/jsonapi"
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "Accepted for [asynchronous processing](https://jsonapi.org/recommendations/#asynchronous-processing)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/datum"
                }
              }
            }
          },
          "204": {
            "description": "[Created](https://jsonapi.org/format/#crud-creating-responses-204) with the supplied `id`. No other changes from what was POSTed."
          },
          "401": {
            "description": "not authorized",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "403": {
            "description": "[Forbidden](https://jsonapi.org/format/#crud-creating-responses-403)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "404": {
            "description": "[Related resource does not exist](https://jsonapi.org/format/#crud-creating-responses-404)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "409": {
            "description": "[Conflict](https://jsonapi.org/format/#crud-creating-responses-409)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          }
        }
      }
    },
    "/resources/typeOneResources/{ids}/": {
      "get": {
        "tags": ["TypeOneResources"],
        "description": "Get typeOneResource.\n\nRequired Permission:\n\n - Resource: ```resource:typeOneResources:{id0}, resource:typeOneResources:{id1}, ...```\n\n - Action: ```resource:typeOneResources:get```",
        "operationId": "Read typeOneResource",
        "parameters": [
          {
            "name": "ids",
            "in": "path",
            "required": true,
            "description": "Comma-separated globally unique ids (UUID4)",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/include"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/fields"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TypeOneResource"
                    },
                    "included": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "$ref": "#/components/schemas/resource"
                      }
                    },
                    "links": {
                      "description": "Link members related to primary data",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/links"
                        },
                        {
                          "$ref": "#/components/schemas/pagination"
                        }
                      ]
                    },
                    "jsonapi": {
                      "$ref": "#/components/schemas/jsonapi"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "not authorized",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": ["TypeOneResources"],
        "description": "Update typeOneResource.\n\nRequired Permission:\n\n - Resource: ```resource:typeOneResources:{id0}, resource:typeOneResources:{id1}, ...```\n\n - Action: ```resource:typeOneResources:update```",
        "operationId": "Update typeOneResource",
        "parameters": [
          {
            "name": "ids",
            "in": "path",
            "required": true,
            "description": "Comma-separated globally unique ids (UUID4)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/vnd.api+json": {
              "schema": {
                "required": ["data"],
                "properties": {
                  "data": {
                    "type": "object",
                    "required": ["type", "id"],
                    "additionalProperties": false,
                    "properties": {
                      "type": {
                        "$ref": "#/components/schemas/type"
                      },
                      "id": {
                        "$ref": "#/components/schemas/id"
                      },
                      "links": {
                        "type": "object",
                        "properties": {
                          "self": {
                            "$ref": "#/components/schemas/link"
                          }
                        }
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "createdAt": {
                            "type": "string",
                            "format": "date"
                          },
                          "serial": {
                            "type": "string"
                          },
                          "tenants": {
                            "type": "array",
                            "items": { "type": "string" },
                            "description": "Tenant IDs to assign to this resource. Filtered to the caller's authorized tenants. Defaults to caller's tenants if omitted."
                          }
                        }
                      },
                      "relationships": {
                        "type": "object",
                        "properties": {
                          "typeTwoResources": {
                            "$ref": "#/components/schemas/reltomany"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TypeOneResource"
                    },
                    "included": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "$ref": "#/components/schemas/resource"
                      }
                    },
                    "links": {
                      "description": "Link members related to primary data",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/links"
                        },
                        {
                          "$ref": "#/components/schemas/pagination"
                        }
                      ]
                    },
                    "jsonapi": {
                      "$ref": "#/components/schemas/jsonapi"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "not authorized",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "403": {
            "description": "[Forbidden](https://jsonapi.org/format/#crud-updating-responses-403)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "404": {
            "description": "[Related resource does not exist](https://jsonapi.org/format/#crud-updating-responses-404)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "409": {
            "description": "[Conflict]([Conflict](https://jsonapi.org/format/#crud-updating-responses-409)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": ["TypeOneResources"],
        "description": "Delete typeOneResource.\n\nRequired Permission:\n\n - Resource: ```resource:typeOneResources:{id0}, resource:typeOneResources:{id1}, ...```\n\n - Action: ```resource:typeOneResources:delete```",
        "operationId": "Delete typeOneResource",
        "parameters": [
          {
            "name": "ids",
            "in": "path",
            "required": true,
            "description": "Comma-separated globally unique ids (UUID4)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "[OK](https://jsonapi.org/format/#crud-deleting-responses-200)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/onlymeta"
                }
              }
            }
          },
          "202": {
            "description": "Accepted for [asynchronous processing](https://jsonapi.org/recommendations/#asynchronous-processing)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/datum"
                }
              }
            }
          },
          "204": {
            "description": "[no content](https://jsonapi.org/format/#crud-deleting-responses-204)"
          },
          "401": {
            "description": "not authorized",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "404": {
            "description": "[Resource does not exist](https://jsonapi.org/format/#crud-deleting-responses-404)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          }
        }
      }
    },
    "/resources/typeTwoResources/": {
      "get": {
        "tags": ["TypeTwoResources"],
        "description": "List typeTwoResources.\n\nRequired Permission:\n\n - Resource: ```resource:typeTwoResources```\n\n - Action: ```resource:typeTwoResources:list```",
        "operationId": "List typeTwoResources",
        "parameters": [
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/include"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/fields"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/sort"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/page[limit]"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/page[offset]"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/filter"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TypeTwoResource"
                      }
                    },
                    "included": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "$ref": "#/components/schemas/resource"
                      }
                    },
                    "links": {
                      "description": "Link members related to primary data",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/links"
                        },
                        {
                          "$ref": "#/components/schemas/pagination"
                        }
                      ]
                    },
                    "jsonapi": {
                      "$ref": "#/components/schemas/jsonapi"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "not authorized",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["TypeTwoResources"],
        "description": "Create typeTwoResources.\n\nRequired Permission:\n\n - Resource: ```resource:typeTwoResources```\n\n - Action: ```resource:typeTwoResources:create```",
        "operationId": "Create typeTwoResources",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/vnd.api+json": {
              "schema": {
                "required": ["data"],
                "properties": {
                  "data": {
                    "type": "object",
                    "required": ["type"],
                    "additionalProperties": false,
                    "properties": {
                      "type": {
                        "$ref": "#/components/schemas/type"
                      },
                      "id": {
                        "$ref": "#/components/schemas/id"
                      },
                      "links": {
                        "type": "object",
                        "properties": {
                          "self": {
                            "$ref": "#/components/schemas/link"
                          }
                        }
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "createdAt": {
                            "type": "string",
                            "format": "date"
                          },
                          "name": {
                            "type": "string"
                          },
                          "tenants": {
                            "type": "array",
                            "items": { "type": "string" },
                            "description": "Tenant IDs to assign to this resource. Filtered to the caller's authorized tenants. Defaults to caller's tenants if omitted."
                          }
                        },
                        "required": ["name"]
                      },
                      "relationships": {
                        "type": "object",
                        "properties": {
                          "typeOneResource": {
                            "$ref": "#/components/schemas/reltoone"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "[Created](https://jsonapi.org/format/#crud-creating-responses-201). Assigned `id` and/or any other changes are in this response.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TypeTwoResource"
                    },
                    "included": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "$ref": "#/components/schemas/resource"
                      }
                    },
                    "links": {
                      "description": "Link members related to primary data",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/links"
                        },
                        {
                          "$ref": "#/components/schemas/pagination"
                        }
                      ]
                    },
                    "jsonapi": {
                      "$ref": "#/components/schemas/jsonapi"
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "Accepted for [asynchronous processing](https://jsonapi.org/recommendations/#asynchronous-processing)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/datum"
                }
              }
            }
          },
          "204": {
            "description": "[Created](https://jsonapi.org/format/#crud-creating-responses-204) with the supplied `id`. No other changes from what was POSTed."
          },
          "401": {
            "description": "not authorized",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "403": {
            "description": "[Forbidden](https://jsonapi.org/format/#crud-creating-responses-403)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "404": {
            "description": "[Related resource does not exist](https://jsonapi.org/format/#crud-creating-responses-404)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "409": {
            "description": "[Conflict](https://jsonapi.org/format/#crud-creating-responses-409)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          }
        }
      }
    },
    "/resources/typeTwoResources/{ids}/": {
      "get": {
        "tags": ["TypeTwoResources"],
        "description": "Get typeTwoResource.\n\nRequired Permission:\n\n - Resource: ```resource:typeTwoResources:{id0}, resource:typeTwoResources:{id1}, ...```\n\n - Action: ```resource:typeTwoResources:get```",
        "operationId": "Read typeTwoResource",
        "parameters": [
          {
            "name": "ids",
            "in": "path",
            "required": true,
            "description": "Comma-separated globally unique ids (UUID4)",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/fields"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/include"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TypeTwoResource"
                    },
                    "included": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "$ref": "#/components/schemas/resource"
                      }
                    },
                    "links": {
                      "description": "Link members related to primary data",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/links"
                        },
                        {
                          "$ref": "#/components/schemas/pagination"
                        }
                      ]
                    },
                    "jsonapi": {
                      "$ref": "#/components/schemas/jsonapi"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "not authorized",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": ["TypeTwoResources"],
        "description": "Update typeTwoResource.\n\nRequired Permission:\n\n - Resource: ```resource:typeTwoResources:{id0}, resource:typeTwoResources:{id1}, ...```\n\n - Action: ```resource:typeTwoResources:update```",
        "operationId": "Update typeTwoResource",
        "parameters": [
          {
            "name": "ids",
            "in": "path",
            "required": true,
            "description": "Comma-separated globally unique ids (UUID4)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/vnd.api+json": {
              "schema": {
                "required": ["data"],
                "properties": {
                  "data": {
                    "type": "object",
                    "required": ["type", "id"],
                    "additionalProperties": false,
                    "properties": {
                      "type": {
                        "$ref": "#/components/schemas/type"
                      },
                      "id": {
                        "$ref": "#/components/schemas/id"
                      },
                      "links": {
                        "type": "object",
                        "properties": {
                          "self": {
                            "$ref": "#/components/schemas/link"
                          }
                        }
                      },
                      "attributes": {
                        "type": "object",
                        "properties": {
                          "createdAt": {
                            "type": "string",
                            "format": "date"
                          },
                          "name": {
                            "type": "string"
                          },
                          "tenants": {
                            "type": "array",
                            "items": { "type": "string" },
                            "description": "Tenant IDs to assign to this resource. Filtered to the caller's authorized tenants. Defaults to caller's tenants if omitted."
                          }
                        }
                      },
                      "relationships": {
                        "type": "object",
                        "properties": {
                          "typeOneResource": {
                            "$ref": "#/components/schemas/reltoone"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TypeTwoResource"
                    },
                    "included": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "$ref": "#/components/schemas/resource"
                      }
                    },
                    "links": {
                      "description": "Link members related to primary data",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/links"
                        },
                        {
                          "$ref": "#/components/schemas/pagination"
                        }
                      ]
                    },
                    "jsonapi": {
                      "$ref": "#/components/schemas/jsonapi"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "not authorized",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "403": {
            "description": "[Forbidden](https://jsonapi.org/format/#crud-updating-responses-403)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "404": {
            "description": "[Related resource does not exist](https://jsonapi.org/format/#crud-updating-responses-404)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "409": {
            "description": "[Conflict]([Conflict](https://jsonapi.org/format/#crud-updating-responses-409)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": ["TypeTwoResources"],
        "description": "Delete typeTwoResource.\n\nRequired Permission:\n\n - Resource: ```resource:typeTwoResources:{id0}, resource:typeTwoResources:{id1}, ...```\n\n - Action: ```resource:typeTwoResources:delete```",
        "operationId": "Delete typeTwoResource",
        "parameters": [
          {
            "name": "ids",
            "in": "path",
            "required": true,
            "description": "Comma-separated globally unique ids (UUID4)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "[OK](https://jsonapi.org/format/#crud-deleting-responses-200)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/onlymeta"
                }
              }
            }
          },
          "202": {
            "description": "Accepted for [asynchronous processing](https://jsonapi.org/recommendations/#asynchronous-processing)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/datum"
                }
              }
            }
          },
          "204": {
            "description": "[no content](https://jsonapi.org/format/#crud-deleting-responses-204)"
          },
          "401": {
            "description": "not authorized",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "404": {
            "description": "[Resource does not exist](https://jsonapi.org/format/#crud-deleting-responses-404)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          }
        }
      }
    },
    "/resources/typeOneResources/{id}/relationships/{related_field}/": {
      "get": {
        "tags": ["TypeOneResources"],
        "operationId": "Read typeOneResource relationship",
        "description": "Read a typeTwoResource (related_field) associated with the typeOneResource.\n\nRequired Permission:\n\n - Resource: ```resource:typeOneResources:{id}, resource:typeOneResources:typeTwoResources```\n\n - Action: ```resource:typeOneResources:get, resource:typeTwoResources:list```",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Globally unique ids (UUID4)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "related_field",
            "in": "path",
            "required": true,
            "description": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/fields"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/fields"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ResourceIdentifierObject"
                    },
                    "included": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "$ref": "#/components/schemas/resource"
                      }
                    },
                    "links": {
                      "description": "Link members related to primary data",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/links"
                        },
                        {
                          "$ref": "#/components/schemas/pagination"
                        }
                      ]
                    },
                    "jsonapi": {
                      "$ref": "#/components/schemas/jsonapi"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "not authorized",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["TypeOneResources"],
        "operationId": "Create typeOneResource relationship",
        "description": "Create a typeTwoResource associated with the typeOneResource.\n\nRequired Permission:\n\n - Resource: ```resource:typeOneResources:{id}```\n\n - Action: ```resource:typeTwoResources:create```",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Globally unique ids (UUID4)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "related_field",
            "in": "path",
            "required": true,
            "description": "",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/vnd.api+json": {
              "schema": {
                "required": ["data"],
                "properties": {
                  "data": {
                    "$ref": "#/components/schemas/ResourceIdentifierObject"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "[Created](https://jsonapi.org/format/#crud-creating-responses-201). Assigned `id` and/or any other changes are in this response.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ResourceIdentifierObject"
                    },
                    "included": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "$ref": "#/components/schemas/resource"
                      }
                    },
                    "links": {
                      "description": "Link members related to primary data",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/links"
                        },
                        {
                          "$ref": "#/components/schemas/pagination"
                        }
                      ]
                    },
                    "jsonapi": {
                      "$ref": "#/components/schemas/jsonapi"
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "Accepted for [asynchronous processing](https://jsonapi.org/recommendations/#asynchronous-processing)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/datum"
                }
              }
            }
          },
          "204": {
            "description": "[Created](https://jsonapi.org/format/#crud-creating-responses-204) with the supplied `id`. No other changes from what was POSTed."
          },
          "401": {
            "description": "not authorized",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "403": {
            "description": "[Forbidden](https://jsonapi.org/format/#crud-creating-responses-403)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "404": {
            "description": "[Related resource does not exist](https://jsonapi.org/format/#crud-creating-responses-404)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "409": {
            "description": "[Conflict](https://jsonapi.org/format/#crud-creating-responses-409)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": ["TypeOneResources"],
        "operationId": "Update typeOneResource relationship",
        "description": "Update a typeTwoResource associated with the typeOneResource.\n\nRequired Permission:\n\n - Resource: ```resource:typeOneResources:{id}```\n\n - Action: ```resource:typeTwoResources:update```",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Globally unique ids (UUID4)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "related_field",
            "in": "path",
            "required": true,
            "description": "",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/vnd.api+json": {
              "schema": {
                "required": ["data"],
                "properties": {
                  "data": {
                    "$ref": "#/components/schemas/ResourceIdentifierObject"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ResourceIdentifierObject"
                    },
                    "included": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "$ref": "#/components/schemas/resource"
                      }
                    },
                    "links": {
                      "description": "Link members related to primary data",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/links"
                        },
                        {
                          "$ref": "#/components/schemas/pagination"
                        }
                      ]
                    },
                    "jsonapi": {
                      "$ref": "#/components/schemas/jsonapi"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "not authorized",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "403": {
            "description": "[Forbidden](https://jsonapi.org/format/#crud-updating-responses-403)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "404": {
            "description": "[Related resource does not exist](https://jsonapi.org/format/#crud-updating-responses-404)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "409": {
            "description": "[Conflict]([Conflict](https://jsonapi.org/format/#crud-updating-responses-409)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": ["TypeOneResources"],
        "operationId": "Delete typeOneResource relationship",
        "description": "Delete a typeTwoResource associated with the typeOneResource.\n\nRequired Permission:\n\n - Resource: ```resource:typeOneResources:{id}```\n\n - Action: ```resource:typeTwoResources:delete```",
        "parameters": [
          {
            "name": "ids",
            "in": "path",
            "required": true,
            "description": "Globally unique ids (UUID4)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "related_field",
            "in": "path",
            "required": true,
            "description": "",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/vnd.api+json": {
              "schema": {
                "required": ["data"],
                "properties": {
                  "data": {
                    "$ref": "#/components/schemas/ResourceIdentifierObject"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "[OK](https://jsonapi.org/format/#crud-deleting-responses-200)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/onlymeta"
                }
              }
            }
          },
          "202": {
            "description": "Accepted for [asynchronous processing](https://jsonapi.org/recommendations/#asynchronous-processing)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/datum"
                }
              }
            }
          },
          "204": {
            "description": "[no content](https://jsonapi.org/format/#crud-deleting-responses-204)"
          },
          "401": {
            "description": "not authorized",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "404": {
            "description": "[Resource does not exist](https://jsonapi.org/format/#crud-deleting-responses-404)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          }
        }
      }
    },
    "/resources/typeOneResources/{ids}/typeTwoResources/": {
      "get": {
        "tags": ["TypeOneResources"],
        "operationId": "List associated typeTwoResources",
        "description": "List associated typeTwoResources.\n\nRequired Permission:\n\n - Resource: ```resource:typeOneResources:{id0}, resource:typeOneResources:{id1}, ...```\n\n - Action: ```resource:typeTwoResources:list```",
        "parameters": [
          {
            "name": "ids",
            "in": "path",
            "required": true,
            "description": "Comma-separated globally unique ids (UUID4)",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/include"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/fields"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/sort"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/page[limit]"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/page[offset]"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/filter"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TypeTwoResource"
                      }
                    },
                    "included": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "$ref": "#/components/schemas/resource"
                      }
                    },
                    "links": {
                      "description": "Link members related to primary data",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/links"
                        },
                        {
                          "$ref": "#/components/schemas/pagination"
                        }
                      ]
                    },
                    "jsonapi": {
                      "$ref": "#/components/schemas/jsonapi"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "not authorized",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          }
        }
      }
    },
    "/resources/typeTwoResources/{id}/relationships/{related_field}/": {
      "get": {
        "tags": ["TypeTwoResources"],
        "operationId": "Read typeTwoResource relationship",
        "description": "Read a typeOneResource associated with the typeTwoResource.\n\nRequired Permission:\n\n - Resource: ```resource:typeTwoResources:{id}, resource:typeTwoResources:typeOneResource```\n\n - Action: ```resource:typeTwoResources:get, resource:typeOneResources:get```\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Globally unique ids (UUID4)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "related_field",
            "in": "path",
            "required": true,
            "description": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/include"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/fields"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ResourceIdentifierObject"
                    },
                    "included": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "$ref": "#/components/schemas/resource"
                      }
                    },
                    "links": {
                      "description": "Link members related to primary data",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/links"
                        },
                        {
                          "$ref": "#/components/schemas/pagination"
                        }
                      ]
                    },
                    "jsonapi": {
                      "$ref": "#/components/schemas/jsonapi"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "not authorized",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["TypeTwoResources"],
        "operationId": "Create typeTwoResource relationship",
        "description": "Create a typeOneResource associated with the typeTwoResource.\n\nRequired Permission:\n\n - Resource: ```resource:typeTwoResources:{id}```\n\n - Action: ```resource:typeOneResources:create```\n",
        "parameters": [
          {
            "name": "ids",
            "in": "path",
            "required": true,
            "description": "Globally unique ids (UUID4)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "related_field",
            "in": "path",
            "required": true,
            "description": "",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/vnd.api+json": {
              "schema": {
                "required": ["data"],
                "properties": {
                  "data": {
                    "$ref": "#/components/schemas/ResourceIdentifierObject"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "[Created](https://jsonapi.org/format/#crud-creating-responses-201). Assigned `id` and/or any other changes are in this response.",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ResourceIdentifierObject"
                    },
                    "included": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "$ref": "#/components/schemas/resource"
                      }
                    },
                    "links": {
                      "description": "Link members related to primary data",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/links"
                        },
                        {
                          "$ref": "#/components/schemas/pagination"
                        }
                      ]
                    },
                    "jsonapi": {
                      "$ref": "#/components/schemas/jsonapi"
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "Accepted for [asynchronous processing](https://jsonapi.org/recommendations/#asynchronous-processing)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/datum"
                }
              }
            }
          },
          "204": {
            "description": "[Created](https://jsonapi.org/format/#crud-creating-responses-204) with the supplied `id`. No other changes from what was POSTed."
          },
          "401": {
            "description": "not authorized",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "403": {
            "description": "[Forbidden](https://jsonapi.org/format/#crud-creating-responses-403)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "404": {
            "description": "[Related resource does not exist](https://jsonapi.org/format/#crud-creating-responses-404)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "409": {
            "description": "[Conflict](https://jsonapi.org/format/#crud-creating-responses-409)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": ["TypeTwoResources"],
        "operationId": "Update typeTwoResource relationship",
        "description": "Update a typeOneResource associated with the typeTwoResource.\n\nRequired Permission:\n\n - Resource: ```resource:typeTwoResources:{id}```\n\n - Action: ```resource:typeOneResources:update```\n",
        "parameters": [
          {
            "name": "ids",
            "in": "path",
            "required": true,
            "description": "Globally unique ids (UUID4)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "related_field",
            "in": "path",
            "required": true,
            "description": "",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/vnd.api+json": {
              "schema": {
                "required": ["data"],
                "properties": {
                  "data": {
                    "$ref": "#/components/schemas/ResourceIdentifierObject"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ResourceIdentifierObject"
                    },
                    "included": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "$ref": "#/components/schemas/resource"
                      }
                    },
                    "links": {
                      "description": "Link members related to primary data",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/links"
                        },
                        {
                          "$ref": "#/components/schemas/pagination"
                        }
                      ]
                    },
                    "jsonapi": {
                      "$ref": "#/components/schemas/jsonapi"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "not authorized",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "403": {
            "description": "[Forbidden](https://jsonapi.org/format/#crud-updating-responses-403)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "404": {
            "description": "[Related resource does not exist](https://jsonapi.org/format/#crud-updating-responses-404)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "409": {
            "description": "[Conflict]([Conflict](https://jsonapi.org/format/#crud-updating-responses-409)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": ["TypeTwoResources"],
        "operationId": "Delete typeTwoResource relationship",
        "description": "Delete a typeOneResource associated with the typeTwoResource.\n\nRequired Permission:\n\n - Resource: ```resource:typeTwoResources:{id}```\n\n - Action: ```resource:typeOneResources:delete```\n",
        "parameters": [
          {
            "name": "ids",
            "in": "path",
            "required": true,
            "description": "Globally unique ids (UUID4)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "related_field",
            "in": "path",
            "required": true,
            "description": "",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/vnd.api+json": {
              "schema": {
                "required": ["data"],
                "properties": {
                  "data": {
                    "$ref": "#/components/schemas/ResourceIdentifierObject"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "[OK](https://jsonapi.org/format/#crud-deleting-responses-200)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/onlymeta"
                }
              }
            }
          },
          "202": {
            "description": "Accepted for [asynchronous processing](https://jsonapi.org/recommendations/#asynchronous-processing)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/datum"
                }
              }
            }
          },
          "204": {
            "description": "[no content](https://jsonapi.org/format/#crud-deleting-responses-204)"
          },
          "401": {
            "description": "not authorized",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "404": {
            "description": "[Resource does not exist](https://jsonapi.org/format/#crud-deleting-responses-404)",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          }
        }
      }
    },
    "/resources/typeTwoResources/{ids}/typeOneResource/": {
      "get": {
        "tags": ["TypeTwoResources"],
        "operationId": "Read associated typeOneResource",
        "description": "Read associated typeOneResource.\n\nRequired Permission:\n\n - Resource: ```resource:typeTwoResources:{id0}, resource:typeTwoResources:{id1}, ...```\n\n - Action: ```resource:typeOneResources:get```",
        "parameters": [
          {
            "name": "ids",
            "in": "path",
            "required": true,
            "description": "Comma-separated globally unique ids (UUID4)",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/include"
          },
          {
            "$ref": "../../common.json#/components/jsonApi/parameters/fields"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TypeOneResource"
                    },
                    "included": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "$ref": "#/components/schemas/resource"
                      }
                    },
                    "links": {
                      "description": "Link members related to primary data",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/links"
                        },
                        {
                          "$ref": "#/components/schemas/pagination"
                        }
                      ]
                    },
                    "jsonapi": {
                      "$ref": "#/components/schemas/jsonapi"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "not authorized",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/failure"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "jsonapi": {
        "type": "object",
        "description": "The server's implementation",
        "properties": {
          "version": {
            "type": "string"
          },
          "meta": {
            "$ref": "#/components/schemas/meta"
          }
        },
        "additionalProperties": false
      },
      "resource": {
        "type": "object",
        "required": ["type", "id"],
        "additionalProperties": false,
        "properties": {
          "type": {
            "$ref": "#/components/schemas/type"
          },
          "id": {
            "$ref": "#/components/schemas/id"
          },
          "attributes": {
            "type": "object"
          },
          "relationships": {
            "type": "object"
          },
          "links": {
            "$ref": "#/components/schemas/links"
          },
          "meta": {
            "$ref": "#/components/schemas/meta"
          }
        }
      },
      "link": {
        "oneOf": [
          {
            "description": "a string containing the link's URL",
            "type": "string",
            "format": "uri-reference"
          },
          {
            "type": "object",
            "required": ["href"],
            "properties": {
              "href": {
                "description": "a string containing the link's URL",
                "type": "string",
                "format": "uri-reference"
              },
              "meta": {
                "$ref": "#/components/schemas/meta"
              }
            }
          }
        ]
      },
      "links": {
        "type": "object",
        "additionalProperties": {
          "$ref": "#/components/schemas/link"
        }
      },
      "reltoone": {
        "description": "a singular 'to-one' relationship",
        "type": "object",
        "properties": {
          "links": {
            "$ref": "#/components/schemas/relationshipLinks"
          },
          "data": {
            "$ref": "#/components/schemas/relationshipToOne"
          },
          "meta": {
            "$ref": "#/components/schemas/meta"
          }
        }
      },
      "relationshipToOne": {
        "description": "reference to other resource in a to-one relationship",
        "anyOf": [
          {
            "$ref": "#/components/schemas/nulltype"
          },
          {
            "$ref": "#/components/schemas/linkage"
          }
        ]
      },
      "reltomany": {
        "description": "a multiple 'to-many' relationship",
        "type": "object",
        "properties": {
          "links": {
            "$ref": "#/components/schemas/relationshipLinks"
          },
          "data": {
            "$ref": "#/components/schemas/relationshipToMany"
          },
          "meta": {
            "$ref": "#/components/schemas/meta"
          }
        }
      },
      "relationshipLinks": {
        "description": "optional references to other resource objects",
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "self": {
            "$ref": "#/components/schemas/link"
          },
          "related": {
            "$ref": "#/components/schemas/link"
          }
        }
      },
      "relationshipToMany": {
        "description": "An array of objects each containing the 'type' and 'id' for to-many relationships",
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/linkage"
        },
        "uniqueItems": true
      },
      "ResourceIdentifierObject": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/relationshipToOne"
          },
          {
            "$ref": "#/components/schemas/relationshipToMany"
          }
        ]
      },
      "linkage": {
        "type": "object",
        "description": "the 'type' and 'id'",
        "required": ["type", "id"],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/type"
          },
          "id": {
            "$ref": "#/components/schemas/id"
          },
          "meta": {
            "$ref": "#/components/schemas/meta"
          }
        }
      },
      "pagination": {
        "type": "object",
        "properties": {
          "first": {
            "$ref": "#/components/schemas/pageref"
          },
          "last": {
            "$ref": "#/components/schemas/pageref"
          },
          "prev": {
            "$ref": "#/components/schemas/pageref"
          },
          "next": {
            "$ref": "#/components/schemas/pageref"
          }
        }
      },
      "pageref": {
        "oneOf": [
          {
            "type": "string",
            "format": "uri-reference"
          },
          {
            "$ref": "#/components/schemas/nulltype"
          }
        ]
      },
      "failure": {
        "type": "object",
        "required": ["errors"],
        "properties": {
          "errors": {
            "$ref": "#/components/schemas/errors"
          },
          "meta": {
            "$ref": "#/components/schemas/meta"
          },
          "jsonapi": {
            "$ref": "#/components/schemas/jsonapi"
          },
          "links": {
            "$ref": "#/components/schemas/links"
          }
        }
      },
      "errors": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/error"
        },
        "uniqueItems": true
      },
      "error": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "links": {
            "$ref": "#/components/schemas/links"
          },
          "code": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "source": {
            "type": "object",
            "properties": {
              "pointer": {
                "type": "string",
                "description": "A [JSON Pointer](https://tools.ietf.org/html/rfc6901) to the associated entity in the request document [e.g. `/data` for a primary data object, or `/data/attributes/title` for a specific attribute."
              },
              "parameter": {
                "type": "string",
                "description": "A string indicating which query parameter caused the error."
              },
              "meta": {
                "$ref": "#/components/schemas/meta"
              }
            }
          }
        }
      },
      "onlymeta": {
        "additionalProperties": false,
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/meta"
          }
        }
      },
      "meta": {
        "type": "object",
        "additionalProperties": true
      },
      "datum": {
        "description": "singular item",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/resource"
          }
        }
      },
      "nulltype": {
        "type": "object",
        "nullable": true,
        "default": null
      },
      "type": {
        "type": "string",
        "description": "The [type](https://jsonapi.org/format/#document-resource-object-identification) member is used to describe resource objects that share common attributes and relationships."
      },
      "id": {
        "type": "string",
        "description": "Each resource object’s type and id pair MUST [identify](https://jsonapi.org/format/#document-resource-object-identification) a single, unique resource."
      },
      "TypeOneResource": {
        "type": "object",
        "required": ["type", "id"],
        "additionalProperties": false,
        "properties": {
          "type": {
            "$ref": "#/components/schemas/type"
          },
          "id": {
            "$ref": "#/components/schemas/id"
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "$ref": "#/components/schemas/link"
              }
            }
          },
          "attributes": {
            "type": "object",
            "properties": {
              "createdAt": {
                "type": "string",
                "format": "date"
              },
              "serial": {
                "type": "string"
              },
              "tenants": {
                "type": "array",
                "items": { "type": "string" },
                "description": "Tenant IDs this resource belongs to."
              }
            },
            "required": ["serial"]
          },
          "relationships": {
            "type": "object",
            "properties": {
              "typeTwoResources": {
                "$ref": "#/components/schemas/reltomany"
              }
            }
          }
        }
      },
      "TypeTwoResource": {
        "type": "object",
        "required": ["type", "id"],
        "additionalProperties": false,
        "properties": {
          "type": {
            "$ref": "#/components/schemas/type"
          },
          "id": {
            "$ref": "#/components/schemas/id"
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "$ref": "#/components/schemas/link"
              }
            }
          },
          "attributes": {
            "type": "object",
            "properties": {
              "createdAt": {
                "type": "string",
                "format": "date"
              },
              "name": {
                "type": "string"
              },
              "tenants": {
                "type": "array",
                "items": { "type": "string" },
                "description": "Tenant IDs this resource belongs to."
              }
            },
            "required": ["name"]
          },
          "relationships": {
            "type": "object",
            "properties": {
              "typeOneResource": {
                "$ref": "#/components/schemas/reltoone"
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "$ref": "../../common.json#/components/securitySchemes"
    }
  },
  "security": [
    { "chx_auth_session": [] },
    { "bearer": [] }
  ]
}
