Skip to content

tracking: lower one conjunction alike wherever its keywords are written, in order #2211

Backlog
0 of 2 issues completed

Description

@OmarAlJarrah

Goal

One conjunction lowers to one result. A schema's allOf, oneOf and anyOf, and the keywords written beside them, give the same IR wherever each keyword is written, and a spelling that lowers apart is found by a generated case, not by hand.

Problem

Measured at morphic @9be567bdb:

Weighed and set aside

  • Reading every keyword as a conjunct of its own, so that no later step could tell two spellings apart. It is not sound. JSON Schema defines additionalProperties by the properties and patternProperties of its own schema object, items by prefixItems, minContains and maxContains by contains, then and else by if, and the unevaluated keywords by every applicator beside them, so parting one from its object changes what the schema admits. One conjunct per schema object, which statement.Statement already holds, is the form that is sound.
  • Replacing merge with a judge of the source. merge compares built nodes, where the spellings of each dialect are already one; the source-side admission holds kinds and value sets alone.

Plan

In order. A step waits only on the steps it names.

  1. What the golden spec reaches: openapi: the info notes of a member fold are reported once per position that composes the same declarations #2067 and openapi: a format a conjunct writes beside an allOf principal is kept, not read #2107 (P0), then openapi: decide whether a union beside a scalar body is the union or the scalar keeping it #2108 and openapi: decide which borrowed detail a folded member keeps where no declaration writes one #2184 (P1). No step below waits on these, and none of these waits on a step below.
  2. harness: the schema cases move a case's keywords as one unit, so none splits a body across allOf entries #2209, the cases for a body split across entries and for two constructs written apart.
  3. The open decisions, settled together and written into docs/compilers/openapi.md as the rule conjunction-decisions: openapi: decide whether a null-typed branch listing other enum values is the union's null #1906, openapi: decide whether a node a fold mints takes an ID no branch order moves #1992, openapi: decide whether an allOf naming only the schema itself is a reference loop #2042, openapi: decide whether a 3.0 array's missing items is judged per allOf entry or per conjunction #2048, openapi: decide whether allOf entries that agree on a bound fold it when they disagree on another keyword #2049, pass: decide whether a discriminator mapping to a schema that does not compose its model is refused #2051, openapi: decide whether an allOf whose read is cut short lowers to the top type keeping the allOf rather than to a model #2070, openapi: decide whether the finding for an allOf entry's unread keywords names all of them in one report #2072, openapi: decide whether a union beside a scalar body is the union or the scalar keeping it #2108, openapi: decide whether one union admitting no null takes the null out of the reference a type list beside it gives #2120, openapi: decide which borrowed detail a folded member keeps where no declaration writes one #2184, openapi: decide whether a model's own default or XML hint outranks one a composed model brings #2202.
  4. openapi: an allOf entry's keyword is read for the position only where a list names it, and any other is kept #2210, one table classing every schema keyword, after harness: the schema cases move a case's keywords as one unit, so none splits a body across allOf entries #2209 and before openapi: decide whether a 3.0 array's missing items is judged per allOf entry or per conjunction #2048 and openapi: decide whether allOf entries that agree on a bound fold it when they disagree on another keyword #2049 (which read the table). openapi: an items on an allOf entry beside a declared array is kept, where beside the allOf it types the list #2039 and openapi: a discriminator on an inline allOf entry is kept verbatim where beside the allOf it is typed #2052 follow alongside it.
  5. openapi: a oneOf beside an allOf whose entry writes an anyOf lowers apart from the two on one schema #2110, after harness: the schema cases move a case's keywords as one unit, so none splits a body across allOf entries #2209: the new cases size the union spellings before one implementation replaces the three.
  6. Discriminators and the member fold's costs, judgment and details (ir: a discriminator has no home for a route a consumer reads and never writes #1863, openapi: discriminator inference reads nothing of a mapping naming some variants #1798, openapi: a discriminator beside a kept union routing to its own base moves to Unmodeled #1806, openapi: discriminator settlements each walk a shared hierarchy, so the compile goes superlinear #1008, openapi: a hierarchy composing a redeclaring model at every level costs time quadratic in its depth #1993, openapi: a type read through more than 64 alias scalars is decided as though the chain ended there #1994, openapi: two models composing each other can settle one member to two types #1995, openapi: decide which borrowed detail a folded member keeps where no declaration writes one #2184): detail selection (openapi: decide which borrowed detail a folded member keeps where no declaration writes one #2184 and siblings) lands on a main carrying fix(compilers/openapi): keep a written detail over a lent one #2185, or moves to a follow-up PR built on fix(compilers/openapi): keep a written detail over a lent one #2185 if fix(compilers/openapi): keep a written detail over a lent one #2185 is not yet on main.

Out of scope

Each is ranked and scheduled on its own:

Priority: P0, the tier of its highest open step (#2067, #2107).

Sub-issues

Sub-issues

0 of 2 Issues completed
Loading 2 sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:P0type:chore

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions