Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#10,045 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@effect-bot がすでに取り組んでいます。

2026年10月28日 から。

  • #10079 @effect-bot による — オープン

評価

この issue はまだ評価されていません。

説明

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.
主要言語
TypeScript
スター
16.7k
フォーク
808
平均マージ
11時間 11分
マージ済み PR(30日)
840

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Effect-TS/effect のほかの issue

Effect-TS/effect の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。