jsonschema_diff.config_maker¶
Factory for a ready-to-use jsonschema_diff.core.Config instance.
All optional switches are enabled by default; pass False to disable.
Classes¶
Create a collection of name/value pairs. |
|
Helper that builds a fully populated |
Module Contents¶
- class MultilineListRender(*args, **kwds)[source]¶
Create a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- class ConfigMaker[source]¶
Helper that builds a fully populated
Config.- static make(
- *,
- tab_size: int = 1,
- all_for_rendering: bool = False,
- crop_path: bool = True,
- path_render_with_properies: bool = False,
- path_render_with_items: bool = False,
- list_comparator: bool = True,
- list_multiline_render: MultilineListRender = MultilineListRender.Soft,
- range_digit_comparator: bool = True,
- range_length_comparator: bool = True,
- range_items_comparator: bool = True,
- range_properties_comparator: bool = True,
- additional_compare_rules: jsonschema_diff.core.tools.compare.COMPARE_RULES_TYPE = {},
- additional_combine_rules: jsonschema_diff.core.tools.combine.COMBINE_RULES_TYPE = [],
- additional_pair_context_rules: jsonschema_diff.core.tools.context.PAIR_CONTEXT_RULES_TYPE = [],
- additional_context_rules: jsonschema_diff.core.tools.context.CONTEXT_RULES_TYPE = {},
- additional_path_maker_ignore: jsonschema_diff.core.tools.render.PATH_MAKER_IGNORE_RULES_TYPE = [],
Assemble and return a
Config.- Parameters:
tab_size (int) – Number of spaces per indentation level.
path_render_with_properies (bool) – Include these schema service tokens in rendered paths.
path_render_with_items (bool) – Include these schema service tokens in rendered paths.
list_comparator (bool) – Enable
CompareList.list_multiline_render (MultilineListRender) – How to render multi-line elements of list.
range_*_comparator (bool) – Enable
CompareRangefor numeric/length/items/properties limits.additional_* (collections) – User-supplied rules that override the built-ins.