{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pennsylvania-state-university/json-schema/pennsylvania-state-university-ingest-schema.json",
  "title": "ingest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pennsylvania-state-university-ingest-api-openapi.yml#/components/schemas/ingest",
  "type": "object",
  "required": [
    "metadata",
    "depositor",
    "content"
  ],
  "properties": {
    "metadata": {
      "$ref": "#/$defs/metadata"
    },
    "content": {
      "type": "array",
      "description": "Files that have been uploaded to S3 in a previous step. The location information for each one, as well as their original names and mime types, is included here.",
      "items": {
        "$ref": "#/$defs/uploadedFile"
      }
    },
    "depositor": {
      "type": "string",
      "description": "The Penn State access of the person who is depositing the work. This is typically the same person who is the creator, but not always. There is no restriction regarding who the depositor is other than they must have an active account in Penn State's identity management system."
    },
    "permissions": {
      "$ref": "#/$defs/permissions"
    },
    "publish": {
      "type": "boolean",
      "description": "Whether the ingest call should publish the Work or simply create a draft. If left blank, this will default to \"true\""
    }
  },
  "$defs": {
    "creator": {
      "type": "object",
      "required": [
        "display_name"
      ],
      "properties": {
        "display_name": {
          "type": "string"
        },
        "surname": {
          "type": "string"
        },
        "given_name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "psu_id": {
          "type": "string"
        },
        "orcid": {
          "type": "string"
        }
      }
    },
    "metadata": {
      "type": "object",
      "required": [
        "title",
        "work_type",
        "description",
        "published_date",
        "creators",
        "rights",
        "visibility"
      ],
      "properties": {
        "title": {
          "type": "string"
        },
        "work_type": {
          "type": "string",
          "enum": [
            "article",
            "audio",
            "book",
            "collection",
            "conference_proceeding",
            "dataset",
            "image",
            "instrument",
            "journal",
            "map_or_cartographic_material",
            "masters_culminating_experience",
            "other",
            "part_of_book",
            "poster",
            "presentation",
            "professional_doctoral_culminating_experience",
            "project",
            "report",
            "research_paper",
            "software_or_program_code",
            "video"
          ]
        },
        "description": {
          "type": "string"
        },
        "published_date": {
          "type": "string",
          "format": "date",
          "description": "EDTF date formats are also supported. See https://www.loc.gov/standards/datetime/"
        },
        "publisher_statement": {
          "type": "string",
          "description": "This is also referred to as a \"set statement\" and is often a required part for Open Access articles."
        },
        "keyword": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "subtitle": {
          "type": "string"
        },
        "publisher": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "subject": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "language": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "identifier": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "based_near": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "owner": {
          "type": "string"
        },
        "manufacturer": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "instrument_type": {
          "type": "string"
        },
        "measured_variable": {
          "type": "string"
        },
        "available_date": {
          "type": "string"
        },
        "decommission_date": {
          "type": "string"
        },
        "related_identifier": {
          "type": "string"
        },
        "instrument_resource_type": {
          "type": "string"
        },
        "funding_reference": {
          "type": "string"
        },
        "related_url": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "sub_work_type": {
          "type": "string",
          "enum": [
            "Capstone Course Work Product",
            "Capstone Project",
            "Culminating Research Project",
            "Doctor of Nursing Practice Project",
            "Integrative Doctoral Research Project",
            "Praxis Project",
            "Public Performance",
            "Scholarly Paper/Essay (MA/MS)"
          ]
        },
        "program": {
          "type": "string"
        },
        "degree": {
          "type": "string",
          "enum": [
            "Doctor of Education",
            "Doctor of Musical Arts",
            "Doctor of Nursing Practice",
            "Doctor of Public Health",
            "Doctor of Business Administration",
            "Doctor of Engineering",
            "Master of Arts",
            "Master of Science"
          ]
        },
        "source": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "creators": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/creator"
          }
        },
        "contributor": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "rights": {
          "type": "string",
          "enum": [
            "https://creativecommons.org/licenses/by/4.0/",
            "https://creativecommons.org/licenses/by-sa/4.0/",
            "https://creativecommons.org/licenses/by-nc/4.0/",
            "https://creativecommons.org/licenses/by-nd/4.0/",
            "https://creativecommons.org/licenses/by-nc-nd/4.0/",
            "https://creativecommons.org/licenses/by-nc-sa/4.0/",
            "http://creativecommons.org/publicdomain/mark/1.0/",
            "http://creativecommons.org/publicdomain/zero/1.0/",
            "https://rightsstatements.org/page/InC/1.0/",
            "http://www.apache.org/licenses/LICENSE-2.0",
            "https://www.gnu.org/licenses/gpl.html",
            "https://opensource.org/licenses/MIT",
            "https://opensource.org/licenses/BSD-3-Clause"
          ]
        },
        "visibility": {
          "type": "string",
          "enum": [
            "open",
            "authenticated"
          ]
        },
        "open_access": {
          "type": "boolean",
          "description": "Whether the work is an upload for open access compliance."
        },
        "imported_metadata_from_rmd": {
          "type": "boolean",
          "description": "Whether the metadata was imported from The Researcher Metadata Database (RMD)."
        },
        "embargoed_until": {
          "type": "string",
          "format": "date"
        },
        "version_name": {
          "type": "string",
          "description": "Must be in semantic version format. See https://semver.org/"
        },
        "doi": {
          "type": "string",
          "description": "A DOI minted under Scholarsphere's current prefix, 10.26207. If you have another DOI that was previously supplied by a publisher or someone else, that can be put into the identifier field."
        }
      }
    },
    "permissions": {
      "type": "object",
      "description": "Additional permissions for the work such as users or groups that can edit work. By default, only the depositor may edit the work after it has been uploaded."
    },
    "uploadedFile": {
      "type": "object"
    }
  }
}