Import types into the type registry
Type import is complete. One call turns a JSON Schema 2020-12 document, an Apiome type-definition
bundle or the components/schemas of an OpenAPI 3.1 description into reusable types in the type
registry, on the Primitives REST API.
- Three sources.
source_kindisjson-schema(each$defsentry becomes a type, or the whole document when it has none),type-def-bundle(each entry undertypes) oropenapi(each entry undercomponents/schemas). Every type is checked as a JSON Schema 2020-12 schema. - References stay intact. A reference that only works inside the source, such as
#/$defs/Moneyor#/components/schemas/Money, is rewritten to a relative registry reference (./money), so imported types still point at each other. A string that only declaresformat: email,uuid,uri,date,date-timeortimeis pointed at the matching core type; setmap_core_formatstofalseto leave it alone. - Review before you save.
POST /v1/primitives/{tenant}/import/reviewis a dry run: each type comes back as new, identical or conflict, with its validation report and the rewrites that would be made. Nothing is saved. - Nothing is replaced silently.
POST /v1/primitives/{tenant}/importskips identical types and keeps an existing type on a conflict, unlessresolutionssaysoverwriteorrenamefor it. - From anywhere.
POST /v1/primitives/{tenant}/import/stagefetches and parses pasted text, a URL or a file in a public GitHub repository, as JSON or YAML, and lists the types it found. - A record of every import.
GET /v1/primitives/{tenant}/importslists past imports with what each one created, overwrote, renamed and skipped.
The same import is in the app: Build → Primitives & types → “Import from schema” — see Import types.
