Skip to content
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

Add schema for dotnet-tools.json manifest file #3517

Merged
Merged
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
6 changes: 6 additions & 0 deletions src/api/json/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,12 @@
"fileMatch": ["dotnet-release-index.json"],
"url": "https://json.schemastore.org/dotnet-releases-index.json"
},
{
"name": "dotnet-tools.json",
"description": ".NET tools manifest file",
"fileMatch": ["dotnet-tools.json"],
"url": "https://json.schemastore.org/dotnet-tools.json"
},
{
"name": "dotnetcli.host.json",
"description": ".NET CLI template host files",
Expand Down
5 changes: 5 additions & 0 deletions src/schema-validation.json
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,11 @@
"unknownKeywords": ["examples"]
}
},
{
"dotnet-tools.json": {
"unknownKeywords": ["allowTrailingCommas"]
}
},
{
"drone.json": {
"unknownKeywords": [
Expand Down
51 changes: 51 additions & 0 deletions src/schemas/json/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://json.schemastore.org/dotnet-tools.json",
"allowTrailingCommas": false,
"type": "object",
"required": ["version", "isRoot", "tools"],
"additionalProperties": true,
"properties": {
"version": {
"type": "integer",
"title": ".NET Tools Manifest Version",
"description": "Specifies the version of the local tool manifest file format."
},
"isRoot": {
"type": "boolean",
"title": "Root/Top-Most Manifest File Indicator",
"description": "Indicates whether this is the root manifest file. If true, dotnet will not continue to search parent directories for additional dotnet-tools.json files."
},
"tools": {
"type": "object",
"title": "Local Tools",
"description": "Mappings of .NET CLI tools that are available locally for the project. Each entry specifies a tool accessible by its NuGet package ID.",
"patternProperties": {
"^.*$": {
"type": "object",
"title": "Tool Configuration",
"description": "Represents a single .NET CLI tool with its specific settings and commands.",
"required": ["version", "commands"],
"additionalProperties": true,
"properties": {
"version": {
"type": ["string", "null"],
"title": "Tool NuGet Version",
"description": "Specifies the version of the NuGet package of the tool. If null, the latest version will be used."
},
"commands": {
"type": ["array", "null"],
"title": "Available Tool Commands",
"description": "Lists all of the available commands provided by this tool. The way to invoke a command depends on the naming format of its executable. If the command is in the format `dotnet-<toolName>`, it should be invoked using 'dotnet <toolName>'. If the command is in the format '<toolName>', it can be directly invoked using just '<toolName>'. If null, no specific commands are specified.",
"items": {
"type": ["string", "null"],
"title": "Tool Command",
"description": "A command made available by this tool which can be invoked according to the naming convention of its executable. If the command is in the format `dotnet-<toolName>`, it should be invoked using 'dotnet <toolName>'. If the command is in the format '<toolName>', it can be directly invoked using just '<toolName>'. If null, no specific commands are specified."
}
}
}
}
}
}
}
}
10 changes: 10 additions & 0 deletions src/test/dotnet-tools/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"isRoot": true,
"tools": {
"dotnet-ef": {
"commands": ["dotnet-ef"],
"version": "8.0.1"
}
},
"version": 1
}