Skip to content

Commit

Permalink
Add jsonschema annotations for metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Graeme Smecher committed Dec 13, 2024
1 parent e3cd47b commit 0f5d129
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions tuber/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,30 @@
"title": "method metadata",
"type": "object",
"properties": {
"__doc__": {
"oneOf": [
{"type": "string"},
{"type": "null"},
],
"__doc__": {"oneOf": [{"type": "string"}, {"type": "null"}]},
"__signature__": {
"type": "object",
"properties": {
"parameters": {
"type": "array",
"items": {
"type": "object",
"properties": {
"annotation": {"type": "string"},
"kind": {"type": "number"},
"name": {"type": "string"},
"default": {"type": ["string", "number", "object", "array", "boolean", "null"]},
},
"additionalProperties": False,
},
},
"return_annotation": {"type": "string"},
},
"additionalProperties": False,
},
# argument descriptor goes here
},
"additionalProperties": True,
"additionalProperties": False,
}

# Description of an object
Expand Down Expand Up @@ -102,10 +117,7 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "root metadata",
"type": "object",
"properties": {
"objects": metadata_object,
"additionalProperties": False,
},
"additionalProperties": metadata_object,
}

"""
Expand Down

0 comments on commit 0f5d129

Please sign in to comment.