{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ptpge.org/v1/schemas/organization/1.schema.json",
  "title": "PTPGE organization/1",
  "description": "What a network, association or group of print businesses is, and who its members are. Written by the organization and published on its own domain at /.well-known/ptpge/organization.json (SD-0101). An organization does not print and does not sell; one that also takes orders publishes a vendor declaration as well. The member list is the organization's half of a membership: a vendor states the other half in its own vendor declaration (memberOf), and the membership counts as confirmed only when both point at each other. No capability, no offerings, no prices. Licence of the schema: CC BY 4.0.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "schemaVersion",
    "identity",
    "name",
    "domain",
    "organizationType",
    "members",
    "modified"
  ],
  "properties": {
    "schema": {
      "const": "https://ptpge.org/v1/schemas/organization/1"
    },
    "schemaVersion": {
      "const": 1
    },
    "identity": {
      "$ref": "#/$defs/organizationUri",
      "description": "The organization's entry in the Organizations register — the subject of this document."
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "The name as shown on the register entry."
    },
    "legalName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Registered name, where it differs."
    },
    "domain": {
      "$ref": "#/$defs/hostname",
      "description": "The domain this document is published on; the register points at it. Ownership is proven by the file being there."
    },
    "website": {
      "type": "string",
      "format": "uri",
      "pattern": "^https://",
      "description": "The organization's site, https."
    },
    "country": {
      "type": "string",
      "pattern": "^[A-Z]{2}$",
      "description": "ISO 3166-1 alpha-2 of the seat. Optional — a global network may leave it out."
    },
    "organizationType": {
      "enum": [
        "network",
        "trade-association",
        "purchasing-group",
        "standards-body",
        "other"
      ],
      "description": "network — independent print businesses that work together; trade-association — an industry body; purchasing-group — members buy together; standards-body — an organization that develops specifications or standards for the industry (added 2026-11-23); other."
    },
    "members": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "$ref": "#/$defs/vendorUri"
      },
      "description": "The members, each as its entry in the Vendors register. May be empty. Only print businesses that have a vendor identity can be listed; a membership is confirmed when the member's own vendor declaration states memberOf this organization."
    },
    "logo": {
      "type": "string",
      "pattern": "^(https://|data:image/(png|svg\\+xml|jpeg|webp);base64,)",
      "maxLength": 400000,
      "description": "Optional. Shown on the register entry next to the ptpge-id/1 mark."
    },
    "modified": {
      "type": "string",
      "format": "date-time",
      "description": "When this document was last changed; the register's weekly re-check compares it."
    },
    "generatedBy": {
      "type": "object",
      "description": "Which tool wrote the document. Open: an implementation may add its own fields here — nothing under generatedBy is read by the register.",
      "properties": {
        "tool": {
          "type": "string"
        },
        "version": {
          "type": "string"
        }
      },
      "additionalProperties": true
    }
  },
  "$defs": {
    "organizationUri": {
      "type": "string",
      "pattern": "^https://ptpge\\.org/v1/organizations/[a-z0-9-]+$"
    },
    "vendorUri": {
      "type": "string",
      "pattern": "^https://ptpge\\.org/v1/vendors/[a-z0-9-]+$"
    },
    "hostname": {
      "type": "string",
      "pattern": "^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"
    }
  }
}