Install PyCharm
- Install PyCharm code binary.
- Start PyCharm, on macOS press CMD+ and type pycharm
JSON/YAML Setup
- Open Preferences
- Navigate to Languages and Frameworks > Schemas and DTDs > JSON Schema Mappings
- Add new Mapping (Ctrl+N)
- Name the Mapping (e.g; "CFN Template Schema")
- Enter a Schema URL (e.g;
https://s3.amazonaws.com/cfn-resource-specifications-us-east-1-prod/schemas/2.15.0/all-spec.json
) - Add a mapping to a folder or file path pattern (e.g;
"*-template.json
) - Select the appropriate Schema Version: JSON schema version 7
- Click OK to save.
- Create new file with the extension specified in the mapping (e.g;
my-app-template.json
)
- PyCharm does not provide the
description
context on mouse-hover (which other IDEs do)
JSON Schema not found or contain error in 'all-spec.json': Can not load code model for JSON Schema file 'all-spec.json'
PyCharm uses the idea.max.intellisense.filesize
platform property to set the maximum size of files for which PyCharm provides code assistance and to load a JSON schema.
By default this property is set to 2500
kilobytes.
In order to load a schema bigger than this size, you have to edit this property to a number greater than the size of your schema, for example 5000
kilobytes. In order to do that go to Help | Edit Custom Properties
and add the following line: idea.max.intellisense.filesize=5000
.
Restart PyCharm, you can now load the file.
This restriction only applies to local file, if for whatever reason you can't edit this file you can setup a local webserver (For example with python -m SimpleHTTPServer
) and serve your schema file through http.