A JSON Schema compatibility layer for code editors. More...
Functions | |
| SOURCEMETA_BLAZE_EDITOR_EXPORT auto | sourcemeta::blaze::for_editor (sourcemeta::core::JSON &schema, const sourcemeta::core::SchemaWalker &walker, const sourcemeta::core::SchemaResolver &resolver, std::string_view default_dialect="") -> void |
A JSON Schema compatibility layer for code editors.
This functionality is included as follows:
| SOURCEMETA_BLAZE_EDITOR_EXPORT auto sourcemeta::blaze::for_editor | ( | sourcemeta::core::JSON & | schema, |
| const sourcemeta::core::SchemaWalker & | walker, | ||
| const sourcemeta::core::SchemaResolver & | resolver, | ||
| std::string_view | default_dialect = "" )->void |
This function aims to transform the schema (in potentially non-strictly compliant manners) to workaround JSON Schema limitations of popular code editors.
Keep in mind that this is not a real solution, but a workaround, and there might be edge cases that we cannot cover. The real solution is for popular editors to fix their JSON Schema language support.
Note that the input schema is expected to be already bundled. Meta-schema declarations may remain external, as this function rewrites those to the base dialect in force at the subschema that declares them.