Skip to content

Define ScheduleUpdate null and omission semantics during schedule implementation #5

Description

@coderabbitai

Summary

Define the update semantics for ScheduleUpdate when the schedule persistence and update flow are implemented.

ScheduleUpdate currently permits null for fields that are non-nullable on Schedule:

  • modules
  • module_configuration
  • recurrence_rule
  • timezone
  • enabled

The published OpenAPI contract currently makes these fields nullable. A client can therefore send explicit JSON null. The API contract must distinguish an omitted field from an explicitly supplied null value.

Required changes

  • Decide the API behavior for explicit JSON null values in PATCH /api/v1/schedules/{schedule_id}.
  • Keep omitted fields unchanged during a partial update.
  • Reject explicit null values for fields that cannot be null on Schedule, unless the final persistence model intentionally supports null for that field.
  • Implement the selected behavior in the request schema and schedule update merge/application flow.
  • Update the generated OpenAPI contract if the selected behavior changes the schema.
  • Add tests for omitted fields, valid field updates, and explicit null values.

Affected areas

  • src/nc3_testing_platform/domains/schedules/schemas.py
  • src/nc3_testing_platform/domains/schedules/router.py
  • Future schedule service and repository modules
  • api/openapi.json
  • Schedule update tests

Acceptance criteria

  • An omitted update field does not modify the stored Schedule value.
  • A valid supplied update field modifies the stored Schedule value.
  • An explicit null value cannot produce a Schedule with null values for modules, module_configuration, recurrence_rule, timezone, or enabled.
  • The generated OpenAPI schema matches the implemented request behavior.
  • Tests cover the selected semantics.

Backlinks

Requested by: @t0kubetsu

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions