From c8c10d5955e794bf68ec12c2cba501b06ff6e625 Mon Sep 17 00:00:00 2001 From: jaimergp Date: Mon, 25 Nov 2024 11:18:14 +0100 Subject: [PATCH] Use $schema and $id in the right way --- menuinst/_schema.py | 47 +- menuinst/data/menuinst-1.default.json | 68 ++ menuinst/data/menuinst-1.schema.json | 734 ++++++++++++++++++ tests/data/jsons/entitlements.json | 3 +- tests/data/jsons/example-3.invalid.json | 3 +- tests/data/jsons/file_types.json | 3 +- .../jsons/file_types_no_event_handler.json | 3 +- tests/data/jsons/menu-name.json | 3 +- tests/data/jsons/no-platforms.json | 3 +- tests/data/jsons/osx_symlinks.json | 3 +- tests/data/jsons/precommands.json | 3 +- tests/data/jsons/sys-prefix.json | 3 +- tests/data/jsons/url_protocols.json | 3 +- tests/data/jsons/windows-terminal.json | 3 +- tests/data/jsons/working-dir.json | 3 +- 15 files changed, 841 insertions(+), 44 deletions(-) create mode 100644 menuinst/data/menuinst-1.default.json create mode 100644 menuinst/data/menuinst-1.schema.json diff --git a/menuinst/_schema.py b/menuinst/_schema.py index 560de6b3..2f746ec3 100644 --- a/menuinst/_schema.py +++ b/menuinst/_schema.py @@ -20,6 +20,9 @@ log = getLogger(__name__) +SCHEMA_DIALECT = "http://json-schema.org/draft-07/schema#" +SCHEMA_VERSION = "1" +SCHEMA_URL = f"https://schemas.conda.org/menuinst-{SCHEMA_VERSION}.schema.json" class BaseModel(_BaseModel): @@ -398,14 +401,21 @@ class MenuItem(BaseModel): class MenuInstSchema(BaseModel): "Metadata required to create menu items across operating systems with ``menuinst``." - id_: Literal["https://schemas.conda.io/menuinst-1.schema.json"] = Field( - ..., - description="Version of the menuinst schema.", + class Config(BaseModel.Config): + schema_extra = { + "$schema": SCHEMA_DIALECT, + "$id": SCHEMA_URL, + } + + id_: constr(min_length=1) = Field( + SCHEMA_URL, + description="DEPRECATED. Use ``$schema``.", alias="$id", + deprecated=True, ) - schema_: Literal["https://json-schema.org/draft-07/schema"] = Field( - ..., - description="Standard of the JSON schema we adhere to.", + schema_: constr(min_length=1) = Field( + SCHEMA_URL, + description="Version of the menuinst schema.", alias="$schema", ) menu_name: constr(min_length=1) = ... @@ -415,14 +425,15 @@ class MenuInstSchema(BaseModel): def dump_schema_to_json(write=True): + schema = MenuInstSchema.schema() if write: here = Path(__file__).parent - schema = MenuInstSchema.schema_json(indent=2) - print(schema) - with open(here / "data" / "menuinst.schema.json", "w") as f: - f.write(schema) + schema_str = json.dumps(schema, indent=2) + print(schema_str) + with open(here / "data" / f"menuinst-{SCHEMA_VERSION}.schema.json", "w") as f: + f.write(schema_str) f.write("\n") - return MenuInstSchema.schema() + return schema def dump_default_to_json(write=True): @@ -435,21 +446,17 @@ def dump_default_to_json(write=True): "osx": MacOS().dict(), "linux": Linux().dict(), } - default = MenuInstSchema( - menu_name="REQUIRED", - menu_items=[default_item], - **{ - "$id": "https://schemas.conda.io/menuinst-1.schema.json", - "$schema": "https://json-schema.org/draft-07/schema", - }, - ).dict() + default = MenuInstSchema(menu_name="REQUIRED", menu_items=[default_item]).dict() + default["$schema"] = SCHEMA_URL + default.pop("id_", None) + default.pop("schema_", None) for platform_value in default["menu_items"][0]["platforms"].values(): for key in list(platform_value.keys()): if key in MenuItem.__fields__: platform_value.pop(key) if write: pprint(default) - with open(here / "data" / "menuinst.default.json", "w") as f: + with open(here / "data" / f"menuinst-{SCHEMA_VERSION}.default.json", "w") as f: json.dump(default, f, indent=2) f.write("\n") return default diff --git a/menuinst/data/menuinst-1.default.json b/menuinst/data/menuinst-1.default.json new file mode 100644 index 00000000..0f0efd32 --- /dev/null +++ b/menuinst/data/menuinst-1.default.json @@ -0,0 +1,68 @@ +{ + "menu_name": "REQUIRED", + "menu_items": [ + { + "name": "REQUIRED", + "description": "REQUIRED", + "command": [ + "REQUIRED" + ], + "icon": null, + "precommand": null, + "precreate": null, + "working_dir": null, + "activate": true, + "terminal": false, + "platforms": { + "linux": { + "Categories": null, + "DBusActivatable": null, + "GenericName": null, + "Hidden": null, + "Implements": null, + "Keywords": null, + "MimeType": null, + "NoDisplay": null, + "NotShowIn": null, + "OnlyShowIn": null, + "PrefersNonDefaultGPU": null, + "SingleMainWindow": null, + "StartupNotify": null, + "StartupWMClass": null, + "TryExec": null, + "glob_patterns": null + }, + "osx": { + "CFBundleDisplayName": null, + "CFBundleIdentifier": null, + "CFBundleName": null, + "CFBundleSpokenName": null, + "CFBundleVersion": null, + "CFBundleURLTypes": null, + "CFBundleDocumentTypes": null, + "LSApplicationCategoryType": null, + "LSBackgroundOnly": null, + "LSEnvironment": null, + "LSMinimumSystemVersion": null, + "LSMultipleInstancesProhibited": null, + "LSRequiresNativeExecution": null, + "NSSupportsAutomaticGraphicsSwitching": null, + "UTExportedTypeDeclarations": null, + "UTImportedTypeDeclarations": null, + "entitlements": null, + "link_in_bundle": null, + "event_handler": null + }, + "win": { + "desktop": true, + "quicklaunch": false, + "terminal_profile": null, + "url_protocols": null, + "file_extensions": null, + "app_user_model_id": null + } + } + } + ], + "$schema": "https://schemas.conda.org/menuinst-1.schema.json" +} diff --git a/menuinst/data/menuinst-1.schema.json b/menuinst/data/menuinst-1.schema.json new file mode 100644 index 00000000..d3131330 --- /dev/null +++ b/menuinst/data/menuinst-1.schema.json @@ -0,0 +1,734 @@ +{ + "title": "MenuInstSchema", + "description": "Metadata required to create menu items across operating systems with ``menuinst``.", + "type": "object", + "properties": { + "$id": { + "title": "$Id", + "description": "DEPRECATED. Use ``$schema``.", + "default": "https://schemas.conda.org/menuinst-1.schema.json", + "deprecated": true, + "minLength": 1, + "type": "string" + }, + "$schema": { + "title": "$Schema", + "description": "Version of the menuinst schema.", + "default": "https://schemas.conda.org/menuinst-1.schema.json", + "minLength": 1, + "type": "string" + }, + "menu_name": { + "title": "Menu Name", + "minLength": 1, + "type": "string" + }, + "menu_items": { + "title": "Menu Items", + "minItems": 1, + "type": "array", + "items": { + "$ref": "#/definitions/MenuItem" + } + } + }, + "required": [ + "menu_name", + "menu_items" + ], + "additionalProperties": false, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.conda.org/menuinst-1.schema.json", + "definitions": { + "MenuItemNameDict": { + "title": "MenuItemNameDict", + "description": "Variable menu item name.\nUse this dictionary if the menu item name depends on installation parameters\nsuch as the target environment.", + "type": "object", + "properties": { + "target_environment_is_base": { + "title": "Target Environment Is Base", + "minLength": 1, + "type": "string" + }, + "target_environment_is_not_base": { + "title": "Target Environment Is Not Base", + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "Linux": { + "title": "Linux", + "description": "Linux-specific instructions.\n\nCheck the `Desktop entry specification\n`__\nfor more details.", + "type": "object", + "properties": { + "name": { + "title": "Name", + "anyOf": [ + { + "type": "string", + "minLength": 1 + }, + { + "$ref": "#/definitions/MenuItemNameDict" + } + ] + }, + "description": { + "title": "Description", + "type": "string" + }, + "icon": { + "title": "Icon", + "minLength": 1, + "type": "string" + }, + "command": { + "title": "Command", + "minItems": 1, + "type": "array", + "items": { + "type": "string" + } + }, + "working_dir": { + "title": "Working Dir", + "minLength": 1, + "type": "string" + }, + "precommand": { + "title": "Precommand", + "minLength": 1, + "type": "string" + }, + "precreate": { + "title": "Precreate", + "minLength": 1, + "type": "string" + }, + "activate": { + "title": "Activate", + "type": "boolean" + }, + "terminal": { + "title": "Terminal", + "type": "boolean" + }, + "Categories": { + "title": "Categories", + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string", + "pattern": "^.+;$" + } + ] + }, + "DBusActivatable": { + "title": "Dbusactivatable", + "type": "boolean" + }, + "GenericName": { + "title": "Genericname", + "type": "string" + }, + "Hidden": { + "title": "Hidden", + "type": "boolean" + }, + "Implements": { + "title": "Implements", + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string", + "pattern": "^.+;$" + } + ] + }, + "Keywords": { + "title": "Keywords", + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string", + "pattern": "^.+;$" + } + ] + }, + "MimeType": { + "title": "Mimetype", + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string", + "pattern": "^.+;$" + } + ] + }, + "NoDisplay": { + "title": "Nodisplay", + "type": "boolean" + }, + "NotShowIn": { + "title": "Notshowin", + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string", + "pattern": "^.+;$" + } + ] + }, + "OnlyShowIn": { + "title": "Onlyshowin", + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string", + "pattern": "^.+;$" + } + ] + }, + "PrefersNonDefaultGPU": { + "title": "Prefersnondefaultgpu", + "type": "boolean" + }, + "SingleMainWindow": { + "title": "Singlemainwindow", + "type": "boolean" + }, + "StartupNotify": { + "title": "Startupnotify", + "type": "boolean" + }, + "StartupWMClass": { + "title": "Startupwmclass", + "type": "string" + }, + "TryExec": { + "title": "Tryexec", + "type": "string" + }, + "glob_patterns": { + "title": "Glob Patterns", + "type": "object", + "additionalProperties": { + "type": "string", + "pattern": ".*\\*.*" + } + } + }, + "additionalProperties": false + }, + "CFBundleURLTypesModel": { + "title": "CFBundleURLTypesModel", + "description": "Describes a URL scheme associated with the app.", + "type": "object", + "properties": { + "CFBundleTypeRole": { + "title": "Cfbundletyperole", + "enum": [ + "Editor", + "Viewer", + "Shell", + "None" + ], + "type": "string" + }, + "CFBundleURLSchemes": { + "title": "Cfbundleurlschemes", + "type": "array", + "items": { + "type": "string" + } + }, + "CFBundleURLName": { + "title": "Cfbundleurlname", + "type": "string" + }, + "CFBundleURLIconFile": { + "title": "Cfbundleurliconfile", + "type": "string" + } + }, + "required": [ + "CFBundleURLSchemes" + ], + "additionalProperties": false + }, + "CFBundleDocumentTypesModel": { + "title": "CFBundleDocumentTypesModel", + "description": "Describes a document type associated with the app.", + "type": "object", + "properties": { + "CFBundleTypeIconFile": { + "title": "Cfbundletypeiconfile", + "type": "string" + }, + "CFBundleTypeName": { + "title": "Cfbundletypename", + "type": "string" + }, + "CFBundleTypeRole": { + "title": "Cfbundletyperole", + "enum": [ + "Editor", + "Viewer", + "Shell", + "None" + ], + "type": "string" + }, + "LSItemContentTypes": { + "title": "Lsitemcontenttypes", + "type": "array", + "items": { + "type": "string" + } + }, + "LSHandlerRank": { + "title": "Lshandlerrank", + "enum": [ + "Owner", + "Default", + "Alternate" + ], + "type": "string" + } + }, + "required": [ + "CFBundleTypeName", + "LSItemContentTypes", + "LSHandlerRank" + ], + "additionalProperties": false + }, + "UTTypeDeclarationModel": { + "title": "UTTypeDeclarationModel", + "type": "object", + "properties": { + "UTTypeConformsTo": { + "title": "Uttypeconformsto", + "type": "array", + "items": { + "type": "string" + } + }, + "UTTypeDescription": { + "title": "Uttypedescription", + "type": "string" + }, + "UTTypeIconFile": { + "title": "Uttypeiconfile", + "type": "string" + }, + "UTTypeIdentifier": { + "title": "Uttypeidentifier", + "type": "string" + }, + "UTTypeReferenceURL": { + "title": "Uttypereferenceurl", + "type": "string" + }, + "UTTypeTagSpecification": { + "title": "Uttypetagspecification", + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "required": [ + "UTTypeConformsTo", + "UTTypeIdentifier", + "UTTypeTagSpecification" + ], + "additionalProperties": false + }, + "MacOS": { + "title": "MacOS", + "description": "Mac-specific instructions. Check these URLs for more info:\n\n- ``CF*`` keys: see `Core Foundation Keys `__\n- ``LS*`` keys: see `Launch Services Keys `__\n- ``entitlements``: see `Entitlements documentation `__", + "type": "object", + "properties": { + "name": { + "title": "Name", + "anyOf": [ + { + "type": "string", + "minLength": 1 + }, + { + "$ref": "#/definitions/MenuItemNameDict" + } + ] + }, + "description": { + "title": "Description", + "type": "string" + }, + "icon": { + "title": "Icon", + "minLength": 1, + "type": "string" + }, + "command": { + "title": "Command", + "minItems": 1, + "type": "array", + "items": { + "type": "string" + } + }, + "working_dir": { + "title": "Working Dir", + "minLength": 1, + "type": "string" + }, + "precommand": { + "title": "Precommand", + "minLength": 1, + "type": "string" + }, + "precreate": { + "title": "Precreate", + "minLength": 1, + "type": "string" + }, + "activate": { + "title": "Activate", + "type": "boolean" + }, + "terminal": { + "title": "Terminal", + "type": "boolean" + }, + "CFBundleDisplayName": { + "title": "Cfbundledisplayname", + "type": "string" + }, + "CFBundleIdentifier": { + "title": "Cfbundleidentifier", + "pattern": "^[A-z0-9\\-\\.]+$", + "type": "string" + }, + "CFBundleName": { + "title": "Cfbundlename", + "maxLength": 16, + "type": "string" + }, + "CFBundleSpokenName": { + "title": "Cfbundlespokenname", + "type": "string" + }, + "CFBundleVersion": { + "title": "Cfbundleversion", + "pattern": "^\\S+$", + "type": "string" + }, + "CFBundleURLTypes": { + "title": "Cfbundleurltypes", + "type": "array", + "items": { + "$ref": "#/definitions/CFBundleURLTypesModel" + } + }, + "CFBundleDocumentTypes": { + "title": "Cfbundledocumenttypes", + "type": "array", + "items": { + "$ref": "#/definitions/CFBundleDocumentTypesModel" + } + }, + "LSApplicationCategoryType": { + "title": "Lsapplicationcategorytype", + "pattern": "^public\\.app-category\\.\\S+$", + "type": "string" + }, + "LSBackgroundOnly": { + "title": "Lsbackgroundonly", + "type": "boolean" + }, + "LSEnvironment": { + "title": "Lsenvironment", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "LSMinimumSystemVersion": { + "title": "Lsminimumsystemversion", + "pattern": "^\\d+\\.\\d+\\.\\d+$", + "type": "string" + }, + "LSMultipleInstancesProhibited": { + "title": "Lsmultipleinstancesprohibited", + "type": "boolean" + }, + "LSRequiresNativeExecution": { + "title": "Lsrequiresnativeexecution", + "type": "boolean" + }, + "NSSupportsAutomaticGraphicsSwitching": { + "title": "Nssupportsautomaticgraphicsswitching", + "type": "boolean" + }, + "UTExportedTypeDeclarations": { + "title": "Utexportedtypedeclarations", + "type": "array", + "items": { + "$ref": "#/definitions/UTTypeDeclarationModel" + } + }, + "UTImportedTypeDeclarations": { + "title": "Utimportedtypedeclarations", + "type": "array", + "items": { + "$ref": "#/definitions/UTTypeDeclarationModel" + } + }, + "entitlements": { + "title": "Entitlements", + "type": "array", + "items": { + "type": "string", + "pattern": "[a-z0-9\\.\\-]+" + } + }, + "link_in_bundle": { + "title": "Link In Bundle", + "type": "object", + "additionalProperties": { + "type": "string", + "pattern": "^(?!\\/)(?!\\.\\./).*" + } + }, + "event_handler": { + "title": "Event Handler", + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "Windows": { + "title": "Windows", + "description": "Windows-specific instructions. You can override global keys here if needed", + "type": "object", + "properties": { + "name": { + "title": "Name", + "anyOf": [ + { + "type": "string", + "minLength": 1 + }, + { + "$ref": "#/definitions/MenuItemNameDict" + } + ] + }, + "description": { + "title": "Description", + "type": "string" + }, + "icon": { + "title": "Icon", + "minLength": 1, + "type": "string" + }, + "command": { + "title": "Command", + "minItems": 1, + "type": "array", + "items": { + "type": "string" + } + }, + "working_dir": { + "title": "Working Dir", + "minLength": 1, + "type": "string" + }, + "precommand": { + "title": "Precommand", + "minLength": 1, + "type": "string" + }, + "precreate": { + "title": "Precreate", + "minLength": 1, + "type": "string" + }, + "activate": { + "title": "Activate", + "type": "boolean" + }, + "terminal": { + "title": "Terminal", + "type": "boolean" + }, + "desktop": { + "title": "Desktop", + "default": true, + "type": "boolean" + }, + "quicklaunch": { + "title": "Quicklaunch", + "default": false, + "type": "boolean" + }, + "terminal_profile": { + "title": "Terminal Profile", + "minLength": 1, + "type": "string" + }, + "url_protocols": { + "title": "Url Protocols", + "type": "array", + "items": { + "type": "string", + "pattern": "\\S+" + } + }, + "file_extensions": { + "title": "File Extensions", + "type": "array", + "items": { + "type": "string", + "pattern": "\\.\\S*" + } + }, + "app_user_model_id": { + "title": "App User Model Id", + "maxLength": 128, + "pattern": "\\S+\\.\\S+", + "type": "string" + } + }, + "additionalProperties": false + }, + "Platforms": { + "title": "Platforms", + "description": "Platform specific options.\n\nNote each of these fields supports the same keys as the top-level :class:`MenuItem`\n(sans ``platforms`` itself), in case overrides are needed.", + "type": "object", + "properties": { + "linux": { + "$ref": "#/definitions/Linux" + }, + "osx": { + "$ref": "#/definitions/MacOS" + }, + "win": { + "$ref": "#/definitions/Windows" + } + }, + "additionalProperties": false + }, + "MenuItem": { + "title": "MenuItem", + "description": "Instructions to create a menu item across operating systems.", + "type": "object", + "properties": { + "name": { + "title": "Name", + "anyOf": [ + { + "type": "string", + "minLength": 1 + }, + { + "$ref": "#/definitions/MenuItemNameDict" + } + ] + }, + "description": { + "title": "Description", + "type": "string" + }, + "command": { + "title": "Command", + "minItems": 1, + "type": "array", + "items": { + "type": "string" + } + }, + "icon": { + "title": "Icon", + "minLength": 1, + "type": "string" + }, + "precommand": { + "title": "Precommand", + "minLength": 1, + "type": "string" + }, + "precreate": { + "title": "Precreate", + "minLength": 1, + "type": "string" + }, + "working_dir": { + "title": "Working Dir", + "minLength": 1, + "type": "string" + }, + "activate": { + "title": "Activate", + "default": true, + "type": "boolean" + }, + "terminal": { + "title": "Terminal", + "default": false, + "type": "boolean" + }, + "platforms": { + "$ref": "#/definitions/Platforms" + } + }, + "required": [ + "name", + "description", + "command", + "platforms" + ], + "additionalProperties": false + } + } +} diff --git a/tests/data/jsons/entitlements.json b/tests/data/jsons/entitlements.json index 3edc7d1b..c2cf8b82 100644 --- a/tests/data/jsons/entitlements.json +++ b/tests/data/jsons/entitlements.json @@ -1,6 +1,5 @@ { - "$schema": "https://json-schema.org/draft-07/schema", - "$id": "https://schemas.conda.io/menuinst-1.schema.json", + "$schema": "https://raw.githubusercontent.com/conda/menuinst/refs/heads/main/menuinst/data/menuinst.schema.json", "menu_name": "Example with entitlements", "menu_items": [ { diff --git a/tests/data/jsons/example-3.invalid.json b/tests/data/jsons/example-3.invalid.json index 394734d0..06d00f47 100644 --- a/tests/data/jsons/example-3.invalid.json +++ b/tests/data/jsons/example-3.invalid.json @@ -1,6 +1,5 @@ { - "$schema": "https://json-schema.org/draft-07/schema", - "$id": "https://schemas.conda.io/menuinst-1.schema.json", + "$schema": "https://raw.githubusercontent.com/conda/menuinst/refs/heads/main/menuinst/data/menuinst.schema.json", "menu_name": "Example 2", "menu_items": [ { diff --git a/tests/data/jsons/file_types.json b/tests/data/jsons/file_types.json index 4fac2127..20cd66fa 100644 --- a/tests/data/jsons/file_types.json +++ b/tests/data/jsons/file_types.json @@ -1,6 +1,5 @@ { - "$schema": "https://json-schema.org/draft-07/schema", - "$id": "https://schemas.conda.io/menuinst-1.schema.json", + "$schema": "https://raw.githubusercontent.com/conda/menuinst/refs/heads/main/menuinst/data/menuinst.schema.json", "menu_name": "Example with file type association", "menu_items": [ { diff --git a/tests/data/jsons/file_types_no_event_handler.json b/tests/data/jsons/file_types_no_event_handler.json index 37d63bf4..70217cdc 100644 --- a/tests/data/jsons/file_types_no_event_handler.json +++ b/tests/data/jsons/file_types_no_event_handler.json @@ -1,6 +1,5 @@ { - "$schema": "https://json-schema.org/draft-07/schema", - "$id": "https://schemas.conda.io/menuinst-1.schema.json", + "$schema": "https://raw.githubusercontent.com/conda/menuinst/refs/heads/main/menuinst/data/menuinst.schema.json", "menu_name": "Example with file type association and no event handler (macOS only)", "menu_items": [ { diff --git a/tests/data/jsons/menu-name.json b/tests/data/jsons/menu-name.json index 0d8e09dd..b8671e1e 100644 --- a/tests/data/jsons/menu-name.json +++ b/tests/data/jsons/menu-name.json @@ -1,6 +1,5 @@ { - "$schema": "https://json-schema.org/draft-07/schema", - "$id": "https://schemas.conda.io/menuinst-1.schema.json", + "$schema": "https://raw.githubusercontent.com/conda/menuinst/refs/heads/main/menuinst/data/menuinst.schema.json", "menu_name": "Package", "menu_items": [ { diff --git a/tests/data/jsons/no-platforms.json b/tests/data/jsons/no-platforms.json index 03e1fbee..f4ff1c0a 100644 --- a/tests/data/jsons/no-platforms.json +++ b/tests/data/jsons/no-platforms.json @@ -1,6 +1,5 @@ { - "$schema": "https://json-schema.org/draft-07/schema", - "$id": "https://schemas.conda.io/menuinst-1.schema.json", + "$schema": "https://raw.githubusercontent.com/conda/menuinst/refs/heads/main/menuinst/data/menuinst.schema.json", "menu_name": "NoPlatforms", "menu_items": [ { diff --git a/tests/data/jsons/osx_symlinks.json b/tests/data/jsons/osx_symlinks.json index a8514356..6ca6e775 100644 --- a/tests/data/jsons/osx_symlinks.json +++ b/tests/data/jsons/osx_symlinks.json @@ -1,6 +1,5 @@ { - "$schema": "https://json-schema.org/draft-07/schema", - "$id": "https://schemas.conda.io/menuinst-1.schema.json", + "$schema": "https://raw.githubusercontent.com/conda/menuinst/refs/heads/main/menuinst/data/menuinst.schema.json", "menu_name": "Example with macOS symlinks", "menu_items": [ { diff --git a/tests/data/jsons/precommands.json b/tests/data/jsons/precommands.json index 9b2a6f05..344c050c 100644 --- a/tests/data/jsons/precommands.json +++ b/tests/data/jsons/precommands.json @@ -1,6 +1,5 @@ { - "$schema": "https://json-schema.org/draft-07/schema", - "$id": "https://schemas.conda.io/menuinst-1.schema.json", + "$schema": "https://raw.githubusercontent.com/conda/menuinst/refs/heads/main/menuinst/data/menuinst.schema.json", "menu_name": "Example with precommands", "menu_items": [ { diff --git a/tests/data/jsons/sys-prefix.json b/tests/data/jsons/sys-prefix.json index f44c1bf0..43b51f8e 100644 --- a/tests/data/jsons/sys-prefix.json +++ b/tests/data/jsons/sys-prefix.json @@ -1,6 +1,5 @@ { - "$schema": "https://json-schema.org/draft-07/schema", - "$id": "https://schemas.conda.io/menuinst-1.schema.json", + "$schema": "https://raw.githubusercontent.com/conda/menuinst/refs/heads/main/menuinst/data/menuinst.schema.json", "menu_name": "Sys.Prefix {{ DISTRIBUTION_NAME }}", "menu_items": [ { diff --git a/tests/data/jsons/url_protocols.json b/tests/data/jsons/url_protocols.json index 704f99e8..912c0534 100644 --- a/tests/data/jsons/url_protocols.json +++ b/tests/data/jsons/url_protocols.json @@ -1,6 +1,5 @@ { - "$schema": "https://json-schema.org/draft-07/schema", - "$id": "https://schemas.conda.io/menuinst-1.schema.json", + "$schema": "https://raw.githubusercontent.com/conda/menuinst/refs/heads/main/menuinst/data/menuinst.schema.json", "menu_name": "Example with file custom URL association", "menu_items": [ { diff --git a/tests/data/jsons/windows-terminal.json b/tests/data/jsons/windows-terminal.json index 3491da16..d0ae31fd 100644 --- a/tests/data/jsons/windows-terminal.json +++ b/tests/data/jsons/windows-terminal.json @@ -1,6 +1,5 @@ { - "$schema": "https://json-schema.org/draft-07/schema", - "$id": "https://schemas.conda.io/menuinst-1.schema.json", + "$schema": "https://raw.githubusercontent.com/conda/menuinst/refs/heads/main/menuinst/data/menuinst.schema.json", "menu_name": "Package", "menu_items": [ { diff --git a/tests/data/jsons/working-dir.json b/tests/data/jsons/working-dir.json index 6d68b21c..c68e0591 100644 --- a/tests/data/jsons/working-dir.json +++ b/tests/data/jsons/working-dir.json @@ -1,6 +1,5 @@ { - "$schema": "https://json-schema.org/draft-07/schema", - "$id": "https://schemas.conda.io/menuinst-1.schema.json", + "$schema": "https://raw.githubusercontent.com/conda/menuinst/refs/heads/main/menuinst/data/menuinst.schema.json", "menu_name": "Sys.Prefix {{ DISTRIBUTION_NAME }}", "menu_items": [ {