`fromJsonSchemaDocument`: import `if` / `then` / `else`
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
ajvfor 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Effect-TS/effect
-
`fromJsonSchemaDocument`: import open `patternProperties`Forse già presa @effect-bot l’ha presa 1 giorno fa. Aperta
Effect-TS/effect#10048 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
`fromJsonSchemaDocument`: intersect an object with `anyOf` branches that re-declare an enum propertyAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
I maintainer di solito rispondono entro 1 giorno
-
`fromJsonSchemaDocument`: import `dependentRequired` (draft-07 `dependencies`)Forse già presa @effect-bot l’ha presa 1 giorno fa. Aperta
Effect-TS/effect#10046 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
`fromJsonSchemaDocument`: import the `not` keywordForse già presa @effect-bot l’ha presa 1 giorno fa. Aperta
Effect-TS/effect#10044 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
cli: run command setup before fallback promptsForse già presa @effect-bot l’ha presa 1 giorno fa. Aperta
Effect-TS/effect#10043 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Effect-TS/effect
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
gnosis/gnosis_vpn#661 ·
I maintainer di solito rispondono entro 1 giorno
-
content-freshness: staleOwnedContent doc comments still say 'complete receipt' (follow-up to #7912)Apertatriage:bug-verified
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
I maintainer di solito rispondono entro 1 giorno
-
fix: reject sourceStorage/packagedStorage bucket that differs from the stack default (fail loud)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Eyevinn/open-videocore#1300 ·
I maintainer di solito rispondono entro 1 giorno
-
nextjs-tracking
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
cloudflare/vinext#4390 ·
I maintainer di solito rispondono entro 1 giorno
-
kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
kubernetes-sigs/headlamp#8175 ·
I maintainer di solito rispondono entro 2 giorni