diff --git a/front/corpus-metadata.schema.json b/front/corpus-metadata.schema.json new file mode 100644 index 000000000..652f70aa2 --- /dev/null +++ b/front/corpus-metadata.schema.json @@ -0,0 +1,56 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://stylo.huma-num.fr/metadata.schema.json", + "title": "Metadata", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "book", + "journal" + ] + }, + "publication": { + "type": "object", + "discriminator": { + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/$defs/book" + }, + { + "$ref": "#/$defs/journal" + } + ] + } + }, + "$defs": { + "book": { + "type": "object" + }, + "journal": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "issue": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "number": { + "type": "string" + } + } + } + } + } + } +}