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

sfdx-cli shouldn't crash because there's a $schema property in sfdx-project.json #64

Open
Goobles opened this issue Nov 17, 2022 · 0 comments

Comments

@Goobles
Copy link

Goobles commented Nov 17, 2022

Summary

The property "$schema" is not allowed in sfdx-project.json (as described in https://forcedotcom.github.io/schemas/)

I don't think I need to explain why this is problematic. This means you have to add the $schema property every time you edit the file, then remove it afterwards when using the cli because sfdx cli throws this error:

Error: error during "initializing package version creation "Core"@0.105.0.NEXT"
reason: InvalidJsonCasing 
message: All JSON input must have heads down camelcase keys. E.g., `{ sfdcLoginUrl: "https://login.salesforce.com" }`
Found "$schema" at /sfdx-project.json
stack: InvalidJsonCasing: All JSON input must have heads down camelcase keys. E.g., `{ sfdcLoginUrl: "https://login.salesforce.com" }`
Found "$schema" at ./sfdx-project.json
    at Messages.createError (/Users/gobiusdolhain/.local/share/sfdx/client/7.177.1-617a284/node_modules/@salesforce/core/lib/messages.js:446:16)
    at SfProjectJson.validateKeys (/Users/gobiusdolhain/.local/share/sfdx/client/7.177.1-617a284/node_modules/@salesforce/core/lib/sfProject.js:314:32)
    at SfProjectJson.readSync (/Users/gobiusdolhain/.local/share/sfdx/client/7.177.1-617a284/node_modules/@salesforce/core/lib/sfProject.js:66:14)
    at PackageVersionCreateCommand._execute (/Users/gobiusdolhain/.local/share/sfdx/client/7.177.1-617a284/node_modules/salesforce-alm/dist/lib/package/packageVersionCreateCommand.js:625:23)
    at PackageVersionCreateCommand.execute (/Users/gobiusdolhain/.local/share/sfdx/client/7.177.1-617a284/node_modules/salesforce-alm/dist/lib/package/packageVersionCreateCommand.js:563:21)
    at PackageVersionCreateCommand.execLegacyCommand (/Users/gobiusdolhain/.local/share/sfdx/client/7.177.1-617a284/node_modules/salesforce-alm/dist/ToolbeltCommand.js:149:43)
    at PackageVersionCreateCommand.execPackagingLegacyCommand (/Users/gobiusdolhain/.local/share/sfdx/client/7.177.1-617a284/node_modules/salesforce-alm/dist/PackagingToolbeltCommand.js:37:28)
    at PackageVersionCreateCommand.run (/Users/gobiusdolhain/.local/share/sfdx/client/7.177.1-617a284/node_modules/salesforce-alm/dist/commands/force/package/version/create.js:23:21)
    at async PackageVersionCreateCommand._run (/Users/gobiusdolhain/.local/share/sfdx/client/7.177.1-617a284/node_modules/@salesforce/command/lib/sfdxCommand.js:102:40)
    at async Config.runCommand (/Users/gobiusdolhain/.local/share/sfdx/client/7.177.1-617a284/node_modules/@oclif/core/lib/config/config.js:272:25)
    at async run (/Users/gobiusdolhain/.local/share/sfdx/client/7.177.1-617a284/node_modules/@oclif/core/lib/main.js:74:5)
    at /Users/gobiusdolhain/.nvm/versions/node/v16.18.0/lib/node_modules/@sparklink/cli/dist/cmds/2gp/utils.js:80:15
    at Generator.next (<anonymous>)
    at fulfilled (/Users/gobiusdolhain/.nvm/versions/node/v16.18.0/lib/node_modules/@sparklink/cli/dist/cmds/2gp/utils.js:5:58)

Expected result

sfdx-cli shouldn't crash because there's a $schema property in sfdx-project.json

Actual result

sfdx-cli commands crashes because there's a $schema property in sfdx-project.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant