5.6. yapydata.datatree.synjson4627¶
The JSON access in compliance to RFC-4627 [RFC4627].
5.6.1. Module¶
The YapyData.json4627 module provides JSON access in compliance to RFC-4627 [RFC4627].
Sources: yapydata/datatree/synjson4627.py
5.6.2. DataTreeJSON¶
-
class
yapydata.datatree.synjson4627.
DataTreeJSON4627
(data, **kargs)[source]¶ Provides additional constraints for JSON based on RFC-4627.
The main point is here probably the required object or array as the root node, while RFC-7159 permits in general values.
5.6.2.1. __init__¶
-
DataTreeJSON4627.
__init__
(data, **kargs)[source]¶ - Parameters
data –
Configuration data in accordance to RFC-4627:
data := <RFC-4627-type-for-json> RFC-4627-type-for-json := ( dict | list # see: object, list )
The initial data defines the permitted type of the first item within the subpath of the spanned data tree.
Thus atomic data types define a single node data tree only - new in RFC-7159.
- Returns
None / initialized object
- Raises
pass-through –
5.6.2.2. isvalid_top¶
5.6.2.3. __setattr__¶
-
DataTreeJSON4627.
__setattr__
(name, value)[source]¶ Validates types of own data attributes.
- Parameters
name –
Name of the attribute. Following are reserved and treated special:
type: str - ‘data’ The value is treated as the replacement of the internal data attribute. Replaces or creates the complete data of teh current instance.
value – The value of the attribute. This by default superposes present values by replacement. Non-present are created.
Returns:
- Raises