Skip to content

Commit 9cc0549

Browse files
committed
Do not include the endpoint property in the serialized subrequest.
1 parent aefdceb commit 9cc0549

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
### Fixed
10+
- Do not include the endpoint property in the serialized subrequest.
11+
912
## [1.0.0-beta.3] -- 2021-07-26
1013
### Fixed
1114
- Specify correct Content-Type header for 1.x servers.

farmOS/subrequests.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ def send(
104104
if sub.uri is None and sub.endpoint is not None:
105105
sub.uri = f"{self.session.hostname}/{sub.endpoint}"
106106

107+
# Set the endpoint to None so it is not included in the serialized subrequest.
108+
sub.endpoint = None
109+
107110
# Auto populate headers for each sub-request.
108111
if "Accept" not in sub.headers:
109112
sub.headers["Accept"] = "application/vnd.api+json"
@@ -118,7 +121,7 @@ def send(
118121

119122
# Generate the json to send. It is important to use the .json() method
120123
# of the model for correct serialization.
121-
json = blueprint.json(exclude={"subrequest": {"endpoint"}}, exclude_none=True)
124+
json = blueprint.json(exclude_none=True)
122125
options = {"data": json}
123126

124127
response = self.session.http_request(

0 commit comments

Comments
 (0)