-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: pushed new JSON-Schema #5
Open
chainlist
wants to merge
24
commits into
obsidianmd:main
Choose a base branch
from
chainlist:jsonschema
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
047826d
chore: pushed new JSON-Schema
af6aae7
Update schema.json
chainlist 6b0c297
Update schema.json
chainlist f6dbc6a
Update schema.json
chainlist fd792ac
Update schema.json
chainlist f5c98f5
Update schema.json
chainlist de459f4
Update schema.json
chainlist 55e2314
Update schema.json
chainlist f493d4b
Update schema.json
chainlist b80ea58
added description, change version
706ed3b
Update schema.json
chainlist 32232e6
Update schema.json
chainlist 94474b0
Update schema.json
chainlist f93ce44
Update schema.json
chainlist 60f2520
Update schema.json
chainlist 8977291
Update schema.json
chainlist 9fc0df4
Update schema.json
chainlist 084c303
Update schema.json
chainlist 793c00f
Update schema.json
chainlist b00b1bd
Update schema.json
chainlist aee96d5
Update schema.json
chainlist 9cfd89c
Update schema.json
chainlist 1c18b02
Update schema.json
chainlist bbd03fb
Update schema.json
chainlist File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,314 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"default": { | ||
"edges": [], | ||
"nodes": [] | ||
}, | ||
"properties": { | ||
"edges": { | ||
"description": "Edges are lines that connect one node to another", | ||
"items": { | ||
"$ref": "#/definitions/JSONCanvasEdge" | ||
}, | ||
"type": "array" | ||
}, | ||
"nodes": { | ||
"description": "Nodes are objects within the canvas. Nodes may be text, files, links, or groups", | ||
"items": { | ||
"$ref": "#/definitions/JSONCanvasNode" | ||
}, | ||
"type": "array" | ||
} | ||
}, | ||
"$defs": { | ||
"JSONCanvasColor": { | ||
"anyOf": [ | ||
{ | ||
"description": "A color in hex format, e.g. #ff0000", | ||
"type": "string", | ||
"pattern": "^#[0-9a-fA-F]{6}$" | ||
}, | ||
{ | ||
"$ref": "#/definitions/JSONCanvasColorPreset" | ||
} | ||
] | ||
}, | ||
"JSONCanvasColorPreset": { | ||
"title": "A preset color.", | ||
"description": "Six preset colors exist, mapped to the following numbers:\n1 red\n2 orange\n3 yellow\n4 green\n5 cyan\n6 purple", | ||
"enum": ["1", "2", "3", "4", "5", "6"], | ||
"type": "string" | ||
}, | ||
"JSONCanvasEdge": { | ||
"additionalProperties": false, | ||
"properties": { | ||
"color": { | ||
"$ref": "#/definitions/JSONCanvasColor" | ||
}, | ||
"fromNode": { | ||
"description": "The ID of the node that the edge starts from", | ||
"type": "string" | ||
}, | ||
"fromSide": { | ||
"description": "The side of the node that the edge connects from", | ||
"$ref": "#/definitions/JSONCanvasEdgeSide" | ||
}, | ||
"id": { | ||
"description": "The ID for the edge", | ||
"type": "string" | ||
}, | ||
"label": { | ||
"description": "The text label for the edge", | ||
"type": "string" | ||
}, | ||
"toEnd": { | ||
"$ref": "#/definitions/JSONCanvasEdgeEnd" | ||
}, | ||
"toNode": { | ||
"description": "The ID of the node that the edge ends at", | ||
"type": "string" | ||
}, | ||
"toSide": { | ||
"description": "The side of the node that the edge connects to", | ||
"$ref": "#/definitions/JSONCanvasEdgeSide" | ||
} | ||
}, | ||
"required": ["id", "fromNode", "toNode"], | ||
"type": "object" | ||
}, | ||
"JSONCanvasEdgeEnd": { | ||
"description": "The rendering style of the end of the edge line", | ||
"enum": ["none", "arrow"], | ||
"type": "string" | ||
}, | ||
"JSONCanvasEdgeSide": { | ||
"description": "The side of the node that the edge connects to", | ||
"enum": ["top", "right", "bottom", "left"], | ||
"type": "string" | ||
}, | ||
"JSONCanvasFileNode": { | ||
"additionalProperties": false, | ||
"properties": { | ||
"color": { | ||
"$ref": "#/definitions/JSONCanvasColor" | ||
}, | ||
"file": { | ||
"description": "The path to the file within the system", | ||
"type": "string", | ||
"minLength": 1 | ||
}, | ||
"height": { | ||
"description": "The height of the node in pixels", | ||
"type": "integer" | ||
}, | ||
"id": { | ||
"description": "Unique ID for the node", | ||
"type": "string" | ||
}, | ||
"subpath": { | ||
"description": "The subpath that may link to a heading or a block. Always starts with a #", | ||
"type": "string" | ||
}, | ||
"type": { | ||
"description": "The node type", | ||
"const": "file", | ||
"type": "string" | ||
}, | ||
"width": { | ||
"description": "The width of the node in pixels", | ||
"type": "integer" | ||
}, | ||
"x": { | ||
"description": "The x position of the node in pixels", | ||
"type": "integer" | ||
}, | ||
"y": { | ||
"description": "The y position of the node in pixels", | ||
"type": "integer" | ||
} | ||
}, | ||
"required": ["file", "height", "id", "type", "width", "x", "y"], | ||
"type": "object" | ||
}, | ||
"JSONCanvasGroupNode": { | ||
"additionalProperties": false, | ||
"properties": { | ||
"background": { | ||
"description": "The path to the background image", | ||
"type": "string" | ||
}, | ||
"backgroundStyle": { | ||
"title": "The rendering style of a background image.", | ||
"description": "Options are:\ncover - fills the entire width and height of the node.\nratio - maintains the aspect ratio of the background image.\nrepeat - repeats the image as a pattern in both x/y directions.", | ||
"enum": ["cover", "ratio", "repeat"], | ||
"type": "string" | ||
}, | ||
"color": { | ||
"$ref": "#/definitions/JSONCanvasColor" | ||
}, | ||
"height": { | ||
"description": "The height of the node in pixels", | ||
"type": "integer" | ||
}, | ||
"id": { | ||
"description": "Unique ID for the node", | ||
"type": "string" | ||
}, | ||
"label": { | ||
"description": "The text label for the group", | ||
"type": "string" | ||
}, | ||
"type": { | ||
"description": "The node type", | ||
"const": "group", | ||
"type": "string" | ||
}, | ||
"width": { | ||
"description": "The width of the node in pixels", | ||
"type": "integer" | ||
}, | ||
"x": { | ||
"description": "The x position of the node in pixels", | ||
"type": "integer" | ||
}, | ||
"y": { | ||
"description": "The y position of the node in pixels", | ||
"type": "integer" | ||
} | ||
}, | ||
"required": ["height", "id", "type", "width", "x", "y"], | ||
"type": "object" | ||
}, | ||
"JSONCanvasLinkNode": { | ||
"additionalProperties": false, | ||
"properties": { | ||
"color": { | ||
"$ref": "#/definitions/JSONCanvasColor" | ||
}, | ||
"height": { | ||
"description": "The height of the node in pixels", | ||
"type": "integer" | ||
}, | ||
"id": { | ||
"description": "Unique ID for the node", | ||
"type": "string" | ||
}, | ||
"type": { | ||
"description": "The node type", | ||
"const": "link", | ||
"type": "string" | ||
}, | ||
"url": { | ||
"type": "string" | ||
}, | ||
"width": { | ||
"description": "The width of the node in pixels", | ||
"type": "number" | ||
chainlist marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
"x": { | ||
"description": "The x position of the node in pixels", | ||
"type": "number" | ||
chainlist marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
"y": { | ||
"description": "The y position of the node in pixels", | ||
"type": "integer" | ||
} | ||
}, | ||
"required": ["height", "id", "type", "url", "width", "x", "y"], | ||
"type": "object" | ||
}, | ||
"JSONCanvasNode": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/JSONCanvasNodeGeneric" | ||
}, | ||
{ | ||
"$ref": "#/definitions/JSONCanvasTextNode" | ||
}, | ||
{ | ||
"$ref": "#/definitions/JSONCanvasFileNode" | ||
}, | ||
{ | ||
"$ref": "#/definitions/JSONCanvasLinkNode" | ||
}, | ||
{ | ||
"$ref": "#/definitions/JSONCanvasGroupNode" | ||
} | ||
] | ||
}, | ||
"JSONCanvasNodeGeneric": { | ||
"additionalProperties": false, | ||
"properties": { | ||
"color": { | ||
"$ref": "#/definitions/JSONCanvasColor" | ||
}, | ||
"height": { | ||
"description": "The height of the node in pixels", | ||
"type": "integer" | ||
}, | ||
"id": { | ||
"description": "Unique ID for the node", | ||
"type": "string" | ||
}, | ||
"type": { | ||
"description": "The node type", | ||
"enum": ["text", "file", "link", "group"], | ||
"type": "string" | ||
}, | ||
"width": { | ||
"description": "The width of the node in pixels", | ||
"type": "integer" | ||
}, | ||
"x": { | ||
"description": "The x position of the node in pixels", | ||
"type": "integer" | ||
}, | ||
"y": { | ||
"description": "The y position of the node in pixels", | ||
"type": "integer" | ||
} | ||
}, | ||
"required": ["id", "type", "x", "y", "width", "height"], | ||
"type": "object" | ||
}, | ||
"JSONCanvasTextNode": { | ||
"additionalProperties": false, | ||
"properties": { | ||
"color": { | ||
"$ref": "#/definitions/JSONCanvasColor" | ||
}, | ||
"height": { | ||
"description": "The height of the node in pixels", | ||
"type": "number" | ||
chainlist marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
"id": { | ||
"description": "Unique ID for the node", | ||
"type": "string" | ||
}, | ||
"text": { | ||
"description": "Plain text with Markdown syntax", | ||
"type": "string" | ||
}, | ||
"type": { | ||
"description": "The node type", | ||
"const": "text", | ||
"type": "string" | ||
}, | ||
"width": { | ||
"description": "The width of the node in pixels", | ||
"type": "number" | ||
chainlist marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
"x": { | ||
"description": "The x position of the node in pixels", | ||
"type": "number" | ||
chainlist marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
"y": { | ||
"description": "The y position of the node in pixels", | ||
"type": "number" | ||
chainlist marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
}, | ||
"required": ["height", "id", "text", "type", "width", "x", "y"], | ||
"type": "object" | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define a
NodeId
schema. That will help to give semantic info to properties likefromNode
.