3

I accidentally clicked the JSON Schema validation menu in Android Studio and selected JSON schema v7 from the list.

Now the IDE shows warnings in my pubspec.yaml file that some values were not allowed. I turned of the inspection but I wondered if there was any way to reset it back to "No JSON schema".

After creating a new yaml file in my project, the bottom right bar looks like this:

Bottom right bar after new YAML file

Then I can select something, like JSON schema v7.

Schema selection

However there is no "None" or "No JSON schema" or anything.

I also tried to right click, Shift-Click, Ctrl-Click, Alt-Click, to no avail. My search for " JSON schema" didn't bring up anything either.

How do I clear the JSON schema?

geisterfurz007
  • 5,292
  • 5
  • 33
  • 54

1 Answers1

3

Thanks to the comment by @Rakesh Kumar I found something indeed!

Open Settings > Languages & Frameworks > Schema and DTDs > JSON Schema Mappings

Settings dialog JSON Schema Mappings

Selecting the schema you had selected for your file, you can then select the file on the right side and click the "-" button to remove schema validation with that schema for that file.

geisterfurz007
  • 5,292
  • 5
  • 33
  • 54
  • Doesn't work for me. If I remove the file from the list ("File: pubspec.yaml" in your Screenshot) it will be applied the Schema: schema.json again. Which I don't know what it is but my IDE rings a lot of alarms about that. Very annoying. – agoldev Dec 27 '21 at 13:42