Skip to content

Commit

Permalink
src/schemas/json: fix spurious $id definitions (#4074)
Browse files Browse the repository at this point in the history
This removes `$id` definitions from schemas where
those IDs are defining schemas outside of the schema URI itself.

The problem this is fixing is summarized in #4073.

Fixes #4073.
  • Loading branch information
rogpeppe authored Sep 22, 2024
1 parent 7aef5ae commit 215d9f4
Show file tree
Hide file tree
Showing 13 changed files with 4 additions and 304 deletions.
22 changes: 4 additions & 18 deletions src/schemas/json/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,38 @@
"$id": "https://json.schemastore.org/base.json",
"definitions": {
"nullable-array": {
"$id": "nullable-array",
"type": ["array", "null"]
},
"nullable-boolean": {
"$id": "nullable-boolean",
"type": ["boolean", "null"]
},
"nullable-integer": {
"$id": "nullable-integer",
"type": ["integer", "null"]
},
"nullable-number": {
"$id": "nullable-number",
"type": ["number", "null"]
},
"nullable-object": {
"$id": "nullable-object",
"type": ["object", "null"]
},
"nullable-string": {
"$id": "nullable-string",
"type": ["string", "null"]
},
"path": {
"$id": "path",
"type": "string",
"minLength": 1
},
"nullable-path": {
"$id": "nullable-path",
"oneOf": [
{
"$ref": "path"
"$ref": "#/definitions/path"
},
{
"type": "null"
}
]
},
"editor": {
"$id": "editor",
"type": "string",
"oneOf": [
{
Expand All @@ -53,29 +44,26 @@
]
},
"nullable-editor": {
"$id": "nullable-editor",
"oneOf": [
{
"$ref": "editor"
"$ref": "#/definitions/editor"
},
{
"type": "null"
}
]
},
"license": {
"$id": "license",
"anyOf": [
{
"$ref": "osi-license"
"$ref": "#/definitions/osi-license"
},
{
"type": "string"
}
]
},
"osi-license": {
"$id": "spdx-license",
"$comment": "Extracted on January 15, 2024.",
"type": "string",
"enum": [
Expand Down Expand Up @@ -225,7 +213,6 @@
]
},
"timezone": {
"$id": "timezone",
"type": "string",
"enum": [
"Africa/Abidjan",
Expand Down Expand Up @@ -814,10 +801,9 @@
]
},
"nullable-timezone": {
"$id": "nullable-timezone",
"oneOf": [
{
"$ref": "timezone"
"$ref": "#/definitions/timezone"
},
{
"type": "null"
Expand Down
12 changes: 0 additions & 12 deletions src/schemas/json/catalog-info.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"anyOf": [
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "ApiV1alpha1",
"description": "An API describes an interface that can be exposed by a component. The API can be defined in different formats, like OpenAPI, AsyncAPI, GraphQL, gRPC, or other formats.",
"examples": [
{
Expand Down Expand Up @@ -102,7 +101,6 @@
},
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "ComponentV1alpha1",
"description": "A Component describes a software component. It is typically intimately linked to the source code that constitutes the component, and should be what a developer may regard a \"unit of software\", usually with a distinct deployable or linkable artifact.",
"examples": [
{
Expand Down Expand Up @@ -203,7 +201,6 @@
},
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "DomainV1alpha1",
"description": "A Domain groups a collection of systems that share terminology, domain models, business purpose, or documentation, i.e. form a bounded context.",
"examples": [
{
Expand Down Expand Up @@ -250,7 +247,6 @@
},
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "GroupV1alpha1",
"description": "A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.",
"examples": [
{
Expand Down Expand Up @@ -354,7 +350,6 @@
},
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "LocationV1alpha1",
"description": "A location is a marker that references other places to look for catalog data.",
"examples": [
{
Expand Down Expand Up @@ -422,7 +417,6 @@
},
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "ResourceV1alpha1",
"description": "A resource describes the infrastructure a system needs to operate, like BigTable databases, Pub/Sub topics, S3 buckets or CDNs. Modelling them together with components and systems allows to visualize resource footprint, and create tooling around them.",
"examples": [
{
Expand Down Expand Up @@ -490,7 +484,6 @@
},
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "SystemV1alpha1",
"description": "A system is a collection of resources and components. The system may expose or consume one or several APIs. It is viewed as abstraction level that provides potential consumers insights into exposed features without needing a too detailed view into the details of all components. This also gives the owning team the possibility to decide about published artifacts and APIs.",
"examples": [
{
Expand Down Expand Up @@ -544,7 +537,6 @@
},
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "TemplateV1beta2",
"description": "A Template describes a scaffolding task for use with the Scaffolder. It describes the required parameters as well as a series of steps that will be taken to execute the scaffolding task.",
"examples": [
{
Expand Down Expand Up @@ -728,7 +720,6 @@
},
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "UserV1alpha1",
"description": "A user describes a person, such as an employee, a contractor, or similar. Users belong to Group entities in the catalog. These catalog user entries are connected to the way that authentication within the Backstage ecosystem works. See the auth section of the docs for a discussion of these concepts.",
"examples": [
{
Expand Down Expand Up @@ -810,7 +801,6 @@
"definitions": {
"entity": {
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "Entity",
"description": "The parts of the format that's common to all versions/kinds of entity.",
"examples": [
{
Expand Down Expand Up @@ -861,7 +851,6 @@
},
"metadata": {
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "EntityMeta",
"description": "Metadata fields common to all versions/kinds of entity.",
"examples": [
{
Expand Down Expand Up @@ -1015,7 +1004,6 @@
},
"common": {
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "common",
"type": "object",
"description": "Common definitions to import from other schemas",
"definitions": {
Expand Down
35 changes: 0 additions & 35 deletions src/schemas/json/cryproj.52.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"$comment": "JSON Schema for CRYENGINE 5.2",
"definitions": {
"cvars": {
"$id": "/definitions/cvars",
"type": "string",
"title": "Variable name",
"description": "CVar name",
Expand Down Expand Up @@ -2454,7 +2453,6 @@
]
},
"commands": {
"$id": "/definitions/commands",
"type": "string",
"title": "Command name",
"description": "Console command name",
Expand Down Expand Up @@ -2647,19 +2645,15 @@
"id": "https://json.schemastore.org/cryproj.52.schema",
"properties": {
"console_variables": {
"$id": "/properties/console_variables",
"type": "array",
"uniqueItems": true,
"items": {
"$id": "/properties/console_variables/items",
"type": "object",
"properties": {
"name": {
"$id": "/properties/console_variables/items/properties/name",
"$ref": "#/definitions/cvars"
},
"value": {
"$id": "/properties/console_variables/items/properties/value",
"type": "string",
"title": "Value of the CVar",
"description": "The default value of the CVar",
Expand All @@ -2670,14 +2664,11 @@
}
},
"content": {
"$id": "/properties/content",
"type": "object",
"properties": {
"assets": {
"$id": "/properties/content/properties/assets",
"type": "array",
"items": {
"$id": "/properties/content/properties/assets/items",
"type": "string",
"title": "Assets folder",
"description": "This indicates where the assets are stored",
Expand All @@ -2686,10 +2677,8 @@
}
},
"code": {
"$id": "/properties/content/properties/code",
"type": "array",
"items": {
"$id": "/properties/content/properties/code/items",
"type": "string",
"title": "Code folder",
"description": "This indicates where the code is stored",
Expand All @@ -2698,39 +2687,32 @@
}
},
"libs": {
"$id": "/properties/content/properties/libs",
"type": "array",
"items": {
"$id": "/properties/content/properties/libs/items",
"type": "object",
"properties": {
"name": {
"$id": "/properties/content/properties/libs/items/properties/name",
"type": "string",
"title": "Lib's name",
"default": "",
"examples": ["Blank"]
},
"shared": {
"$id": "/properties/content/properties/libs/items/properties/shared",
"type": "object",
"properties": {
"any": {
"$id": "/properties/content/properties/libs/items/properties/shared/properties/any",
"type": "string",
"title": "Lib's name to import for all the supported platforms",
"default": "",
"examples": ["CryGameSDK"]
},
"win_x64": {
"$id": "/properties/content/properties/libs/items/properties/shared/properties/win_x64",
"type": "string",
"title": "Lib's name to import for the win_x64 platform",
"default": "",
"examples": ["bin/win_x64/Game.dll"]
},
"win_x86": {
"$id": "/properties/content/properties/libs/items/properties/shared/properties/win_x86",
"type": "string",
"title": "Lib's name to import for the win_x86 platform",
"default": "",
Expand All @@ -2745,19 +2727,16 @@
"required": ["code"]
},
"info": {
"$id": "/properties/info",
"type": "object",
"properties": {
"name": {
"$id": "/properties/info/properties/name",
"type": "string",
"title": "Project name",
"description": "This indicates the project name",
"default": "",
"examples": ["MyFancyProject"]
},
"guid": {
"$id": "/properties/info/properties/guid",
"type": "string",
"title": "Project GUID",
"default": "",
Expand All @@ -2767,11 +2746,9 @@
"required": ["name"]
},
"require": {
"$id": "/properties/require",
"type": "object",
"properties": {
"engine": {
"$id": "/properties/require/properties/engine",
"type": "string",
"title": "Engine version",
"description": "This indicates which engine version will be used",
Expand All @@ -2780,14 +2757,11 @@
"enum": ["engine-5.2"]
},
"plugins": {
"$id": "/properties/require/properties/plugins",
"type": "array",
"items": {
"$id": "/properties/require/properties/plugins/items",
"type": "object",
"properties": {
"path": {
"$id": "/properties/require/properties/plugins/items/properties/path",
"type": "string",
"title": "Plugin name",
"description": "Required plugin's name",
Expand All @@ -2803,7 +2777,6 @@
]
},
"type": {
"$id": "/properties/require/properties/plugins/items/properties/type",
"type": "string",
"title": "Plugin type",
"description": "EPluginType::Native if it's a C++ plugin, EPluginType::Managed if it's a C# one",
Expand All @@ -2812,10 +2785,8 @@
"enum": ["EPluginType::Native", "EPluginType::Managed"]
},
"platforms": {
"$id": "/properties/plugins/items/properties/platforms",
"type": "array",
"items": {
"$id": "/properties/plugins/items/properties/platforms/items",
"type": "string",
"title": "This plugin will be used only by these platforms",
"default": "",
Expand All @@ -2831,33 +2802,27 @@
"required": ["engine"]
},
"type": {
"$id": "/properties/type",
"type": "string",
"title": "",
"default": "",
"examples": [""]
},
"version": {
"$id": "/properties/version",
"type": "integer",
"title": "Project version",
"default": 1,
"examples": [1]
},
"console_commands": {
"$id": "/properties/console_commands",
"type": "array",
"uniqueItems": true,
"items": {
"$id": "/properties/console_commands/items",
"type": "object",
"properties": {
"name": {
"$id": "/properties/console_commands/items/properties/name",
"$ref": "#/definitions/commands"
},
"value": {
"$id": "/properties/console_commands/items/properties/value",
"type": "string",
"title": "Value of the command",
"description": "Arguments that has to be passed to the command. Leave empty if it has not parameters",
Expand Down
Loading

0 comments on commit 215d9f4

Please sign in to comment.