Problem
Core currently leaves the normative model for inline choices internally inconsistent and underspecified.
The inline-union section says:
- the presence of
$extends on a choice selects the inline representation;
$extends refers to a common abstract base;
- all alternatives extend that common base;
selector names an injected string property;
- the injected property may shadow a string property of the base.
The generic $extends rules, however, say that $extends may only be used on object and tuple, excluding choice.
The text also does not define how the injected selector participates in the effective selected object schema. This matters for additionalProperties, required, property-count constraints, dependencies, composition, and constraints on a shadowed base property.
This ambiguity was exposed by json-structure/sdk#184.
Decisions required
- Confirm that
$extends is valid on choice and is the sole switch between tagged and inline representations.
- State whether every alternative must independently extend the common base, or whether the choice-level
$extends implicitly applies the base to each alternative.
- Define the effective selector property schema. At minimum, its value is a string equal to one key in
choices.
- Define how selector shadowing combines with constraints declared by the base property.
- Define whether the selector counts for object-level constraints such as
minProperties and maxProperties.
- Define how the injected selector interacts with
additionalProperties: false or a schema-valued additionalProperties on the selected alternative.
Acceptance criteria
- The inline-choice and generic
$extends sections agree.
- A conforming inline-choice example uses a closed selected object and demonstrates selector handling.
- Invalid combinations of
$extends, selector, abstract bases, and alternatives are stated explicitly.
- The Core meta-schema is updated to enforce the resulting rules where representable.
Problem
Core currently leaves the normative model for inline choices internally inconsistent and underspecified.
The inline-union section says:
$extendson achoiceselects the inline representation;$extendsrefers to a common abstract base;selectornames an injected string property;The generic
$extendsrules, however, say that$extendsmay only be used onobjectandtuple, excludingchoice.The text also does not define how the injected selector participates in the effective selected object schema. This matters for
additionalProperties,required, property-count constraints, dependencies, composition, and constraints on a shadowed base property.This ambiguity was exposed by json-structure/sdk#184.
Decisions required
$extendsis valid onchoiceand is the sole switch between tagged and inline representations.$extendsimplicitly applies the base to each alternative.choices.minPropertiesandmaxProperties.additionalProperties: falseor a schema-valuedadditionalPropertieson the selected alternative.Acceptance criteria
$extendssections agree.$extends,selector, abstract bases, and alternatives are stated explicitly.