You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It might be easier to maintain the schema document using JSL, a Python library defines a DSL-like Python syntax for generating json schemas.
Advantages (cribed from the JSL docs):
A JSON schema in terms of the Python language is a dictionary. A JSON schema of a more or less complex data structure is a dictionary which most likely contains a lot of nested dictionaries of dictionaries of dictionaries. Writing and maintaining the readability of such a dictionary are not very rewarding tasks. They require typing a lot of quotes, braces, colons and commas and carefully indenting everything.
The JSON schema standard is not always intuitive. It takes a little bit of practice to remember where to use the maxItems keyword and where the maxLength, or not to forget to set additionalProperties to false, and so on.
The syntax is not very concise. The signal-to-noise ratio increases rapidly with the complexity of the schema, which makes large schemas difficult to read.
The first is partially mitigated already by using yaml instead, and converting both to JSON. JSL might offer an incremental advantage here.
The second seems reasonable. Using a Python DSL gives us potential typechecking and editor autocomplete advantages.
The third is the main argument IMO for using such a library.
Disadvantages that I can see are that the underlying machinery (metaclasses) is much more complex than simply converting yaml to json. It's another layer of abstraction that the programmer has to grok.
The text was updated successfully, but these errors were encountered:
Routemaster has a json schema that defines the expected format of the config.yaml
It might be easier to maintain the schema document using JSL, a Python library defines a DSL-like Python syntax for generating json schemas.
Advantages (cribed from the JSL docs):
The first is partially mitigated already by using yaml instead, and converting both to JSON. JSL might offer an incremental advantage here.
The second seems reasonable. Using a Python DSL gives us potential typechecking and editor autocomplete advantages.
The third is the main argument IMO for using such a library.
Disadvantages that I can see are that the underlying machinery (metaclasses) is much more complex than simply converting yaml to json. It's another layer of abstraction that the programmer has to grok.
The text was updated successfully, but these errors were encountered: