Read the statement by Michael Teeuw here.
Defining a module configuration schema standard
-
@roramirez you’re off the path it’s about a configuration scheme like
"maximumEntries": { "description": "The maximum number of events shown.", "values": { "Integer": { "min": 0, "max": 100 } }, "default": 10 },
-
@strawberry-3.141 Ok. For this case is need it uses a library to validate this case .
On Python I’m using
http://python-jsonschema.readthedocs.io/en/latest/
http://validictory.readthedocs.io/en/latest/I think for this is need two thing.
-
First define a name in module for configuration schema, like this
config.schema
-
After that is required by the core to check if the file exists inside the module and validate configuration, if ok loads the module. But this I think is @MichMich should tell what he think about this.
The second part is possible do it inside the module too.
-
-
@roramirez this is not for the core, this will be for the configuration solutions out there. so the user can decide which one he wants to use but the developers have to define their schema just once and it will work with all solutions
-
@strawberry-3.141 Good idea to get this issue out here.
I think JSON Schema (as suggested by @roramirez) seems like a reasonable solution, and if I am right, it is compatible with the JSON Editor the MMM-Admin-Interface already uses.
As a file name I think it should end with
.json
, e.g.config.schema.json
. This file should include the configuration options for the module.After we find a good solution, we could add this to the MagicMirrorModule-Template?
-
@Jopyth how about handling global extensions like modulescheduler?
-
I just publish a first release functional of
https://github.com/roramirez/MagicMirror-Module-TemplateIf there suggest about include JSON Schema of something else, come on!, let me know