Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add schema for ControlInfoData.json #1630

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions WinUIGallery/DataModel/ControlInfoData.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "ControlInfoDataSchema.json",
"Groups": [
{
"UniqueId": "Design_Guidance",
Expand Down
132 changes: 132 additions & 0 deletions WinUIGallery/DataModel/ControlInfoDataSchema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"Groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"UniqueId": {
"type": "string",
"description": "Globally unique id of this group",
"uniqueItems": true
},
"Title": {
"type": "string",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably write something like "The name of the control group. Will be displayed on the control group page and navigation".

Same for the other descriptions, I think ideally we should tell the intention of the property and then tell where it is being used.

"description": "The name of the control group. Will be displayed on the control group page and navigation"
},
"Subtitle": {
"type": "string",
"description": "Not used. Can leave empty"
},
"Description": {
"type": "string",
"description": "Not used. Can leave empty"
},
"ImagePath": {
"type": "string",
"description": "Not used. Can leave empty"
},
"IconGlyph": {
"type": "string",
"description": "Glyph of this control group. Will be displayed as an icon for the NavigationViewItem of this control group"
},
"ApiNamespace": {
"type": "string",
"description": "ApiNamespace of a control group is not used. Can leave empty"
},
"IsSpecialSection": {
"type": "boolean",
"description": "Indicates that this section is not a regular control section but is added to the navigation differently",
"default": true
},
"Folder": {
"type": "string",
"description": "Use to indicate a special child item for this folder. Only used when IsSpecialSection is true"
},
"Items": {
"type": "array",
"description": "Individual control info",
"items": {
"type": "object",
"properties": {
"UniqueId": {
"type": "string",
"description": "Globally unique id of this control",
"uniqueItems": true
},
"Title": {
"type": "string",
"description": "Name of this control. Will be displayed in the overview card and on top of the control page of this control"
},
"ApiNamespace": {
"type": "string",
"description": "Namespace of this control will appear below the tile on the control's detail page'"
},
"Subtitle": {
"type": "string",
"description": "Brief usage of this control. Will be displayed on the overview card of this control"
},
"Description": {
"type": "string",
"description": "Description of this control. Will be displayed on the control page, below the Title of this control"
},
"ImagePath": {
"type": "string",
"description": "An image icon of this control. Will be displayed on the overriew card of this control. Should be a uri starts with ms-appx:///Assets/ControlImages/..."
},
"IconGlyph": {
"type": "string",
"description": "Not used. Leave empty"
},
"Content": {
"type": "string",
"description": "Not used. Leave empty"
},
"IsNew": {
"type": "boolean",
"default": true,
"description": "Whether this is a newly added control. If true, it will be displayed in the Recently Added Sample section on the main page and will have a dot on the overview card of this control"
},
"IsUpdated": {
"type": "boolean",
"default": true,
"description": "Whether the example page of this control has been updated lately. If true, it will be displayed in the Recently Updated Sample section on the main page and will have a dot on the overview card of this control"
},
"Docs": {
"type": "array",
"items": {
"type": "object",
"properties": {
"Title": {
"type": "string",
"description": "Link name that appears in the Documentation dropdown"
},
"Uri": {
"type": "string",
"description": "Documentation link url"
}
},
"required": [ "Title", "Uri" ]
},
"description": "Add a link to the doc in the Documentation dropdown on the detail page of this control"
},
"RelatedControls": {
"type": "array",
"items": {
"type": "string",
"description": "ID of the related control"
},
"description": "Array of names of the related control"
}
},
"required": [ "UniqueId", "Title"]
}
}
},
"required": [ "UniqueId", "Title", "Items" ]
}
}
}
}