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 1 commit
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": "Title appears on the control group page"
},
"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": "Appears 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": "Special section is hard-coded in NavigationRootPage.xaml",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"description": "Special section is hard-coded in NavigationRootPage.xaml",
"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": "Title appears on the overview card and 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": "Subtitle appears on the overview card of this control"
},
"Description": {
"type": "string",
"description": "Appears on the control page"
},
"ImagePath": {
"type": "string",
"description": "Appears as the image of this control on the overriew card. 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": "Show on the Recently Added Sample section on the main page and will add a dot on the overview card of this control"
},
"IsUpdated": {
"type": "boolean",
"default": true,
"description": "Show on the Recently Updated Sample section on the main page and will add 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": "Name of the related control"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"description": "Name of the related control"
"description": "ID of the related control"

},
"description": "Array of names of the related control"
}
},
"required": [ "UniqueId", "Title"]
}
}
},
"required": [ "UniqueId", "Title", "Items" ]
}
}
}
}