Skip to content

feat(spec): let null remove keys in spec patches #762

Closed

Description

@uniqueg

Description

Spec patches (_apply_patches, deep_merge) and merged spec files (merge_yaml) can only add or overwrite keys; they can't remove one. A null value is stored as None. Apps therefore can't adapt a vendored GA4GH spec where the change needs a key to go, e.g. (found in trs-filer#128, TRS 2.0.2):

  • turning an apiKey security scheme into http/bearer: the merged scheme keeps name and in, and Connexion rejects it (InvalidSpecification);
  • dropping a remote $ref (e.g. /service-info pointing to raw.githubusercontent.com), which Connexion otherwise fetches on every start; setting $ref: null crashes Connexion's resolver.

Expected result

  • In patches, null removes the key (JSON Merge Patch semantics, RFC 7396), at any depth.
  • For merged spec files, the same as an opt-in (so that an explicit default: null in a schema keeps working), or a documented reason why not.
  • Removing a $ref and replacing it with a local definition works; _warn_weakened still warns about security changes made this way.
  • Tests and docs (patch reference, upgrade notes).

Activity

  1. self-assigned this
    on Nov 11, 2026
  2. added
    priority: high
    status: in progress
    type: feature
    workload: hours
    on Nov 11, 2026
  3. removed
    status: in progress
    on Nov 11, 2026
  4. added this to the v0.23.0 milestone on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: hightype: featureworkload: hours

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions