Module

Assets

Files the output uses

An asset is a resource the output needs: an image file, a font, a model, a clip. It is not the same as a reference. A reference is evidence of intent. An asset is something the renderer is allowed to use.

Use this module when The result embeds or links a concrete resource.

Keep in mind. Owning a file is not the same as having the right to use it. Record the resource. Do not pretend the schema transfers rights.

Raw schema:/schema/1.0/modules/assets.schema.json · https://visualspec.dev/schema/1.0/modules/assets.schema.json

How to read a definition.The paragraphs say what to write and why. “Exact constraints” opens the schema keywords (type, pattern, bounds) for people checking a validator. A sample at the bottom of each definition is the smallest JSON that shows the required shape. Values such as $ref inside a sample point at another definition. They are not fields you copy into a document.

asset

Write an object. Only the fields named below are allowed. Unknown fields are rejected so a typo cannot hide inside the document.

You must include id, type, and uri.

16 other fields are optional. Include one only when you have a real value for it.

Exact constraints
type
object
additional properties
forbidden
idrequiredid

This is not a new shape. It reuses id from the common module. Open that definition for the fields you can write.

typerequired"image" | "video" | "audio" | "font" | "svg" | "vector" | "raster" | "icon" | "lottie" | "model" | "texture" | "shader" | "document" | "animation" | "data"

Pick one of the 15 listed values. Any other value is invalid. The list is closed on purpose so tools agree on the same words.

Exact constraints
Allowed values
  • "image"
  • "video"
  • "audio"
  • "font"
  • "svg"
  • "vector"
  • "raster"
  • "icon"
  • "lottie"
  • "model"
  • "texture"
  • "shader"
  • "document"
  • "animation"
  • "data"
urirequireduri

This is not a new shape. It reuses uri from the common module. Open that definition for the fields you can write.

mediaTypestring

Write a text value.

An empty string is not allowed.

Exact constraints
type
string
min length
1
namestring

Write a text value.

An empty string is not allowed.

Exact constraints
type
string
min length
1
descriptionstring

Write a text value.

An empty string is not allowed.

Exact constraints
type
string
min length
1
widthinteger

Write a whole number.

The number must be at least 1.

Exact constraints
type
integer
minimum
1
heightinteger

Write a whole number.

The number must be at least 1.

Exact constraints
type
integer
minimum
1
durationduration

This is not a new shape. It reuses duration from the common module. Open that definition for the fields you can write.

byteLengthinteger

Write a whole number.

The number must be at least 0.

Exact constraints
type
integer
minimum
0
checksumstring

Write a text value.

An empty string is not allowed.

Exact constraints
type
string
min length
1
licensestring

Write a text value.

An empty string is not allowed.

Exact constraints
type
string
min length
1
attributionstring

Write a text value.

An empty string is not allowed.

Exact constraints
type
string
min length
1
colorSpace"srgb" | "display-p3" | "rec2020" | "linear" | "unknown"

Pick one of the 5 listed values. Any other value is invalid. The list is closed on purpose so tools agree on the same words.

Exact constraints
Allowed values
  • "srgb"
  • "display-p3"
  • "rec2020"
  • "linear"
  • "unknown"
variantsarray<object>

Write a list. Each item follows the shape described under items.

Exact constraints
type
array
itemsobject

Write an object. Only the fields named below are allowed. Unknown fields are rejected so a typo cannot hide inside the document.

You must include uri.

You may omit width, height, mediaType, quality, and platform. Leave a field out when you have nothing to say. Do not invent a placeholder.

Exact constraints
type
object
additional properties
forbidden
urirequireduri

This is not a new shape. It reuses uri from the common module. Open that definition for the fields you can write.

widthinteger

Write a whole number.

The number must be at least 1.

Exact constraints
type
integer
minimum
1
heightinteger

Write a whole number.

The number must be at least 1.

Exact constraints
type
integer
minimum
1
mediaTypestring

Write a text value.

An empty string is not allowed.

Exact constraints
type
string
min length
1
qualitynumber

Write a number. Decimals are allowed.

The number must sit between 0 and 1, including both ends.

Exact constraints
type
number
minimum
0
maximum
1
platformtaxonomy

This is not a new shape. It reuses taxonomy from the common module. Open that definition for the fields you can write.

fallbackRefid

This is not a new shape. It reuses id from the common module. Open that definition for the fields you can write.

fontobject

Write an object. Only the fields named below are allowed. Unknown fields are rejected so a typo cannot hide inside the document.

You may omit family, style, weight, and axes. Leave a field out when you have nothing to say. Do not invent a placeholder.

Exact constraints
type
object
additional properties
forbidden
familystring

Write a text value.

An empty string is not allowed.

Exact constraints
type
string
min length
1
style"normal" | "italic" | "oblique"

Pick one of the 3 listed values. Any other value is invalid. The list is closed on purpose so tools agree on the same words.

Exact constraints
Allowed values
  • "normal"
  • "italic"
  • "oblique"
weightinteger | object

More than one shape is accepted. Use exactly one of the 2 alternatives below. They are different ways to say the same kind of value.

anyOf 1integer

Write a whole number.

The number must be at least 1.

Exact constraints
type
integer
minimum
1
anyOf 2object

Write an object. Only the fields named below are allowed. Unknown fields are rejected so a typo cannot hide inside the document.

You must include min and max.

Exact constraints
type
object
additional properties
forbidden
minrequiredinteger

Write a whole number.

The number must be at least 1.

Exact constraints
type
integer
minimum
1
maxrequiredinteger

Write a whole number.

The number must be at least 1.

Exact constraints
type
integer
minimum
1
axesobject
Exact constraints
type
object
additional properties
object
additionalPropertiesobject

Write an object. Only the fields named below are allowed. Unknown fields are rejected so a typo cannot hide inside the document.

You must include min, max, and default.

Exact constraints
type
object
additional properties
forbidden
minrequirednumber

Write a number. Decimals are allowed.

Exact constraints
type
number
maxrequirednumber

Write a number. Decimals are allowed.

Exact constraints
type
number
defaultrequirednumber

Write a number. Decimals are allowed.

Exact constraints
type
number
integritystring

Write a text value.

An empty string is not allowed.

Exact constraints
type
string
min length
1
extensionsextensions

This is not a new shape. It reuses extensions from the common module. Open that definition for the fields you can write.

Smallest example

Required fields only, with placeholder values. Replace them with the real intent.

assetJSON
{  "id": {    "$ref": "common#id"  },  "type": "image",  "uri": {    "$ref": "common#uri"  }}