From 28af02440a0b5473e1f73264678e4bf2e910bd85 Mon Sep 17 00:00:00 2001 From: Matthew Rich Date: Tue, 2 Apr 2024 13:33:49 -0700 Subject: [PATCH] add schemas --- internal/resource/schemas/document.jsonschema | 16 +++++++ internal/resource/schemas/file.jsonschema | 48 +++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 internal/resource/schemas/document.jsonschema create mode 100644 internal/resource/schemas/file.jsonschema diff --git a/internal/resource/schemas/document.jsonschema b/internal/resource/schemas/document.jsonschema new file mode 100644 index 0000000..3463a34 --- /dev/null +++ b/internal/resource/schemas/document.jsonschema @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "document", + "type": "object", + "required": [ "resources" ], + "properties": { + "resources": { + "type": "array", + "description": "Resources list", + "items": { + "type": "object" + } + } + } +} + diff --git a/internal/resource/schemas/file.jsonschema b/internal/resource/schemas/file.jsonschema new file mode 100644 index 0000000..5f0d4db --- /dev/null +++ b/internal/resource/schemas/file.jsonschema @@ -0,0 +1,48 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "file", + "type": "object", + "required": [ "path", "filetype" ], + "properties": { + "path": { + "type": "string" + }, + "owner": { + "type": "string" + }, + "group": { + "type": "string" + }, + "mode": { + "type": "string" + }, + "atime": { + "type": "string", + "format": "date-time", + "description": "file access time in YYYY-MM-DDTHH:MM:SS.sssssssssZ format." + }, + "ctime": { + "type": "string", + "format": "date-time", + "description": "file change time in YYYY-MM-DDTHH:MM:SS.sssssssssZ format." + }, + "mtime": { + "type": "string", + "format": "date-time", + "description": "file modified time in YYYY-MM-DDTHH:MM:SS.sssssssssZ format." + }, + "content": { + "type": "string", + "description": "file content" + }, + "target": { + "type": "string", + "description": "Symbolic link target path" + }, + "filetype": { + "type": "string", + "description": "file type", + "enum": [ "regular", "directory", "block", "char", "pipe", "symlink", "socket" ] + } + } +}