You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(spec): let null remove keys in spec patches #762
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.
Activity