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

Json top level array formatting error #810

Open
yiddytlq opened this issue Feb 5, 2024 · 4 comments
Open

Json top level array formatting error #810

yiddytlq opened this issue Feb 5, 2024 · 4 comments
Labels
info-needed See https://aka.ms/azcodeissuereporting

Comments

@yiddytlq
Copy link

yiddytlq commented Feb 5, 2024

Type: Bug

When a json file starts with an array using [, it gives a formatting error that it is expecting an object

Extension version: 0.8.3
VS Code version: Code 1.86.0 (05047486b6df5eb8d44b2ecd70ea3bdf775fd937, 2024-01-31T10:28:19.990Z)
OS version: Windows_NT x64 10.0.19045
Modes:

@nturinski
Copy link
Member

Could you share an example a json file that reproduces this bug? Also, could you share which Azure Resources command that you are using that produces this bug?

@nturinski nturinski added the info-needed See https://aka.ms/azcodeissuereporting label Feb 7, 2024
@yiddytlq
Copy link
Author

yiddytlq commented Feb 9, 2024

Any file that's formatted like this. I didn't use the extension personally & have now uninstalled it. I wasn't even using Azure at the time, however while this extension was enabled VS code gave me the yellow underline across the whole file. & The problems tab pointed out that the Jason file expected an object.

I ended up uninstalling the extension as I was not using it either way.

[
    {
        "id": 1,
        "name": "John Doe",
        "email": "[email protected]",
        "isActive": True
    },
    {
        "id": 2,
        "name": "Jane Smith",
        "email": "[email protected]",
        "isActive": False
    }
]

@alexweininger
Copy link
Member

Was the error coming from out extension? And if so, do you know which extension it was? If you could take a screenshot of the error and the error message that would help a lot.

@yiddytlq
Copy link
Author

yiddytlq commented Feb 9, 2024

The error starts when I enable the Azure Functions extension. The extension ID is (ms-azuretools.vscode-azurefunctions).

The error is

[{
	"resource": "/c:/Users/Admin/Documents/GitHub/Proxy Monitor/proxies.json",
	"owner": "_generated_diagnostic_collection_name_#1",
	"severity": 4,
	"message": "Incorrect type. Expected \"object\".",
	"startLineNumber": 1,
	"startColumn": 1,
	"endLineNumber": 79,
	"endColumn": 2
}]

Here you have a screenshot:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed See https://aka.ms/azcodeissuereporting
Projects
None yet
Development

No branches or pull requests

3 participants