Skip to content

Require a usable default on every required response field #14367

Closed

Description

@ChiragAgg5k

Tracks PR #14366.

Plan

Goal: Document that every required response-model field must carry a schema-accepted default (so SDK models can fill fields an older server omits), and add defaults to the four required fields that currently have none.

What changes:

  • AGENTS.md (Models) — required rules need a default the schema accepts (enum member, or array for an array rule); otherwise use required => false.
  • src/Appwrite/Utopia/Response/Model/AuthProvider.php — enabled default false.
  • src/Appwrite/Utopia/Response/Model/Embedding.php — model default '', dimension default 0.
  • src/Appwrite/Utopia/Response/Model/JWT.php — jwt default ''.
  • tests/unit/Utopia/Response/ModelDefaultsTest.php — builds the OpenAPI 3 spec for every registered response model and fails on any required scalar property without a default (model refs skipped).
  • tests/unit/Utopia/Response/model-defaults-baseline.json — records the 80 existing gaps; new gaps fail, and a baselined field that gains a default must be removed, so the list only shrinks.

Follows closed #14358 / merged #14357 (spec emits defaults) and pairs with appwrite/sdk-generator#2005 (SDKs fill from those defaults). Older required fields whose defaults the spec still can't emit (e.g. status enums / $permissions as '') are left alone.

Remaining steps:

  1. Land docs(response): require a usable default on every required response field #14366 (AGENTS.md convention + the four model defaults above).
  2. Keep sdk-generator#2005 moving so generated SDK models actually use the emitted defaults.

Done when:

Activity

  1. self-assigned this
    on Oct 12, 2026
  2. added
    product / auth
    product / databases
    on Oct 12, 2026
  3. ChiragAgg5k commented on Oct 14, 2026

    @ChiragAgg5k
    MemberAuthor

    Released in Appwrite 2.5.0 (includes #14366).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

product / authproduct / databases

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions