Skip to content

Representation of items and prefixItems in Schema #2

@travisnewhouse

Description

@travisnewhouse

For an array type, there are two properties that specify the schemas of array items:

  • items is a JSON Schema (either object or boolean).
  • prefixItems is an array of JSON Schema correspond to elements in an array instance.

High-level Schema has Items field with type []*SchemaProxy, but it does not store any of the values of prefixItems. Low-level Schema is similar.

I think confusion would arise if prefixItems are stored in Items and items schema stored as the last element of Items. There would be no way to disambiguate between items being present or absent. So, one recommendation is to define field Items of type *SchemaProxy and field PrefixItems of type []*SchemaProxy.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions