-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Font Library: Add font collection JSON schema (#57736)
* move font family to their on definition * adding font-collection.json schema * adding settings * updating README * update property name * resolve json schema references * throw error on definition not found * add description * disallow additional properties * fix typo in function name Co-authored-by: Jeff Ong <jonger4@gmail.com> * fix typo in function name Co-authored-by: Jeff Ong <jonger4@gmail.com> * fix wording Co-authored-by: Jeff Ong <jonger4@gmail.com> * remove unwanted comment Co-authored-by: Jeff Ong <jonger4@gmail.com> * format js --------- Co-authored-by: Jeff Ong <jonger4@gmail.com>
- Loading branch information
1 parent
d439f8b
commit b41c08f
Showing
4 changed files
with
236 additions
and
119 deletions.
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
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,59 @@ | ||
{ | ||
"title": "JSON schema for WordPress Font Collections", | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"type": "object", | ||
"properties": { | ||
"$schema": { | ||
"description": "JSON schema URI for font-collection.json.", | ||
"type": "string" | ||
}, | ||
"version": { | ||
"description": "Version of font-collection.json schema to use.", | ||
"type": "integer", | ||
"enum": [ 1 ] | ||
}, | ||
"font_families": { | ||
"type": "array", | ||
"description": "Array of font families ready to be installed", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"font_family_settings": { | ||
"description": "Font family settings as in theme.json", | ||
"allOf": [ | ||
{ "$ref": "./theme.json#/definitions/fontFamily" } | ||
] | ||
}, | ||
"categories": { | ||
"type": "array", | ||
"description": "Array of category slugs", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"required": [ "font_family_settings" ], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"categories": { | ||
"type": "array", | ||
"description": "Array of category objects", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"slug": { | ||
"type": "string" | ||
}, | ||
"name": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ "slug", "name" ], | ||
"additionalProperties": false | ||
} | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": [ "$schema", "version", "font_families" ] | ||
} |
Oops, something went wrong.