microsoft / microsoft/winget-cli

`winget validate` does not recognize `$schema` field for JSON manifests

Open
#4,150 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Command-Validate Issue-Bug
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Brief description of your issue

winget validate throws warnings when the $schema field is defined for JSON manifests.

Steps to reproduce

Taking an example of singleton manifest for easier repro, but the same applies for multifile manifests

{
"$schema": "https://aka.ms/winget-manifest.singleton.1.5.0.schema.json",
"PackageIdentifier": "jqlang.jq",
"PackageVersion": "1.2.3",
"PackageLocale": "en-US",
"Publisher": "TestPublisher",
"PackageName": "Full Singleton 1.5 Test",
"PackageUrl": "https://fakeTestUrl.com",
"License": "MIT",
"ShortDescription": "A manifest used to verify that all fields from a full 1.5 singleton manifest can be deserialized and updated.",
"Installers": [
    {
        "MinimumOSVersion": "10.0.0.0",
        "Architecture": "x64",
        "InstallerUrl": "https://fakedomain.com/WingetCreateTestExeInstaller.exe",
        "InstallerType": "inno",
        "InstallerSha256": "A7803233EEDB6A4B59B3024CCF9292A6FFFB94507DC998AA67C5B745D197A5DC"
    }
],
"ManifestType": "singleton",
"ManifestVersion": "1.5.0"
}
Expected behavior

Manifest validation succeeds with no warnings.

Actual behavior
 ~/1.2.3 winget validate --manifest .
Manifest validation succeeded with warnings.
Manifest Warning: Unknown field. [$schema] Line: 3, Column: 1
Environment
Windows Package Manager (Preview) v1.7.3481-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22621.3007
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.22.3481.0

Winget Directories
-------------------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                %USERPROFILE%\Downloads

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Enabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Enabled
LocalArchiveMalwareScanOverride           Disabled

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the warning with the provided singleton manifest and winget validate --manifest ., then trace the CLI's manifest-validation path for handling of JSON fields. Done means $schema is accepted for singleton and multifile manifests and validation succeeds without the reported warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.