Skip to content

AIP-84 Standardize PATCH Behavior Across Endpoints in FastAPI #43650

@bugraoz93

Description

@bugraoz93

Description

None Values

Currently, the handling of None values in PATCH requests is inconsistent across different parts of the codebase. In some instances, when no mask is provided, None values are filtered out, while in others, such as the Pool model, all values (including None) are validated and persisted if the payload is valid. The objective of this work item is to standardize PATCH request behaviour regarding None values:

  1. When a mask is provided, use the values as specified by the mask.
  2. When no mask is provided, ensure the payload is validated independently as a fully-formed database entity, allowing for explicit setting of fields to None.

Database Calls

Avoid making database calls solely to check for existence; instead, delegate this responsibility to the database itself during the primary operation.

Use case/motivation

A standardized approach for PATCH endpoints is needed.

Related issues

Relates to: #42370
Follow Up of: #43102

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions