Skip to content

Add schema for validation #9

@danlooo

Description

@danlooo

Mandarory fields:

  • users
  • expiration_date
  • group_leader

Optional fileds:

  • labels
  • every other filed

schema.yml:

# JSON Schema for metayaml files

schema: https://json-schema.org/draft/2020-12/schema
id: bgc-jena.mpg.de/metayaml/schema
title: Metayaml schema
description: Attributes of files and directories stored in YAML sidecar files
type: object
properties:
  description:
    type: string
  responsible:
    type: string
  users:
    type: array
    items:
      type: string
  expires:
    anyOf:
      - type: string
        pattern: "^([0-9]+-?)+$"
      - type: number
  labels:
    type: array
    items:
      type: string
required:
  - description
  - responsible
  - expires

good.yml:

description: test
responsible: fgans
expires: 2024-07
users:
  - dloos
  - fgans
labels:
  - project_1
  - high_res
  - esa
foo: 1
bar: baz

bad.yml:

description: test
foo: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions