Skip to content
This repository was archived by the owner on Nov 16, 2026. It is now read-only.
This repository was archived by the owner on Nov 16, 2026. It is now read-only.

Validators drop the description of anyOf union fields #139

Closed

Description

@sentry-junior

The generated validators lose a field's OpenAPI description when the field's schema is an anyOf union. The description is on the union in the spec, but the validator emits a bare union with no description attached.

Example: the monitor (detector) config field.

  • Spec path: paths["/api/0/organizations/{organization_id_or_slug}/detectors/{detector_id}/"].put.responses.200.content["application/json"].schema.properties.config. Since 1.52.0 it's an anyOf of the per-type configs, with description: "Configuration of the monitor, which depends on its type" beside the anyOf.
  • In 1.53.0, vUpdateOrganizationDetectorResponse in dist/valibot.js emits config: v.union([...]) with no v.description(...). The Zod output has no description for it either. types.gen.d.ts still has it as JSDoc.
  • In 1.51.0 the field was a plain object, and the validators carried v.description("Configuration of the monitor, which depends on its type").
  • Consumers that read field descriptions from the validators lose them. For example, the Sentry CLI's generated skill reference now shows an empty description for this field. Union members keep their own descriptions. Only the description on the union itself is lost.

scripts/describe-valibot-schemas.mjs only rewrites the v.metadata({ description }) calls that the generator emits, so the description is probably missing before that step runs. This is an inference. I haven't traced the generator.

via @BYK.

--

View Session in Sentry

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions