Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`fromJsonSchemaDocument`: import `if` / `then` / `else`

Aperta
#10,045 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@effect-bot ci sta già lavorando.

Dal 28/10/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

What is the problem this feature would solve?

On 4.0.7, importing a schema that uses if/then/else fails:

SchemaRepresentation.fromJsonSchemaDocument(JsonSchema.fromSchemaDraft07({
  type: "object",
  properties: { kind: { type: "string" }, size: { type: "number" } },
  if: { properties: { kind: { const: "box" } } },
  then: { required: ["size"] }
}))
// Cannot import JSON Schema keyword "if": Effect has no equivalent constraint.

dependabot-2.0.json uses if 5 times, for rules that depend on package-ecosystem, and github-workflow.json 8 times.

Context: validating .github/dependabot.yaml and GitHub workflow files with SchemaRepresentation.fromJsonSchemaDocument against the SchemaStore documents dependabot-2.0.json and github-workflow.json, to replace ajv. Since #7410 the importer rejects keywords it cannot represent, which is the right failure, but it means both real-world documents cannot be imported at all. This is one of five gaps found in those two documents; each is filed separately.

What is the feature you are proposing to solve the problem?

Import if/then/else as a check: when the value decodes against if, it must also satisfy then, otherwise else. Missing then or else means no constraint on that side, as in the specification.

What alternatives have you considered?
  • Stripping the keywords with onEnter: imports, but drops the conditional rules, so invalid files pass.
  • Keeping ajv for these documents: what we do today.
Lingua principale
TypeScript
Stelle
16.7k
Fork
808
Merge medio
11h 33m
PR unite (30g)
855

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Effect-TS/effect

Tutte le issue di Effect-TS/effect

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.