Data Model Extension
This part of the project documentation focuses on
an information-oriented approach. Use it as a
reference for the technical implementation of the
pact_methodology
project code.
DataModelExtension
Data Model Extension class.
Attributes:
Name | Type | Description |
---|---|---|
spec_version |
str
|
The version of the Data Model Extension specification. Must be a string in the format major.minor.patch as defined in Semantic Versioning 2.0.0. Must be 2.0.0 when referencing this specification. |
data_schema |
str
|
The URL to the publicly accessible Extension Schema File. Must be a string representing a URL with the HTTPS schema. |
data |
dict
|
A JSON Object that conforms to the extension schema file referenced by the dataSchema property. |
documentation |
str
|
The URL to the publicly accessible Extension Documentation. Must be a string representing a URL with the HTTPS schema. |
Source code in pact_methodology/data_model_extension/data_model_extension.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
|
__eq__(other)
Returns True if the other object is a DataModelExtension with the same attributes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
other
|
object
|
The object to compare with. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the objects are equal, False otherwise. |
Source code in pact_methodology/data_model_extension/data_model_extension.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
__init__(spec_version, data_schema, data, documentation=None)
Initializes a DataModelExtension object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
spec_version
|
str
|
The version of the Data Model Extension specification. |
required |
data_schema
|
str
|
The URL to the publicly accessible Extension Schema File. |
required |
data
|
dict
|
A JSON Object that conforms to the extension schema file referenced by the dataSchema property. |
required |
documentation
|
str
|
The URL to the publicly accessible Extension Documentation. |
None
|
Raises:
Type | Description |
---|---|
ValueError
|
If the spec_version is not in the format major.minor.patch or is not 2.0.0. |
ValueError
|
If the data_schema is not a string representing a URL with the HTTPS schema. |
ValueError
|
If the data is not a dictionary or cannot be serialized to a JSON object. |
ValueError
|
If the documentation is not a string representing a URL with the HTTPS schema. |
Source code in pact_methodology/data_model_extension/data_model_extension.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
__repr__()
Returns a string representation of the DataModelExtension object.
Returns:
Name | Type | Description |
---|---|---|
str |
A string representation of the DataModelExtension object. |
Source code in pact_methodology/data_model_extension/data_model_extension.py
96 97 98 99 100 101 102 103 |
|