SchemaStore / schemastore

A collection of JSON schema files including full API
http://schemastore.org
Apache License 2.0
3.1k stars 1.71k forks source link

Unconditional mapping to 'app.json' for Expo SDK hurts Heroku users #1121

Open zhuravlikjb opened 4 years ago

zhuravlikjb commented 4 years ago

https://www.schemastore.org/api/json/catalog.json

{
      "name": "Expo SDK",
      "description": "JSON schema for Expo SDK app manifest",
      "fileMatch": [
         "app.json"
      ],
      "url": "https://json.schemastore.org/expo-37.0.0.json"
    }

But: https://devcenter.heroku.com/articles/app-json-schema ....

See also: https://youtrack.jetbrains.com/issue/IDEA-244881

cagils commented 4 years ago

Just as I try to stay away from Expo in React world, they are finding new ways to inject themselves into my workflow.

Webstorm somehow thinks every app.json in a React project should conform to "json.schemastore.org/expo-37.0.0.json"

mogsdad commented 2 years ago

As a workaround, while this problem ages like fine wine, I've taken to specifying the $schema directly in my app.json files using the raw schema from the PR for IDEA-244881 thusly:

{
  "$schema": "https://raw.githubusercontent.com/crcastle/schemastore/06174ef73fcaa1f9734e4aed8b7d40e6df586f76/src/schemas/json/app.json",
  ...
}
dwreeves commented 2 years ago

@mogsdad Good find! In the preferences menu, you can take that URL and stick it inside the JSON Schema Mappings, and that solves the problem in an elegant way.

image
mogsdad commented 2 years ago

@mogsdad Good find! In the preferences menu, you can take that URL and stick it inside the JSON Schema Mappings, and that solves the problem in an elegant way.

Just remember that this way only solves the problem for one developer!

dwreeves commented 2 years ago

It works for all developers using a JetBrains IDE if you commit .idea/jsonSchemas.xml.