Skip to content

feat(jsonschema): JSON Schema type inference v1#1592

Draft
TizzySaurus wants to merge 3 commits intoarktypeio:mainfrom
TizzySaurus:json-schema-type-inference-v1
Draft

feat(jsonschema): JSON Schema type inference v1#1592
TizzySaurus wants to merge 3 commits intoarktypeio:mainfrom
TizzySaurus:json-schema-type-inference-v1

Conversation

@TizzySaurus
Copy link
Copy Markdown
Contributor

@TizzySaurus TizzySaurus commented Feb 27, 2026

  • Add preliminary type inference for jsonSchemaToType
  • Fix incorrect parsing behaviour where prefixItems is specified with items as an array (f405773)
    jsonSchemaToType({
      type: "array",
      prefixItems: [{type: "string"}, {type: "number"}],
      items: [{type: "boolean"}]
    });
    
    // Runtime logic before: [string, number, ...boolean[]]
    // Runtime logic after: [string, number, boolean]

JSON Schema keyword checklist:

  • arrays
    • items
    • prefixItems
    • additionalItems
    • maxItems
    • minItems
    • 🚫 uniqueItems (n/a)
  • composition
    • allOf
    • anyOf
    • const
    • enum
    • ⚠️ oneOf (treated same as anyOf, for simplicity)
    • 🚫 not (n/a)
  • objects
    • properties
    • required
    • ⚠️ additionalProperties (get typed as unknown)
    • ⚠️ patternProperties (get typed as unknown)
    • 🚫 maxProperties (n/a)
    • 🚫 minProperties (n/a)
  • strings
    • pattern
    • format

@TizzySaurus TizzySaurus force-pushed the json-schema-type-inference-v1 branch from 622ec29 to e35816a Compare February 27, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To do

Development

Successfully merging this pull request may close these issues.

1 participant