{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zywave/json-schema/zywave-course-schema.json",
  "title": "Course",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zywave-course-api-openapi.yml#/components/schemas/Course",
  "allOf": [
    {
      "$ref": "#/$defs/CourseCreateInfo"
    },
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "isReadOnly"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "isReadOnly": {
          "type": "boolean"
        },
        "isProcessing": {
          "type": "boolean"
        },
        "categories": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "createdDateTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "createdUserPrincipalId": {
          "type": [
            "string",
            "null"
          ],
          "format": "guid"
        },
        "updatedDateTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "updatedUserPrincipalId": {
          "type": [
            "string",
            "null"
          ],
          "format": "guid"
        }
      }
    }
  ],
  "$defs": {
    "CourseAudience": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "Employees",
        "Managers"
      ],
      "enum": [
        "Employees",
        "Managers"
      ]
    },
    "CourseContentType": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "SCORM",
        "AICC",
        "XAPI",
        "CMI5",
        "PDF",
        "MP4",
        "MP3",
        "YouTube"
      ],
      "enum": [
        "SCORM",
        "AICC",
        "XAPI",
        "CMI5",
        "PDF",
        "MP4",
        "MP3",
        "YouTube"
      ]
    },
    "CourseCreateInfo": {
      "allOf": [
        {
          "$ref": "#/$defs/CourseUpdateInfo"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "accountId": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            }
          }
        }
      ]
    },
    "CourseUpdateInfo": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "language"
      ],
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 255,
          "minLength": 1
        },
        "hasClosedCaptions": {
          "type": "boolean"
        },
        "language": {
          "type": "string",
          "maxLength": 10,
          "minLength": 1
        },
        "audience": {
          "oneOf": [
            {
              "$ref": "#/$defs/CourseAudience"
            }
          ]
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 1000
        },
        "durationInMinutes": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "categoryIds": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "integer",
            "format": "int32"
          }
        },
        "contentType": {
          "oneOf": [
            {
              "$ref": "#/$defs/CourseContentType"
            }
          ]
        }
      }
    }
  }
}