{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/eventship-com/json-schema/eventship-com-external-question-response-schema.json",
  "title": "ExternalQuestionResponse",
  "description": "Registration question for external API consumers.\n\nReads carry the full ``QuestionType``, deliberately including ``address``.\nThe external API cannot *author* an address question (see\n``AuthoredQuestionType`` on the create/update requests below), but the host\ncan add the mailing-address system question in-app, and this schema then has\nto serialize it — narrowing the type here would 500 every read of that event.",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/eventship-com-openapi.json#/components/schemas/ExternalQuestionResponse",
  "properties": {
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "questionText": {
      "type": "string",
      "title": "Questiontext"
    },
    "questionType": {
      "$ref": "#/$defs/QuestionType"
    },
    "options": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Options"
    },
    "addressScope": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "full",
            "postal_code"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Addressscope"
    },
    "isRequired": {
      "type": "boolean",
      "title": "Isrequired",
      "default": false
    },
    "condition": {
      "anyOf": [
        {
          "$ref": "#/$defs/QuestionConditionSchema"
        },
        {
          "type": "null"
        }
      ],
      "description": "Conditional visibility (Pro): only shown when the source question's answer matches (op 'is') / does not match (op 'is_not') one of the values. Required-ness only applies while visible."
    }
  },
  "type": "object",
  "required": [
    "id",
    "questionText",
    "questionType"
  ],
  "$defs": {
    "QuestionConditionSchema": {
      "properties": {
        "sourceQuestionId": {
          "type": "integer",
          "title": "Sourcequestionid"
        },
        "op": {
          "type": "string",
          "enum": [
            "is",
            "is_not"
          ],
          "title": "Op"
        },
        "values": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "minItems": 1,
          "title": "Values"
        }
      },
      "type": "object",
      "required": [
        "sourceQuestionId",
        "op",
        "values"
      ],
      "title": "QuestionConditionSchema",
      "description": "Conditional visibility rule on a registration/membership question.\n\nThe question is only shown when the source question's answer matches\n(``is``) / does not match (``is_not``) one of ``values``. Canonical\nevaluation semantics: ``api/services/question_visibility.py``."
    },
    "QuestionType": {
      "type": "string",
      "enum": [
        "text",
        "textarea",
        "select",
        "checkbox",
        "multiselect",
        "address"
      ],
      "title": "QuestionType",
      "description": "Type of registration question on an event."
    }
  }
}