{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/aftership/main/json-schema/aftership-membership-v1-schema.json",
  "title": "Membership",
  "description": "Object describes membership information.",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aftership-memberships-api-openapi.yml#/components/schemas/Membership.v1",
  "type": "object",
  "x-tags": [
    "Resource"
  ],
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1
    },
    "organization": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "account": {
      "type": "object",
      "required": [
        "id",
        "email"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "description": "Identity of account."
        },
        "email": {
          "type": "string",
          "minLength": 1,
          "description": "Email ID, which should be registered with AfterShip already."
        }
      }
    },
    "role": {
      "$ref": "#/$defs/Role.v1"
    }
  },
  "required": [
    "id",
    "organization",
    "account",
    "role"
  ],
  "$defs": {
    "Role.v1": {
      "description": "Object describes role information.",
      "type": "object",
      "title": "Role",
      "properties": {
        "code": {
          "type": "string",
          "minLength": 1,
          "description": "role code"
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "role name"
        }
      },
      "required": [
        "code",
        "name"
      ],
      "x-tags": [
        "Resource"
      ]
    }
  }
}