File

EntityDraftv1.0.0-rc.2

A file that records point at, such as a recording, a certificate, a photo or a grid, with its media type, its place and its hash. A file does not change: a changed file is a new File.

https://opendevelopmentstandards.org/schema/1.0.0-rc.2/core/File.json

Fields

Every entity also has the fields of the Entity base. The first row lists them.

From the Entity baseidnamedescriptionidentifierslinkscreatedAtupdatedAt
  • idRequired
    textnot empty

    The record's id: unique within the document. Fields that point at the record hold this id.

  • name
    text

    The name people use for the record.

  • description
    text

    What the record is, in words.

  • identifiers

    Ids the record has in other systems.

  • links

    Open-ended links to other records.

  • createdAt
    date-time (RFC 3339)

    When the record was created, in its producer's system.

  • updatedAt
    date-time (RFC 3339)

    When the record last changed, in its producer's system.

  • path
    textmatches ^(?!/)(?!.*\.\./).+$

    Where the file sits inside the package, relative to its root.

  • url
    URI

    Where the file can be read, when it is outside the package.

  • mediaTypeRequired
    textmatches ^[a-z0-9!#$&^_.+-]+/[a-z0-9!#$&^_.+-]+$

    What the bytes are, as an IANA media type, such as text/csv or image/jpeg.

  • size
    whole numberat least 0

    The file's size, in bytes.

  • sha256Required
    textmatches ^[0-9a-f]{64}$

    The SHA-256 of the file's bytes, in lower-case hex. A reader checks it before it trusts the file.

  • interval

    For a recording: the time it covers, in its own clock, with no correction.

  • producer
    object, fields below

    For a file made from another: the software that made it.

    • nameRequired
      text

      The software's name.

    • version
      text

      Its version.

Links

Examples

An id that another example defines opens that record.

Full example

{
  "id": "file-recording-1",
  "name": "Night survey levels",
  "path": "files/recording-1.bin",
  "mediaType": "application/octet-stream",
  "size": 1310720,
  "sha256": "ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d",
  "interval": {
    "start": "2026-07-14T22:00:00-06:00",
    "end": "2026-07-15T07:00:00-06:00"
  }
}
Show 1 more example

Minimal example: the required fields only

{
  "id": "file-1",
  "mediaType": "application/pdf",
  "sha256": "4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a"
}

Changes and file

Changes

  1. 0.1.0 First version.

Schema file

Show the JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://opendevelopmentstandards.org/schema/1.0.0-rc.2/core/File.json",
  "title": "File",
  "description": "A file that records point at, such as a recording, a certificate, a photo or a grid, with its media type, its place and its hash. A file does not change: a changed file is a new File.",
  "$ref": "Entity.json",
  "type": "object",
  "properties": {
    "path": {
      "type": "string",
      "description": "Where the file sits inside the package, relative to its root.",
      "pattern": "^(?!/)(?!.*\\.\\./).+$"
    },
    "url": {
      "type": "string",
      "description": "Where the file can be read, when it is outside the package.",
      "format": "uri"
    },
    "mediaType": {
      "type": "string",
      "description": "What the bytes are, as an IANA media type, such as text/csv or image/jpeg.",
      "pattern": "^[a-z0-9!#$&^_.+-]+/[a-z0-9!#$&^_.+-]+$"
    },
    "size": {
      "type": "integer",
      "minimum": 0,
      "description": "The file's size, in bytes."
    },
    "sha256": {
      "type": "string",
      "description": "The SHA-256 of the file's bytes, in lower-case hex. A reader checks it before it trusts the file.",
      "pattern": "^[0-9a-f]{64}$"
    },
    "interval": {
      "$ref": "Interval.json",
      "description": "For a recording: the time it covers, in its own clock, with no correction."
    },
    "producer": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The software's name."
        },
        "version": {
          "type": "string",
          "description": "Its version."
        }
      },
      "required": [
        "name"
      ],
      "description": "For a file made from another: the software that made it.",
      "patternProperties": {
        "^x-": {}
      },
      "unevaluatedProperties": false
    }
  },
  "required": [
    "mediaType",
    "sha256"
  ],
  "patternProperties": {
    "^x-": {}
  },
  "unevaluatedProperties": false,
  "examples": [
    {
      "id": "file-1",
      "mediaType": "application/pdf",
      "sha256": "4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a"
    },
    {
      "id": "file-recording-1",
      "name": "Night survey levels",
      "path": "files/recording-1.bin",
      "mediaType": "application/octet-stream",
      "size": 1310720,
      "sha256": "ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d",
      "interval": {
        "start": "2026-07-14T22:00:00-06:00",
        "end": "2026-07-15T07:00:00-06:00"
      }
    }
  ],
  "x-ods-status": "draft",
  "x-ods-kind": "entity",
  "x-ods-module": "core",
  "x-ods-changes": {
    "0.1.0": "First version."
  }
}