Skip to content

Commit 909a04e

Browse files
committed
chore: remove unnused generalisation
The ability to add additional fields to either the integration JSON or FFI JSON representations is not used, and may never be needed. Signed-off-by: JP-Ellis <josh@jpellis.me>
1 parent fbb18fc commit 909a04e

File tree

2 files changed

+1
-29
lines changed

2 files changed

+1
-29
lines changed

src/pact/v3/generate/generator.py

-14
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ def __init__(
7979
type: GeneratorType, # noqa: A002
8080
/,
8181
extra_fields: Mapping[str, Any] | None = None,
82-
integration_fields: Mapping[str, Any] | None = None,
83-
generator_json_fields: Mapping[str, Any] | None = None,
8482
**kwargs: Any, # noqa: ANN401
8583
) -> None:
8684
"""
@@ -95,14 +93,6 @@ def __init__(
9593
These fields will be used when converting the generator to both an
9694
integration JSON object and a generator JSON object.
9795
98-
integration_fields:
99-
Additional configuration elements to pass to the generator when
100-
converting to an integration JSON object.
101-
102-
generator_json_fields:
103-
Additional configuration elements to pass to the generator when
104-
converting to a generator JSON object.
105-
10696
**kwargs:
10797
Alternative way to pass additional configuration elements to the
10898
generator. See the `extra_fields` argument for more information.
@@ -112,8 +102,6 @@ def __init__(
112102
The type of the generator.
113103
"""
114104

115-
self._integration_fields = integration_fields or {}
116-
self._generator_json_fields = generator_json_fields or {}
117105
self._extra_fields = dict(chain((extra_fields or {}).items(), kwargs.items()))
118106

119107
def to_integration_json(self) -> dict[str, Any]:
@@ -133,7 +121,6 @@ def to_integration_json(self) -> dict[str, Any]:
133121
return {
134122
"pact:generator:type": self.type,
135123
**self._extra_fields,
136-
**self._integration_fields,
137124
}
138125

139126
def to_generator_json(self) -> dict[str, Any]:
@@ -157,5 +144,4 @@ def to_generator_json(self) -> dict[str, Any]:
157144
return {
158145
"type": self.type,
159146
**self._extra_fields,
160-
**self._generator_json_fields,
161147
}

src/pact/v3/match/matcher.py

+1-15
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,13 @@ class GenericMatcher(Matcher[_T]):
8383
for inclusion in the integration JSON object and matching rule.
8484
"""
8585

86-
def __init__( # noqa: PLR0913
86+
def __init__(
8787
self,
8888
type: MatcherType, # noqa: A002
8989
/,
9090
value: _T | Unset = UNSET,
9191
generator: Generator | None = None,
9292
extra_fields: Mapping[str, Any] | None = None,
93-
integration_fields: Mapping[str, Any] | None = None,
94-
matching_rule_fields: Mapping[str, Any] | None = None,
9593
**kwargs: Matchable,
9694
) -> None:
9795
"""
@@ -116,14 +114,6 @@ def __init__( # noqa: PLR0913
116114
fields will be used when converting the matcher to both an
117115
integration JSON object and a matching rule.
118116
119-
integration_fields:
120-
Additional configuration elements to pass to the matcher when
121-
converting it to an integration JSON object.
122-
123-
matching_rule_fields:
124-
Additional configuration elements to pass to the matcher when
125-
converting it to a matching rule.
126-
127117
**kwargs:
128118
Alternative way to define extra fields. See the `extra_fields`
129119
argument for more information.
@@ -143,8 +133,6 @@ def __init__( # noqa: PLR0913
143133
Generator used to generate a value when the value is not provided.
144134
"""
145135

146-
self._integration_fields: Mapping[str, Any] = integration_fields or {}
147-
self._matching_rule_fields: Mapping[str, Any] = matching_rule_fields or {}
148136
self._extra_fields: Mapping[str, Any] = dict(
149137
chain((extra_fields or {}).items(), kwargs.items())
150138
)
@@ -179,7 +167,6 @@ def to_integration_json(self) -> dict[str, Any]:
179167
else {}
180168
),
181169
**self._extra_fields,
182-
**self._integration_fields,
183170
}
184171

185172
def to_matching_rule(self) -> dict[str, Any]:
@@ -205,7 +192,6 @@ def to_matching_rule(self) -> dict[str, Any]:
205192
"match": self.type,
206193
**({"value": self.value} if not isinstance(self.value, Unset) else {}),
207194
**self._extra_fields,
208-
**self._matching_rule_fields,
209195
}
210196

211197

0 commit comments

Comments
 (0)