Skip to content

Commit

Permalink
generator: Add json schema for metadata file
Browse files Browse the repository at this point in the history
  • Loading branch information
zml2008 committed Sep 11, 2022
1 parent d6b13a4 commit caab7cd
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
71 changes: 71 additions & 0 deletions _generator/metadata.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://jd.spongepowered.org/schema/metadata.schema.json",
"title": "Javadoc Index Metadata File",
"description": "A metdatadata file describing projects included in a generated Javadoc index.",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A title for the index page"
},
"$schema": true,
"components": {
"type": "object",
"description": "Metadata for a single component",
"additionalProperties": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A user-readable name"
},
"url": {
"type": "string",
"description": "A URl to link the component name to"
},
"group": {
"type": "string",
"description": "A module group for display -- null for top level"
},
"snapshot-regex": {
"type": "string",
"description": "A regular expression to determine if a version should be considered a snapshot",
"default": ".+-SNAPSHOT$"
}
},
"additionalProperties": false
}
},
"groups": {
"type": "object",
"description": "Metadata for groups of components",
"additionalProperties": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A display name for this group"
},
"description": {
"type": "string",
"description": "A longer description for this project group"
},
"url": {
"type": "string",
"description": "A URL to link the display name of the group to"
},
"from-directory": {
"type": "boolean",
"description": "If subdirectories of a directory matching the group's name should be picked up as modules associated with the group"
}
},
"additionalProperties": false
}
}
},
"required": [
"components",
"groups"
]
}
2 changes: 2 additions & 0 deletions metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=./_generator/metadata.schema.json
$schema: ./_generator/metadata.schema.json
name: Sponge Javadoc

# Extra component metadata
Expand Down

0 comments on commit caab7cd

Please sign in to comment.