removeAtPath: teach the schema prune oneOf/anyOf #1504

Open
opened 2026-08-20 13:55:12 +02:00 by kiara · 0 comments
Owner

Follow-up split out of the work on #629.

core/lib/schema-for-source.nix prunes the legacy side of every recovered rename out of the emitted schema, so an alias node does not become a form field (and, inside an attrsOf, does not land in required). removeAtPath walks properties and, since #629, a wildcard step through additionalProperties/items.

It does not walk oneOf/anyOf, and the deployment-method attrTag union emits each branch at oneOf[i].properties.<tag> rather than as properties. So a from path under deployment-method prunes nothing: the node stays in the served schema. There is a TODO at prunePaths recording this.

No rename lands under deployment-method today, which is why this is a gap rather than a bug. It closes by having removeAtPath descend each branch of a oneOf/anyOf and apply the same step, no-opping in the branches where the head is absent.

Follow-up split out of the work on #629. `core/lib/schema-for-source.nix` prunes the legacy side of every recovered rename out of the emitted schema, so an alias node does not become a form field (and, inside an `attrsOf`, does not land in `required`). `removeAtPath` walks `properties` and, since #629, a wildcard step through `additionalProperties`/`items`. It does not walk `oneOf`/`anyOf`, and the `deployment-method` `attrTag` union emits each branch at `oneOf[i].properties.<tag>` rather than as `properties`. So a `from` path under `deployment-method` prunes nothing: the node stays in the served schema. There is a `TODO` at `prunePaths` recording this. No rename lands under `deployment-method` today, which is why this is a gap rather than a bug. It closes by having `removeAtPath` descend each branch of a `oneOf`/`anyOf` and apply the same step, no-opping in the branches where the head is absent.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#629 schema updates automated
fediversity/fediversity
Reference
fediversity/fediversity#1504
No description provided.