{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://research.baekrokdam.com/submission.schema.json",
  "title": "BRC scholarly submission",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "idempotencyKey",
    "articleType",
    "title",
    "abstract",
    "authors",
    "correspondingAuthor",
    "manuscript",
    "declarations"
  ],
  "properties": {
    "schemaVersion": {
      "const": "1.0"
    },
    "idempotencyKey": {
      "type": "string",
      "minLength": 16,
      "maxLength": 128
    },
    "articleType": {
      "enum": [
        "research-article",
        "protocol",
        "review",
        "evidence-map",
        "methods",
        "perspective",
        "counter-hypothesis",
        "case-study"
      ]
    },
    "language": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "enum": [
          "ko",
          "en",
          "zh",
          "ja",
          "other"
        ]
      }
    },
    "title": {
      "$ref": "#/$defs/localized"
    },
    "abstract": {
      "$ref": "#/$defs/localized"
    },
    "keywords": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "maxItems": 20
    },
    "authors": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/author"
      }
    },
    "correspondingAuthor": {
      "type": "object",
      "required": [
        "name",
        "email"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "format": "email"
        }
      },
      "additionalProperties": false
    },
    "manuscript": {
      "type": "object",
      "required": [
        "filename",
        "mediaType",
        "sha256"
      ],
      "properties": {
        "filename": {
          "type": "string"
        },
        "mediaType": {
          "enum": [
            "application/pdf",
            "text/markdown",
            "application/xml",
            "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
          ]
        },
        "sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "uploadToken": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "declarations": {
      "type": "object",
      "required": [
        "originality",
        "rightsToSubmit",
        "funding",
        "competingInterests",
        "ethics",
        "dataAvailability",
        "aiUse"
      ],
      "properties": {
        "originality": {
          "type": "string"
        },
        "rightsToSubmit": {
          "type": "string"
        },
        "funding": {
          "type": "string"
        },
        "competingInterests": {
          "type": "string"
        },
        "ethics": {
          "type": "string"
        },
        "dataAvailability": {
          "type": "string"
        },
        "aiUse": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "agentDisclosure": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "role"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "verificationScope": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    },
    "sourcePackageUrl": {
      "type": "string",
      "format": "uri"
    },
    "notes": {
      "type": "string",
      "maxLength": 10000
    }
  },
  "$defs": {
    "localized": {
      "type": "object",
      "minProperties": 1,
      "properties": {
        "ko": {
          "type": "string",
          "minLength": 1
        },
        "en": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "author": {
      "type": "object",
      "required": [
        "name",
        "affiliation",
        "roles"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "affiliation": {
          "type": "string"
        },
        "orcid": {
          "type": "string",
          "pattern": "^https://orcid.org/[0-9X-]{19}$"
        },
        "roles": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    }
  }
}