-
Notifications
You must be signed in to change notification settings - Fork 14
Closed
Labels
feature requestRequest a potential featureRequest a potential feature
Description
In the post_entity method of the V2 context broker client :
try:
res = self.post(
url=url,
headers=headers,
json=entity.model_dump(exclude_none=True),
params=params,
)
if res.ok:
self.logger.info("Entity successfully posted!")
return res.headers.get("Location")
res.raise_for_status()
except requests.RequestException as err:
if err.response is not None:
if update and err.response.status_code == 422:
return self.override_entity(entity=entity, key_values=key_values)
if patch and err.response.status_code == 422:
if not key_values:
return self.patch_entity(
entity=entity, override_attr_metadata=override_attr_metadata
)
else:
return self._patch_entity_key_values(entity=entity)
According to this documentation, post entity is supposed to raise the 422 if upsert is not set, whereas 422 is being handled silently in the current implementation, by reconciling the entities in the context broker.
PS: The docs implementation is actually much simpler
Metadata
Metadata
Assignees
Labels
feature requestRequest a potential featureRequest a potential feature