This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
JSON Schema for app.json?
Tombo
Member
in Developers
Hey guys,
Searched the forums, but haven't really found an answer on this. Is there already a JSON schema (http://json-schema.org/) for the app.json file?
If not I'll whip one together :-)
Cheers
Tom
Searched the forums, but haven't really found an answer on this. Is there already a JSON schema (http://json-schema.org/) for the app.json file?
If not I'll whip one together :-)
Cheers
Tom
Comments
Do you mean there is none yet?
A JSON schema could ease writing app.json's, as editors (intelli j, webstorm, vs code, vs, ..) provide intellisense for files. :-)
So I created one myself :-)
Some remarks on this:
- To use it, just add the property "$schema" in the root object and as value: "https://raw.githubusercontent.com/tmsns/homey-json-schema/master/schema.json"
- Supported IDE's: (that I know of)
- Visual Studio
- Visual Studio Code
- WebStorm
- IntelliJ IDEA
- This is a first version. I'll try to update it as I can.
- the basic structure should be there (based myself on the apps better-logic and kodi)
- a small set of properties have gotten full descriptions
- enums and advanced patterns are not added yet
- To Athom, feel free to copy the schema in your own repository. It would be better to have something like:
- To other dev's, it's a GitHub repo. https://github.com/tmsns/homey-json-schema So, if you see issues, feel free to submit pull requests.
CheersYou can also download it locally.
https://schemas.athom.com/app/v1/schema.json
Tom
Where should I create the property?
https://github.com/athombv/node-homey-lib/blob/51d2e942ba574aef46e4d560e2df580136d4b88d/lib/permissions/permissions.json
edit: done! I'll take a look at this node-homey-lib repo to see if I can find other elements to (better) support a well.
Validate and format it here: JSON formatter