content, use primary types, move title to defs

So I sort of used "object" instead of "record" because I thought key was
an option type ^_^

So I had to fix that.

Also moves title to defs because it is not supposed to be a record
This commit is contained in:
Julia Lange 2025-05-07 16:20:28 -07:00
parent 60262fed0c
commit 0beee2c8d0
Signed by: Julia
SSH key fingerprint: SHA256:50XUMcOFYPUs9/1j7p9SPnwASZ7QnxXm7THF7HkbqzQ
4 changed files with 83 additions and 72 deletions

View file

@ -0,0 +1,31 @@
{
"lexicon": 1,
"id": "my.spoor.content.defs",
"defs": {
"title": {
"type": "object",
"properties": {
"translationType": {
"type": "string",
"format": "nsid",
"knownValues": [
"my.spoor.content.defs#titleHomophonic",
"my.spoor.content.defs#titleNative",
"my.spoor.content.defs#titleTranslation"
]
},
"lang": {
"type": "string",
"format": "language"
},
"value": { "type": "string", "minLength": 1 }
}
},
"titleHomophonic": { "type": "token",
"description": "A phonetic transcription of the native title such that when read it will sound like the native title." },
"titleNative": { "type": "token",
"description": "The title in its native script" },
"titleTranslation": { "type": "token",
"description": "A translation of the title" }
}
}

View file

@ -3,26 +3,30 @@
"id": "my.spoor.content.external", "id": "my.spoor.content.external",
"defs": { "defs": {
"main": { "main": {
"type": "object", "type": "record",
"required": [ "source", "queryable" ],
"key": "nsid", "key": "nsid",
"properties": { "record": {
"source": { "type": "object",
"type": "string", "required": [ "source", "queryable" ],
"description": "An nsid for a specific data source. The domain authority governs how to process the queryable", "properties": {
"format": "nsid", "source": {
"knownValues": [ "type": "string",
"my.spoor.content.external#tvdb" "description": "An nsid for a specific data source. The domain authority governs how to process the queryable",
] "format": "nsid",
}, "knownValues": [
"queryable": { "my.spoor.content.external#tvdb"
"type": "union", ]
"description": "All the data needed to query the content from the source" },
}, "queryable": {
"overrides": { "type": "union",
"type": "object", "description": "All the data needed to query the content from the source",
"description": "User defined overrides for the returned content", "refs": []
"properties": {} },
"overrides": {
"type": "union",
"description": "User defined overrides for the returned content",
"refs": []
}
} }
} }
} }

View file

@ -3,34 +3,37 @@
"id": "my.spoor.content.media", "id": "my.spoor.content.media",
"defs": { "defs": {
"main": { "main": {
"type": "object", "type": "record",
"key": "nsid", "key": "nsid",
"required": [ "titles", "durationData", "lastUpdated" ], "record": {
"properties": { "type": "object",
"titles": { "required": [ "titles", "lastUpdated" ],
"type": "array", "properties": {
"minLength": 1, "titles": {
"items": { "type": "array",
"type": "ref", "minLength": 1,
"ref": "my.spoor.content.title" "items": {
"type": "ref",
"ref": "my.spoor.content.defs#title"
}
},
"durationData": {
"type": "union",
"refs": [
"my.spoor.content.media#television",
"my.spoor.content.media#book"
]
},
"posterImage": {
"type": "blob",
"accept": ["image/png", "image/jpeg"],
"maxSize": 1000000
},
"lastUpdated": {
"type": "string",
"format": "datetime",
"description": "Client-declared timestamp for when this activity was last updated"
} }
},
"durationData": {
"type": "union",
"refs": [
"my.spoor.content.media#television",
"my.spoor.content.media#book"
]
},
"posterImage": {
"type": "blob",
"accept": ["image/png", "image/jpeg"],
"maxSize": 1000000
},
"lastUpdated": {
"type": "string",
"format": "datetime",
"description": "Client-declared timestamp for when this activity was last updated"
} }
} }
}, },

View file

@ -1,27 +0,0 @@
{
"lexicon": 1,
"id": "my.spoor.content.title",
"defs": {
"main": {
"type": "object",
"properties": {
"language": {
"type": "string",
"format": "nsid",
"knownValues": [
"my.spoor.content.title#romanization",
"my.spoor.content.title#english",
"my.spoor.content.title#native"
]
},
"value": { "type": "string", "minLength": 1 }
}
},
"romanization": { "type": "token",
"description": "Romanization of the native title" },
"english": { "type": "token",
"description": "English translation or title" },
"native": { "type": "token",
"description": "Native title" }
}
}