Export a spec
Apiome reconstructs the full OpenAPI 3.1 document (or Arazzo workflow document, or JSON Schema) for a published version on demand. You can download it from the CLI or fetch it directly over REST in JSON or YAML.
Those three have dedicated endpoints, but they are not the whole export surface: Apiome emits 66 formats — AsyncAPI, GraphQL, Proto3, Avro, Thrift, Smithy, TypeSpec, WSDL, XSD, OData, EDI X12, SAP IDoc, HL7 v2, FHIR, COBOL copybooks and more — through the export-target registry. The full list, and which formats round-trip (import and export) versus export only, is generated at Supported formats.
Run apiome export targets to see the same list for a specific version, and
apiome export evidence --target <format> to see what a given conversion preserves before you
generate it.
In the app: the Export dialog
The Export dialog exports one source to one format, and shows what the conversion keeps before you download anything. The Export dialog is the overview: where to open it, its four steps and the version's Export panel. The steps in detail:
-
Open it from a catalog item (click "Export" in the item's header) or from a version (on Versions, open the version's ⋯ menu and click "Export to another format…").
-
The Source step names the item and version, and measures how well each format can carry it. Click "Choose target".
-
Pick a format. Each card shows a fidelity badge for this source, such as lossless or lossy, and the line under the cards says how much is preserved (64% preserved). A card that cannot export this source is greyed out, with the reason written on it. Click "Continue".
-
The fidelity report lists every construct the conversion drops, approximates or invents, and where each one lands. If the conversion loses something, tick the acknowledgement, or type the phrase it asks for when the result would be types only.
-
Click "Export" ("Export anyway" after an acknowledgement), review the file, and click the "Download" button that names the file, or "Download .zip" for everything in one archive.
A format that writes several files (an Avro or Protobuf schema set, for example) previews its main file, and the zip button reads "Download all files (.zip)". It runs the export as a job and downloads the job's bundle: every emitted file plus a
manifest.jsonthat lists them. The download starts when the job finishes; if the job fails, the dialog shows why.
“Open in Export Studio” at the foot of the dialog carries the source, target and options into the Export studio, which adds options, a verify step and a job you can watch. For catalog items, including several at once, see Export catalog items.
Formats the Export dialog offers
The dialog, apiome export targets and GET …/export/targets all offer the same 66 formats.
Most export from any source. A few write one format's own structure back out, so they export only
a source imported in that format: an EDI X12 interchange in the catalog exports back to EDI X12,
but an OpenAPI version does not. For any other source their card is greyed out with that reason,
and an export request is refused with 422.
Formats that write HTTP routes or saved requests (Kong, Gateway API, Envoy, Istio, Traefik, Apigee,
AWS API Gateway, Azure API Management, Postman, Insomnia, Bruno, Hoppscotch, Thunder Client and the .http
file) need at least
one HTTP operation, and the data-contract formats (ODCS, Kafka Connect) need at least one record type.
API Blueprint needs at least one HTTP operation or one type. For a source without one, the card is
greyed out with that reason; for example, a GraphQL schema with no HTTP bindings cannot become a Kong
configuration.
A format that needs a tool this deployment does not have installed is greyed out the same way, with
the missing tool named on the card. It is never offered and then left to fail: an export to it is
refused with 422 and the same reason before anything runs. apiome export targets shows the reason
in its Why not column, and apiome export <format> stops with it (exit 2) before starting a job.
Exports checked with the format's own tool
Some exports are checked with the tool that format's community uses, the same tool Apiome runs when it imports that format. These tools only check an export; none is needed to write one, so the format is offered whether or not the server has its tool. Without it, the export is still checked the way the last column says.
| Export | Checked with | Without the tool |
|---|---|---|
| Protobuf (gRPC), Connect RPC | buf build compiles every .proto | Not compiled; the export says it was not re-validated |
| TypeSpec | tsp compile to OpenAPI, and that OpenAPI must import | Read back by Apiome's TypeSpec reader |
| Smithy | smithy validate on each file, then smithy ast builds the model to import | Read back by Apiome's Smithy reader |
| RAML | AMF's RAML 1.0 validation | Read back by Apiome's RAML reader |
| API Blueprint | drafter, with no errors and no warnings | Read back by Apiome's API Blueprint reader |
| Thrift | The Thrift compiler, plus thriftpy2 | Checked by thriftpy2 and Apiome's Thrift reader |
| Cap'n Proto | capnp compile | Not compiled; the export says it was not re-validated |
| FlatBuffers | flatc | Read back by Apiome's FlatBuffers reader |
| CORBA IDL | omniidl (corba profile) or idlc (dds profile) | Read back by Apiome's CORBA IDL reader |
| FHIR | The HL7 FHIR validator | Checked by Apiome's structural FHIR rules |
| COBOL copybook | cb2xml parses the copybook, and the layout it reads must match the one Apiome planned | Read back by Apiome's copybook reader |
| X12 implementation guide | pyx12's segment dictionary, for the envelope and segments carried from X12 | Checked by Apiome's guide rules only |
| ASN.1 | asn1tools parses and compiles the module, and it must define exactly the planned types | Always checked: asn1tools ships with Apiome |
| AsyncAPI | The AsyncAPI parser | Not parsed; the export says it was not re-validated |
| Kubernetes CRD | Apiome's structural-schema rules, then kubeconform against the apiextensions.k8s.io/v1 schema | Checked by Apiome's structural-schema rules only |
| WADL | The W3C WADL schema, and an XML Schema processor builds its grammar | Always checked: the schema and processor ship with Apiome |
| Google API Discovery | The Discovery metaschema and the document's rules | Always checked: the metaschema ships with Apiome |
The sections below say what each check rejects. CloudEvents, XML-RPC, Kafka Connect and the agent formats are checked against their specification's rules instead: see Formats checked against their specification. How an export is checked explains the four verdicts and the lint of the exported file.
When an item has nothing to export from
Exports are built from the source file captured when the item was imported. If that file was not kept, or was not stored because it contained credentials, the Export dialog and the Export studio say so instead of failing. Click "Re-import" to open Import to catalog and import the source again.
Over the API, every export route answers 422 with a structured detail:
{"code": "source-not-captured" | "source-withheld", "message", "artifactId", "versionId", "reimport": true}.
An export job fails with SOURCE_LOAD_FAILED, and its error.context carries the same source_code
and reimport.
OpenAPI 3.2, 3.1, 3.0 and Swagger 2.0
Exporting to OpenAPI writes OpenAPI 3.1 by default. Set openapi_version to pick another
version. On the target card and in the options, a badge says what that choice does: 3.1 · native,
3.2 · newer, or 3.0 · downgrade / 2.0 · downgrade.
-
3.2 writes OpenAPI 3.2.0 and keeps what only 3.2 can express:
- a
QUERYoperation, as the path'squerykey; - any other method, such as
REPORTorPURGE, underadditionalOperations; - the tag tree of an item imported from OpenAPI 3.2, as
tagswithparent,summaryandkind.
The document is checked against the OpenAPI 3.2 schema before you download it. Tools that only read 3.1 may not open it.
- a
-
3.1 has no
QUERYor custom methods and no tag tree. Those operations are kept on thex-apiome-query-operationandx-apiome-additional-operationsextensions, which 3.1 tools do not read. The tag tree is not written. The fidelity report lists each operation as approximated and the tag tree as dropped, and says to export 3.2 to keep them. -
3.0 and 2.0 are downgrades of the 3.1 document. They report the same losses, plus what their version cannot express.
Every version is checked against its own official schema before you download it, and when you
import a document: the OpenAPI 3.2, 3.1 (including 3.1.0, 3.1.1 and 3.1.2) and 3.0 schemas, and the
Swagger 2.0 schema. A fault comes back with its location, such as paths//pets/get/responses/200.
A document whose version has no schema to check against is reported as not validated, never as
valid.
The fidelity report is computed for the version you pick, so changing openapi_version updates
it. From the CLI, run apiome export openapi-3.1 <item> --out openapi.json --option openapi_version=3.2.
Webhooks, callbacks and the full set of 3.2 security-scheme fields are not written yet, in any version.
Bundled, dereferenced or split into files
An OpenAPI export keeps shared objects, such as a Pet schema used by five operations, under
components, and each use points at it with $ref. The $ref handling option (refs) picks
how they are written. It works with every OpenAPI version, Swagger 2.0 included.
| Choice | What you get | Use it when |
|---|---|---|
| bundle (default) | One file. Shared objects sit under components, and each use is a $ref such as #/components/schemas/Pet | Almost always: the smallest file, and every OpenAPI tool reads it |
| dereference | One file. Every $ref is replaced by a copy of what it points at, so nothing has to be looked up | A tool that cannot follow $ref, or a reader who wants each operation complete in one place |
| split | A .zip of files: openapi.json keeps info, servers and tags; each path item goes to paths/…json and each component to components/<section>/<name>.json, joined by relative $ref | Keeping a large API in a repository, one file per schema and path |
Dereference keeps components too, with its entries dereferenced. A discriminator.mapping
or a security requirement that names a component still resolves. A $ref with a description
beside it keeps that description.
Split names each file from its path or component: /pets/{petId} becomes paths/pets_petId.json.
Characters other than letters, digits, ., _ and - become _. Two names that would clash get a
-2 suffix. Swagger 2.0 writes paths/ and definitions/; its shared parameters and responses stay
in swagger.json, because Swagger 2.0 cannot reference them from another file. Import the .zip (or
the folder, with the CLI) and Apiome bundles it back into the same document.
Circular references
A schema can refer to itself, such as a Tree whose children are Trees, or two schemas can refer
to each other, such as Person → Company → Person. Such a cycle can never be fully copied out, so
dereference never tries. The Reference cycles option (ref_cycles) decides what happens:
- keep-ref (default): the export is written. Each
$refthat would start the loop again stays a$refintocomponents("items": {"$ref": "#/components/schemas/Tree"}). The fidelity report lists each cycle as anopenapi-dereference-cycleloss, with where it first occurs and how many times. - error: the export is refused (HTTP
422). The message names the cycles, for example The document has 3 circular $ref(s) (#/components/schemas/Company, …). Export bundled or split, or choose keep-ref.
bundle and split keep every $ref, so a cycle is never an issue for them. A dereferenced
document that would grow past two million JSON values is refused with a message to export it
bundled or split instead.
Choose it
-
In Export studio: on the Options step of the OpenAPI target, pick $ref handling: bundle, dereference or split. With dereference, pick Reference cycles as well. See Export studio → Options.
-
In the Export dialog: pick the OpenAPI card; the same two choices are under Target options. With split, “Download all files (.zip)” downloads every file.
-
From the CLI: add
--refs(and, withdereference,--ref-cycles):apiome export openapi --project payments-api --version 1.0.0 --output ./payments --refs splitapiome export openapi --project payments-api --version 1.0.0 --output openapi.json \--refs dereference --ref-cycles errordereferenceandsplitrun the export as a job and write JSON. Withsplit, an--outputfolder gets the files unpacked; a path ending in.zipkeeps the archive. The job command takes the same flags (apiome export openapi-3.1 payments-api --out ./payments --refs split), and--option refs=splitdoes the same thing. -
From the REST API: send
"options": {"refs": "split"}(or"refs": "dereference", "ref_cycles": "error") withPOST /v1/export/{tenant}/jobs,/document,/previewor/verify./documentreturns the main file only; a split export's other files come from the job download.
Each choice is checked on the OpenAPI construct corpus: a split export imports back to exactly the bundled document, a dereferenced one imports and dereferences to itself, and neither adds a schema error to a document that was valid bundled.
AsyncAPI 3.1, 3.0 and 2.6
When to export to AsyncAPI
- Round-trip an event API. An item imported from AsyncAPI, or any other event source, exports back lossless: its channels, operations, messages and schemas are kept.
- Describe a REST or RPC API as messages. A REST or RPC item exports lossy. Each
request / response operation is reframed as a
sendoperation with areply. The HTTP method, path and response status are not represented, and the fidelity report says so for each operation (see Worked examples). - Serve consumers on an older AsyncAPI. Write 3.0 or 2.6 instead of 3.1; what the older version cannot hold is listed before you download.
AsyncAPI export at a glance
| Step | Where | Details |
|---|---|---|
| Pick the AsyncAPI card and its version | Export dialog → Events → AsyncAPI | Versions |
| See what is kept, reframed or dropped | The fidelity report on the card | Understand export fidelity |
| Trust the file | Checked with the AsyncAPI parser before every download | Exports checked with the format's own tool |
| Export from the CLI | apiome export asyncapi --project … --version … -o asyncapi.json, or apiome export asyncapi-3 <item> --out … | Export from the CLI |
A REST or RPC source is lossy, so from the CLI it exits non-zero unless you add --force.
Versions
Exporting to AsyncAPI writes AsyncAPI 3.1 by default. Set asyncapi_version to 3.0 or 2.6
for consumers on an older version; the badge then reads 3.0 · downgrade or 2.6 · downgrade.
- 3.0 has the same structure as 3.1 but not what 3.1 added. A
ros2server or operation binding is dropped. A message example whoseheadersis not a map loses its headers. A schema format that names AsyncAPI3.1.0is written as3.0.0. - 2.6 is the AsyncAPI 2 structure: each channel carries its own
publish/subscribeoperation, and a server has oneurl. It first drops what 3.0 drops, then everything else 2.x cannot express.
The fidelity report is computed for the version you pick. Each thing the older version cannot hold
is listed with where it was (/servers/robot/bindings/ros2), as dropped or approximated. Every
version is checked with the AsyncAPI parser before you download it. From the CLI, run
apiome export asyncapi-3 <item> --out asyncapi.json --option asyncapi_version=3.0.
CloudEvents and xRegistry
CloudEvents is the CNCF's common envelope for events, and xRegistry is its catalog: a registry of schemas and CloudEvents message definitions with its own read API. Apiome writes both, and serves its own catalog as an xRegistry. In the Export dialog and in Export studio, the CloudEvents and xRegistry cards sit under Events.
When to use which
- A sample event to send or test with: CloudEvents. Export CloudEvents for one structured-mode
CloudEvents 1.0 JSON event per publish or subscribe operation (
<name>.cloudevents.json), with itstype,source,idand a sampledatapayload. Options:specversion,indent. - An event catalog to hand over as a file: xRegistry. Export xRegistry for one document with your types as a JSON Schema registry and your events as CloudEvents message definitions — checked against the official xRegistry schema.
- A catalog tools read live: the xRegistry API. Nothing to export — point an xRegistry client at your organization's read-only xRegistry, public or for members, over every published version.
Both exports keep events and types only. A REST, RPC or GraphQL item loses its operations, so its fidelity report starts with a critical warning and the export asks you to confirm; an event item (AsyncAPI, CloudEvents, xRegistry) does not.
CloudEvents and xRegistry at a glance
| CloudEvents | xRegistry document | xRegistry API | |
|---|---|---|---|
| From | Any item; one event per publish or subscribe operation | Any item with a type or an event | Every published version of an organization |
| You get | <name>.cloudevents.json: one event, or an array of them | <registry id>.xregistry.json | GET /v1/browse/tenants/{tenant}/xregistry (public) and /v1/xregistry/{tenant} (members) |
| Options | specversion, indent | registry_id, source, indent | ?inline=* |
| An event becomes | A CloudEvent with a sample data payload | A message definition: type, source, datacontenttype, dataschemaxid | The same message definitions, one message group per project service |
| Types become | Only an event's payload, written as sample data | JSON Schemas (draft 2020-12) | JSON Schemas, versioned by the published version |
| Checked by | The CloudEvents 1.0 rules (what it rejects), and re-import | Structure, the official xRegistry schema, and re-import | — |
| Imports back with | Import to catalog (RPC and event formats) | Import a CNCF xRegistry | The same importer, from the API's documents |
| CLI | apiome export cloudevents | apiome export xregistry | curl (see the API) |
| Details | — | xRegistry from any source | Serve your catalog as an xRegistry |
xRegistry from any source
When to export to xRegistry
- Publish an event catalog as a CNCF xRegistry. An AsyncAPI, CloudEvents or other event item
becomes one xRegistry document: its types as a schema registry and its
events as CloudEvents message definitions, with each event's
type,source,datacontenttypeand payload schema. Tools that read xRegistry (an xRegistry server, the CloudEvents SDK generators) can load it as is. - Share an API's types as a schema registry. A REST, gRPC, GraphQL or data-schema item exports its types as JSON Schemas. Its request/response operations are not events, so the fidelity report lists them as dropped.
- Round-trip an xRegistry item. An item imported from xRegistry exports back with its registry id, schemas, message groups and CloudEvents attributes, and re-imports to the same types and events.
xRegistry export at a glance
| Step | Where | Details |
|---|---|---|
Pick the xRegistry card (options: registry_id, source, indent) | Export dialog → xRegistry (under Events) | Where to find the xRegistry card |
| See how schemas, message groups, CloudEvents attributes and payloads are written | The fidelity report on the card | How the item is written |
| Check what is approximated, dropped or synthesized | The fidelity report | What the fidelity report lists |
| Trust the file | Checked, then re-imported, before every download | How an xRegistry export is checked |
| Export from the CLI | apiome export xregistry <item> --out orders.xregistry.json | Export from the CLI |
How the item is written
You get one <registry id>.xregistry.json document (xRegistry specversion 1.0-rc1). It is the
same file Import a CNCF xRegistry reads, so it imports back.
| In the source | In the document |
|---|---|
| The item's name | registryid (a slug, unless you set registry_id; an imported registry keeps its own), name and description |
| Each type | One schema in the schema group named after the registry: format JsonSchema/draft/2020-12, one version 1. A reference to another type is #/definitions/<schema>, and the schema carries the types it reaches under definitions, so each schema is valid on its own |
| Each service with an event operation | A message group, with the CloudEvents/1.0 envelope |
| Each publish or subscribe operation | A message: its envelopemetadata holds the CloudEvents type and source (each with a value) and the message's other headers (subject …) |
| The event's payload | dataschemaformat and a dataschemaxid that names the type's schema (/schemagroups/orders/schemas/Order), or an inline dataschema |
The CloudEvents type is the event's own, else its channel's address, else its name. The source is
the event's own (or its channel's, or a source header's default), else the source option, else
/<registry id>. datacontenttype is the event's media type, else application/json. A value Apiome
fills in is listed as synthesized.
Request/response operations have no message form and are not written. The document has no
endpoints: the item's servers, and the usage, protocol and URIs of an imported endpoint, are not
written (an imported endpoint's messages are written in a message group of the same name).
What the fidelity report lists
- Approximated: for a source in another format, each type (projected to JSON Schema), each channel (its bindings, protocol and parameters are not written), and each service written as a message group. An imported xRegistry endpoint, written as a message group.
- Dropped: request/response operations and services with no event, and the servers. A source
with REST, RPC or GraphQL operations also gets a critical warning at the top of the report:
xRegistry is an event registry, so only its types and events are exported. That makes the export a
severe conversion you confirm before it runs; export to OpenAPI or AsyncAPI as well to keep the
operations. An event source (AsyncAPI, CloudEvents, xRegistry) needs no confirmation. An imported
schema with neither a document nor a URL is dropped too, because an xRegistry schema version needs
one. An operation or type that reads back under another key (a message is keyed
<group>.<message>, a schema by its schema id) is listed as dropped under its old key, with the new one. - Synthesized: the registry id, a group, schema or message id made legal or unique, and every
CloudEvents
type,sourceordatacontenttypethe source did not state.
An imported schema-only registry exports lossless.
How an xRegistry export is checked
Every document is checked before you download it:
- Structure: legal ids that match their keys; a
formatand a default version on every schema; every JSON Schema valid (draft 2020-12) with its references resolving inside it; and on every message theCloudEvents/1.0envelope, atypeand asourcevalue, adatacontenttype, and adataschemaxidthat names a schema of the document. - The xRegistry specification: the document validates against the official xRegistry CloudEvents
registry schema, so each schema version carries its
formatand its content (schemaorschemaurl). - Round trip: the document imports again through the xRegistry importer, and every schema and message it writes reads back.
A document that fails any check is never offered for download, and the reason is shown.
Where to find the xRegistry card
The Export dialog offers xRegistry under Events, with a fidelity badge for the item you are exporting:
| Source | Badge | Confirmation |
|---|---|---|
| An event API (AsyncAPI, CloudEvents) or an imported xRegistry | lossy, with its preserved share | Not needed |
| A REST, RPC or GraphQL API, or a JSON Schema item | lossy | Needed for an API with operations: only its types are exported |
| A gateway configuration or an agent card | Greyed out, with the reason | — |
The card's options are Registry Id and Source (both empty for the defaults) and Indent.
From the CLI, run apiome export xregistry <item> --out orders.xregistry.json; add
--option registry_id=orders or --option source=/orders to set them. The command prints the
fidelity report (the preserved share and the worst losses first) and exits non-zero for a lossy
export unless you add --force. A REST, RPC or GraphQL source also needs --confirm.
To let a tool read your published APIs live instead of downloading a file, point it at the xRegistry API.
Agent interfaces: MCP, A2A and agent manifests
Apiome can hand an API to an AI agent in three ways. MCP Tool Definitions turns its operations into
the tools an MCP host lists. An A2A Agent Card describes it as an agent with skills. And each
organization's Browse page publishes agents.json and llms.txt, which list every public API
for agents and crawlers. In the Export dialog and in Export studio, the two export cards sit
under Agents & tools.
When to use which
- An agent should call the API: MCP Tool Definitions. Export MCP tool definitions for one tool per operation, with an input schema an MCP host accepts. Serve the tools from an MCP server; the descriptor describes them, it is not a server.
- The API should be offered as an agent, or an A2A agent republished: A2A Agent Card. Export an
A2A Agent Card for the
agent-card.jsonan A2A agent serves. An imported A2A agent exports back lossless; a REST or RPC API becomes one agent whose skills are its operations. - Agents and crawlers should find every public API: agent manifests. Nothing to export — Browse
serves
agents.jsonandllms.txtfor each organization, over its published, public versions.
Agent interfaces at a glance
| MCP Tool Definitions | A2A Agent Card | agents.json / llms.txt | |
|---|---|---|---|
| From | Any source with an operation an agent can call | An agent, or any source with an operation that is not an event | Every published, public version of an organization |
| You get | <server>.mcp.json (one per service with grouping per-service, in a .zip) | agent-card.json (one per agent for an ACP listing, in a .zip) | Two files Browse serves at /tenant/{tenant_slug}/agents.json and /llms.txt |
| Options | protocol_version, grouping, output_schema, include_deprecated | skills_from, url, include_deprecated | — |
| An operation becomes | A tool: name, description (with its HTTP binding), inputSchema, outputSchema | A skill: id, name, tags and media types (no schemas) | A link to its Browse page |
| Fidelity report | What the MCP fidelity report lists | What the fidelity report lists | — |
| Too many tools or skills | More than 128 in one descriptor needs confirmation — the grouping guard | The same, for a card's skills | — |
| Checked by | The MCP Tool schema of the chosen revision, and re-import | The A2A AgentCard schema, and re-import | — |
| Imports back with | Import to catalog (MCP) | Import an A2A Agent Card | Import agentic-web site manifests |
| CLI | apiome export mcp | apiome export a2a | — |
| Where | The MCP card | The A2A card | For agents on the organization's Browse page |
Each export's fidelity report lists, with a reason, what an agent interface cannot carry: servers, events and streams, auth beyond bearer and OAuth 2, and every name Apiome had to make up.
MCP tool definitions
Exporting to MCP Tool Definitions turns the API's operations into the tools an MCP host lists,
so an agent can call them. You get an MCP server descriptor, <server>.mcp.json. It holds the
server's name, title and version, capabilities.tools, and one tool per operation. It is the
same file Import to catalog reads for an MCP server, so it imports back.
Each tool has:
- a
name— the operationId when it is a legal MCP tool name, else one made from it (or from the method and path), unique in the descriptor (listPets,GET_orders_id,listOrders_2). A name Apiome made up is listed as synthesized in the fidelity report; - a
description— the summary and description, a sentence saying what a successful call returns, and, for an HTTP operation, a last sentence with its HTTP binding — the verb and path, the success and error status codes, and the response headers (HTTP: GET /pets/{petId} — returns 200; errors 404; response headers X-Rate-Limit.). A tool has no HTTP fields, so this text is all an agent sees of them; - an
inputSchema— one object holding the path, query and header parameters and the request body, as JSON Schema; - an
outputSchema(2025-06-18) — the success response's schema, when the response is an object. A response that is an array or a single value is described in the description only, because MCP requires an object output schema.
Operations that are not callable — events, streams, and the resources and prompts of an imported MCP server — get no tool, and the fidelity report lists them as dropped. Deprecated operations are left out unless you turn on include_deprecated. A source with no callable operation is greyed out in the Export dialog with that reason.
Options:
- protocol_version —
2025-06-18(default) or2025-03-26, which has nooutputSchema. - grouping —
single(default), orper-service: one descriptor per service,<server>-<service>.mcp.json, downloaded together as a.zip. A tool has the same name either way. - output_schema — on by default. A server that serves these tools must return
structuredContentmatching eachoutputSchema; turn it off if yours does not. - include_deprecated — also write a tool for each deprecated operation.
What the MCP fidelity report lists
Each item says why it is kept, approximated, dropped or synthesized:
| What | In the report | Why |
|---|---|---|
| Each operation that becomes a tool | Kept, or synthesized when Apiome made its name | A name Apiome made up is not the operationId |
| Its HTTP binding (verb, path, status codes, response headers) | Approximated | Written into the tool's description as text; the server that serves the tool makes the HTTP call |
| A bearer or OAuth 2 auth scheme | Kept | MCP authorization is OAuth 2.1 with bearer tokens |
| An API key, basic or digest auth, OpenID Connect, or the OAuth 2 implicit or password flow | Approximated | The server that serves the tools must hold the credential (OAuth 2.1 removed the implicit and password flows) |
| Mutual TLS, a cookie API key or any other scheme | Dropped | MCP authorization has nowhere to put it |
| Event and streaming operations, and channels | Dropped | A tool returns one result. MCP can stream progress (over SSE) while one call runs, not a series of results |
| Deprecated operations (unless include_deprecated) and an MCP server's resources and prompts | Dropped | They are not tools |
| Named types | Approximated | Inlined into each tool schema that uses them |
Constraint keywords (minimum, pattern, format …) | Kept | They stay JSON Schema keywords in the tool schemas |
| The servers | Dropped | The MCP server that serves the tools decides where calls go |
| The server name and each grouping decision | Synthesized | The name is made from the API's name; grouping decides which tools share a descriptor |
Grouping guard
Model providers cap how many tools one request can carry (often at 128), and hosts trim long tool
lists. When one descriptor would hold more than 128 tools, the fidelity report has a critical
grouping guard item, so the export is a severe conversion: the Export dialog, the CLI
(--confirm) and export jobs ask you to confirm before anything is written.
To clear it, set grouping to per-service so each service gets its own descriptor, or export
fewer operations. When fewer than a quarter of the source's operations and channels become tools
(an event API with one callable operation, say), the report warns that the export is
near-empty.
The A2A Agent Card export has the same guard for a card of more than 128 skills.
How MCP tools are checked
Every tool is checked against the MCP Tool schema of the chosen revision before you download it. The descriptor describes the tools; it is not a running server. The descriptor also imports back: Import to catalog reads the same tools, with the same names and input schemas.
Where to find the MCP Tool Definitions card
The Export dialog offers MCP Tool Definitions under Agents & tools, with a fidelity badge for the item you are exporting:
| Source | Badge | Why |
|---|---|---|
| A REST, GraphQL or RPC API | lossy, with its preserved share | Each tool's HTTP binding becomes description text; servers, events and streams are dropped |
| An imported MCP server | lossy | Its resources and prompts are not tools, so they are dropped. Its tools export back unchanged |
| A schema-only item, an event-only API or an A2A agent | Greyed out, with the reason | There is no operation an agent can call |
From the CLI, run apiome export mcp <item> --out petstore.mcp.json, or
apiome export mcp <item> --out <folder> --option grouping=per-service for one file per service. The
command prints the fidelity report — the preserved share and the worst losses first — and exits
non-zero for a lossy export unless you add --force. An export that trips the
grouping guard needs --confirm.
A2A Agent Card
When to export to an A2A Agent Card
- Republish an agent. An agent imported from an A2A Agent Card exports back lossless: its name, description, version, provider, capabilities, default modes, auth and every skill (id, tags, examples, modes and auth) are kept, so the card imports back to the same agent.
- Describe an API as an agent. A REST or RPC item exports lossy. The API becomes one agent and its operations become its skills. A skill has no parameters or schemas, so the fidelity report lists each operation as approximated.
A2A export at a glance
| Step | Where | Details |
|---|---|---|
| Pick the A2A Agent Card card | Export dialog → Agents & tools → A2A Agent Card | How the card is written |
| See what is kept, reframed or dropped | The fidelity report on the card | What the fidelity report lists |
| Trust the file | Checked against the A2A AgentCard schema before every download | How the card is checked |
| Export from the CLI | apiome export a2a <item> --out agent-card.json | Export from the CLI |
A REST or RPC source is lossy, so from the CLI it exits non-zero unless you add --force.
How the card is written
You get agent-card.json, the file an A2A agent serves at /.well-known/agent-card.json. It is the
same file Import A2A Agent Cards reads, so it imports back.
A source with several agents (an ACP agent listing) writes one card per agent,
<agent>.agent-card.json, downloaded together as a .zip.
From an agent source, each agent is written as its own card: protocolVersion, name,
description, url, preferredTransport, additionalInterfaces, iconUrl, provider, version,
documentationUrl, capabilities, securitySchemes, security, the default modes, and one skill per
skill the agent declares. An ACP agent is written as an A2A card with protocolVersion 0.3.0.
From a REST or RPC source, the API is reframed as one agent:
| In the source | In the card |
|---|---|
| The API's title, description and version | The agent's name, description and version |
| The first server | url, with preferredTransport HTTP+JSON |
| Every other server | additionalInterfaces |
| Each operation | One skill: its id is the operation's name (listPets), its name is that name in words (List pets), its tags are the operation's tags (else the service's name) |
| Request and response media types | The skill's inputModes and outputModes, when they differ from application/json |
| The auth schemes Apiome recorded at import | securitySchemes, and each operation's own requirement as its skill's security |
| A streaming operation | capabilities.streaming: true |
Event operations have no skill and are dropped. Deprecated operations are left out unless you turn on
include_deprecated. Two operations with the same name get listPets and listPets_2. An agent
must still serve the card's skills at its url: the card describes the agent, it is not one.
Options:
- skills_from —
operations(default): one skill per operation.tags: one skill per tag, whose description lists the operations it groups; an operation with no tag joins its service's skill. - url — the endpoint to write when the source has none. Without it, the card gets
https://agent.example.com/a2aand the fidelity report says to replace it. - include_deprecated — also write a skill for each deprecated operation.
What the fidelity report lists
- Approximated: for a REST or RPC source, the API itself (reframed as an agent) and each operation written as a skill. For an ACP agent, each skill.
- Dropped: event operations, deprecated operations (unless include_deprecated), channels and
named types (a skill declares media types, not schemas). From an agent source, the card's JWS
signatures(they sign the original bytes; sign the exported card again), a security scheme whosetypeA2A does not define, and aproviderwith nourl. - Synthesized: a field A2A requires that the source left out —
description,url,version,protocolVersionor a skill'sdescription. - Grouping guard: a card of more than 128 skills is a critical item, so you confirm before
exporting; set skills_from to
tagsto write one skill per tag instead. A card that covers fewer than a quarter of the source's operations and channels is flagged near-empty. See Grouping guard.
An A2A agent's skills are kept as they are.
How the card is checked
Every card is checked against the A2A AgentCard schema (protocol 0.3.0) before you download it: the
required fields, each skill's id, name, description and tags, each provider and interface,
and each security scheme's required members. A card that fails is never offered for download.
Where to find the A2A Agent Card card
The Export dialog offers A2A Agent Card under Agents & tools. Its badge reads lossless for an imported A2A agent and lossy for a REST, GraphQL or RPC API (or an MCP server), which is reframed as an agent. It is greyed out for a source with no agent and no operation that is not an event (a schema-only item), with that reason.
From the CLI, apiome export a2a <item> --out agent-card.json prints the fidelity report and exits
non-zero for a lossy export unless you add --force; add --option skills_from=tags for one skill
per tag. The card imports back through Import A2A Agent Cards
with the same skills.
SQL DDL from any source
When to export to SQL DDL
- Create the database an API describes. Export a SQL script of
CREATE TABLEstatements for PostgreSQL, MySQL or standard SQL: one table per object type, typed columns,NOT NULL,CHECKconstraints and enumerations, with nested objects as JSON columns or as tables of their own. - Model it in a schema tool. Export the same tables as DBML for dbdiagram.io and dbdocs, or as a Prisma schema for an application that uses Prisma.
- Change a live database step by step. Export Liquibase changesets or a Flyway migration: the first export creates every table, and each later export writes only what changed since.
SQL holds data schemas only, so an API's operations are left out, with a critical warning at the top
of the fidelity report. Unlike most targets, SQL keeps validation rules as CHECK constraints.
SQL DDL export at a glance
| Step | Where | Details |
|---|---|---|
Pick the SQL DDL card, its Output (ddl, dbml, prisma, liquibase, flyway) and Dialect | Export dialog → Data schema & graph → SQL DDL | Where to find the SQL DDL card |
| See how types, fields, names, keys and nested objects become tables | The options on the card | How the item is written |
| Check what is kept, approximated, dropped or made up | The fidelity report on the card | What the fidelity report lists |
| Write DBML or a Prisma schema instead | Output dbml / prisma | DBML and Prisma |
| Migrate a database: full changesets, then only the changes | Output liquibase / flyway | Liquibase and Flyway changelogs |
| Read the tables as a diagram | 6. Review & Generate in Export studio → ERD | Read a database export as an ERD |
| Trust the file | Parsed in its dialect and read back (DBML, Prisma and Liquibase by their own tools) before every download | What the fidelity report lists |
| Export from the CLI | apiome export sql, dbml, prisma, liquibase or flyway, with --dialect | Where to find the SQL DDL card |
How the item is written
Exporting to SQL DDL writes the item's types as CREATE TABLE statements, <Name>.sql, for a
database that stores what the API describes. Each object type becomes a table.
- Columns. Each field is a typed column: text is
TEXT(orVARCHAR(n)when it has amaxLength), integersSMALLINT/INTEGER/BIGINT, a decimalNUMERIC(38, s)with the scale frommultipleOf, a timestampTIMESTAMPTZ, a UUIDUUID, and so on. A required field isNOT NULL, and a field's default is itsDEFAULT. - Rules.
minimum/maximum(and the exclusive bounds),minLength, anenumand apatternbecomeCHECKclauses on the column. - Enumerations. PostgreSQL gets
CREATE TYPE … AS ENUM, MySQL an inlineENUM(…), and standard SQL aVARCHARwithCHECK (… IN (…)). - Names. Tables and columns are written in
snake_case(OrderLine→order_line,placedAt→placed_at). A name that starts with a digit gets a prefix, one that is too long is cut with a short hash, two that end up the same get_2, and a reserved word such asuserororderis quoted.
Options:
- dialect —
postgres(default),mysqloransi(standard SQL). - nested — what happens to a field that holds an object, a union, a map or a list:
json(default): oneJSONB(PostgreSQL) orJSONcolumn. A list of plain values is a native array on PostgreSQL (TEXT[]) and JSON elsewhere.tables: an object becomes a foreign key to its table, and a list becomes its own table — a junction table for a list of objects (order_lines), or a child table of(owner_id, position, value)for a list of values (order_tags). Every table needs a key for this. It uses the table's declared key, else a requiredidfield, else a generatedidcolumn.
- schema_name — create the tables in this schema (
CREATE SCHEMAfirst, every name qualified). - output —
ddl(default) writes the SQL script;dbmlandprismawrite the same tables in another schema language (see DBML and Prisma below).
Foreign keys come last, as ALTER TABLE … ADD CONSTRAINT, so the tables can be created in any order.
What the fidelity report lists
The same model always gives the same script, and the fidelity report says what each part of it became:
- Dropped — with a critical warning for an API. A schema describes data only, so every operation,
channel and service is dropped. An item that has any starts its report with a critical warning
that only its data schemas are exported, with how many services, operations and channels are left
out; export to OpenAPI or AsyncAPI as well to keep them. A constraint SQL has no column rule for is
dropped too: a pattern in standard SQL (no regular-expression check), a
multipleOfon a non-decimal column, the item counts of a list written as its own table. Any other constraint a column has no rule for is listed as approximated, "not written". - Approximated. A union has no relational form: its value is stored whole in one JSON column
(
JSONBon PostgreSQL), with no table per variant, so which variant a row holds is not a column. A nested object, map or list written as JSON (nestedjson), and a type a dialect approximates (a UUID asCHAR(36)in MySQL, a MySQLDATETIMEwith no time zone) are approximated too. - Synthesized. Every decision the projection makes up is its own item: a generated or inferred key, a junction or child table, a renamed table or column, a decimal precision Apiome had to choose, and each table written under a name the item does not have.
- Kept. SQL keeps validation. Each field whose constraints become column rules is listed as
preserved, naming them: a minimum or maximum, a length, an enumeration and (PostgreSQL and MySQL) a
pattern as
CHECKclauses, amaxLengthas theVARCHARsize, amultipleOfas the decimal scale. When the table is renamed (UserProfilebecomesuser_profile), the field is listed under the name it reads back as (user_profile.age).
An item imported from SQL keeps its primary, unique and foreign keys. Written in the dialect it was read in, it also keeps its column types, defaults and checks exactly. In another dialect, a default or check expression written for the original dialect is dropped and listed.
Checked before you download it. Every script is parsed with sqlglot in its dialect, and read back
by Apiome's SQL reader. From the CLI, run apiome export sql <item> --out schema.sql --dialect mysql --option nested=tables.
DBML and Prisma
Set output to write the same tables, columns, keys, enums and foreign keys in another language (or, for migrations, as Liquibase or Flyway changesets). The dialect, nested and schema_name options still apply.
dbmlwrites<Name>.dbmlfor dbdiagram.io and dbdocs: oneTableper table with the dialect's column types, anEnumfor each enumeration (in every dialect), thepk,not null,unique,defaultandchecksettings,indexesfor composite keys, and aReffor each foreign key.prismawritesschema.prisma: onemodelper table, named in PascalCase and mapped back to its table with@@map. Columns get Prisma types with@db.*native types (String @db.VarChar(40),Decimal @db.Decimal(38, 2)), and each foreign key becomes a named@relationon both models. Every model needs a key, so each table gets one as with nestedtables. Prisma supportspostgresandmysqlonly, and schema_name on PostgreSQL only (@@schema).
What the language cannot hold is listed in the fidelity report. Prisma has no CHECK constraint, no
interval type and no nullable list. It also cannot relate a foreign key that references a column that
is neither a primary nor a unique key, so that one stays as plain columns.
Checked before you download it. A DBML file is parsed by @dbml/core, and a Prisma schema must
pass prisma validate. From the CLI, run apiome export prisma <item> --out schema.prisma or
apiome export dbml <item> --out schema.dbml.
Liquibase and Flyway changelogs
A one-off CREATE TABLE script is not how a team changes a live database: it runs migrations. Set
output to liquibase or flyway to get the same tables as migration changesets instead. The
dialect, nested and schema_name options still apply.
liquibasewrites a Liquibase formatted SQL changelog,NNNN-<Name>.changelog.sql: the--liquibase formatted sqlheader and one--changeset apiome:<id>per statement, each with a--commentsaying what it does. Set changeset_author to use your own author instead ofapiome. Ids keep counting across exports, so each changelog can be added to your master changelog next to the earlier ones.flywaywrites one Flyway versioned migration,V<n>__initial_schema.sqland thenV<n>__update_schema.sql, holding the same statements.
The first export creates everything; the next ones write only the changes. The first time you export an item in a dialect and mode, the changelog creates every enum type, table and foreign key. Apiome then keeps that export as the item's baseline. Each later export compares the item with the baseline and writes only what changed since:
- it compares the two models type by type and field by field, and finds the types that were added, removed or changed;
- for those tables only, it writes the statements, in an order that never breaks a reference: dropped foreign keys, dropped tables, new enum types and values, new tables, added, dropped and altered columns, then new foreign keys.
| Change in the item | PostgreSQL | MySQL | Standard SQL |
|---|---|---|---|
| A new type | CREATE TABLE | CREATE TABLE | CREATE TABLE |
| A removed type | DROP TABLE (after its foreign keys) | DROP TABLE | DROP TABLE |
| A new field | ADD COLUMN | ADD COLUMN | ADD COLUMN |
| A removed field | DROP COLUMN | DROP COLUMN | DROP COLUMN |
| A new type, required or default | ALTER COLUMN … TYPE / SET NOT NULL / SET DEFAULT | MODIFY COLUMN | ALTER COLUMN … SET DATA TYPE / SET NOT NULL / SET DEFAULT |
| A new enum value | ALTER TYPE … ADD VALUE (outside a transaction) | MODIFY COLUMN … ENUM(…) | Reported, not altered |
| A new reference | ADD CONSTRAINT … FOREIGN KEY | ADD CONSTRAINT … FOREIGN KEY | ADD CONSTRAINT … FOREIGN KEY |
A change SQL cannot apply in place is not written and is listed in the fidelity report, so you can
migrate it by hand: a column's CHECK constraint or identity, a table's primary or unique key, and a
removed PostgreSQL enum value. An export with nothing to change writes a changelog with no
changesets.
Every real export (a download or an export job) moves the baseline forward; a preview never does. The baseline is kept per item, dialect and mode, so a PostgreSQL Liquibase changelog and a MySQL Flyway migration of the same item each keep their own. Set from_scratch to write everything again and start a new baseline — for a new database, or after a changelog you did not apply.
Checked before you download it. Every statement must parse in its dialect, and a Liquibase
changelog must pass liquibase validate (run against an offline database, so nothing is applied).
From the CLI, run apiome export liquibase <item> --out <folder>, or
apiome export flyway <item> --out <folder> --dialect mysql.
Where to find the SQL DDL card
The Export dialog offers SQL DDL under Data schema & graph. One card writes every output:
pick Output (ddl, dbml, prisma, liquibase or flyway) and Dialect (postgres, mysql
or ansi) in its options.
| Source | Badge |
|---|---|
| Any item with a record type — a REST, GraphQL or RPC API, a JSON Schema item, an imported SQL script | types-only, with its preserved share: SQL holds data schemas only |
| A gateway configuration, an agent card, or anything else with no record type | Greyed out, with the reason |
An API with operations also starts its fidelity report with the critical "types only" warning (see What the fidelity report lists).
From the CLI, each output has a verb of its own; all take --dialect:
| Command | Writes |
|---|---|
apiome export sql <item> --out schema.sql (also sql-ddl, ddl) | A SQL script |
apiome export dbml <item> --out schema.dbml | DBML |
apiome export prisma <item> --out schema.prisma | A Prisma schema |
apiome export liquibase <item> --out <folder> | A Liquibase changelog |
apiome export flyway <item> --out <folder> | A Flyway migration |
--dialect mysql is the same as --option dialect=mysql. Each command prints the fidelity report and,
because SQL keeps types only, exits non-zero unless you add --force.
Data-lake and analytics schemas
API payloads usually land in a lake or a warehouse. Apiome writes the table schemas those systems need, from one typed projection of the item's types: one table per root record, nested records as structs, lists, maps, and logical types for dates, timestamps, decimals and UUIDs. In the Export dialog and in Export studio, the Apache Arrow / Parquet and Apache Iceberg cards sit under Data schema & graph (see Where to find the data-lake cards).
When to use which
- Dataframes, Flight services and Parquet files: Arrow / Parquet. Export Apache Arrow schemas, with the Parquet message each table becomes. An item imported from Arrow exports back exactly.
- A BigQuery table: BigQuery. Pick Output
bigqueryon the same card for the table-schema JSONbq mk --schematakes (see BigQuery and Spark). - A Spark DataFrame or table: Spark. Pick Output
sparkfor theStructTypeDDLDataType.fromDDLparses. - A lakehouse table that evolves: Iceberg. Export Apache Iceberg schemas whose field IDs stay the same on every re-export, so the table's schema can evolve.
All four keep types only. A REST, RPC or GraphQL item loses its operations, so its fidelity report starts with a critical warning and the export asks you to confirm. Unions and enumerations are approximated in every mode and constraints are dropped (see the rules per mode).
Data-lake schemas at a glance
| Arrow / Parquet | BigQuery | Spark | Iceberg | |
|---|---|---|---|---|
| Card | Apache Arrow / Parquet, Output arrow | The same card, Output bigquery | The same card, Output spark | Apache Iceberg |
| You get | <table>.arrow.json and <table>.parquet.txt | <table>.bigquery.json (or one bundle) | <table>.spark.ddl (or one bundle) | <table>.iceberg.json |
| Nested types | struct, list, map, dense union | RECORD, REPEATED, unions flattened | STRUCT, ARRAY, MAP, unions flattened | struct, list, map with their own IDs, unions flattened |
| Field IDs | — | — | — | Assigned once, kept by every re-export |
| Checked by | pyarrow, then re-import | BigQuery's table-schema rules | Spark's DDL grammar | pyiceberg, unique field IDs |
| Imports back with | Import a spec (Arrow) | — | — | — |
| CLI | apiome export parquet | apiome export bigquery | apiome export spark | apiome export iceberg |
| Details | Apache Arrow and Parquet | BigQuery and Spark | BigQuery and Spark | Apache Iceberg |
Apache Arrow and Parquet from any source
When to export to Arrow / Parquet
- Give a data platform the schema of what an API carries. Export the item's types as Apache Arrow schemas. DuckDB, Polars, Spark, pandas, Flight services and every Parquet reader understand them, so a lake table or a dataframe gets the same columns as the API.
- Create Parquet files with the right columns. Each table comes with the Parquet message its Arrow
schema becomes, the
message schema { … }a Parquet writer declares. - Round-trip an Arrow item. An item imported from Arrow exports back to the schema it was read from: each column's unit, time zone, width, precision, dictionary encoding, extension and metadata.
- Create a BigQuery table or a Spark DataFrame schema. The same tables are written as BigQuery
table-schema JSON (output
bigquery) or SparkStructTypeDDL (outputspark). See BigQuery and Spark.
Arrow describes tables only, so an API's operations are left out, with a critical warning at the top of the fidelity report.
Arrow / Parquet export at a glance
| Step | Where | Details |
|---|---|---|
Pick the card and its Output (arrow, bigquery, spark) | Export dialog → Data schema & graph → Apache Arrow / Parquet | Where to find the data-lake cards |
Set the options (table, parquet, bundle, indent) | The options on the card | How the item is written |
| Write BigQuery or Spark schemas instead | output bigquery / spark | BigQuery and Spark |
| See how records, lists, maps, unions and logical types become columns | This section | Types |
| Check what is kept, approximated, dropped or made up | The fidelity report | What the fidelity report lists |
| Trust the file | Constructed by pyarrow, then re-imported (BigQuery and Spark: checked against their rules), before every download | How an Arrow export is checked |
| Export from the CLI | apiome export parquet, bigquery, spark or arrow | Where to find the data-lake cards |
How the item is written
An Arrow schema is one table. The tables are the item's root records: the records no other record holds. Every record a table reaches is nested inside it. For each table you get:
<table>.arrow.json: the Arrow schema in Arrow's JSON integration form, the same file Import a spec reads, so it imports back. The table's name is the schema'snamemetadata, and descriptions aredescriptionmetadata on the schema and its fields.<table>.parquet.txt: the Parquet message pyarrow's Parquet writer derives from that schema. A schema with a union has none, because Parquet has no union type. The fidelity report says so.
Options:
- output:
arrow(the default),bigqueryorspark. See BigQuery and Spark. - table: export only this record (its name or key) as the table. Empty (the default) exports every root record.
- parquet: also write the Parquet messages (on by default; output
arrowonly). - bundle: output
bigqueryorsparkonly. Write every table into one file instead of one file per table (off by default). - indent: JSON indentation (
2by default,0for compact output).
Types
| In the item | In the Arrow schema |
|---|---|
| An object (record) | struct of its fields, in field-number order when the source numbers them |
| A list | list with an element named item (fixedsizelist when an Arrow source declared one) |
| A map | map of entries: a non-null key and a value |
| A union (one-of) | Dense union of its members |
| An enumeration | Dictionary-encoded utf8 (int32 index) |
| A date / date-time | date32 (DAY) / timestamp in microseconds, UTC |
| A time / duration | time64 / duration, both in microseconds |
| A decimal | decimal128(38, s), the scale from multipleOf (else 9, reported) |
| A UUID | 16-byte fixedsizebinary with the arrow.uuid extension |
| An integer / float | int with its width and sign / float32 or float64 |
| Bytes | binary (fixedsizebinary when its length is fixed) |
| An untyped value | utf8 with the arrow.json extension |
A required field is a non-nullable column. A record that contains itself cannot be a struct of
itself, so its inner occurrence is a JSON string column (arrow.json). A record with no fields is
the same, because Arrow defines a struct by its children.
BigQuery and Spark
Output bigquery and spark write the same tables, with the same types, for the two warehouse
engines that do not read Arrow schemas.
<table>.bigquery.json: the table schemabq mk --schemaand the BigQuery API take, a JSON list of{"name", "type", "mode", "fields", "description"}. Create a table withbq mk --table mydataset.orders Order.bigquery.json.<table>.spark.ddl: one line of SparkStructTypeDDL, whatDataType.fromDDLandStructType.fromDDLparse, for examplespark.read.schema(open("Order.spark.ddl").read()).
With bundle on, you get one file instead: schemas.bigquery.json, an object of table name → schema,
or schemas.spark.ddl, with a -- <table> line before each table's DDL line.
| In the Arrow schema | BigQuery | Spark |
|---|---|---|
struct | RECORD with its fields | STRUCT<name: type, …> |
list | Its element with mode: REPEATED (a list of lists: a repeated RECORD holding item) | ARRAY<…> |
map | A repeated RECORD of key and value (reported) | MAP<…, …> |
union | A RECORD with one optional field per member (reported) | A STRUCT with one optional field per member (reported) |
| A non-null column | mode: REQUIRED | NOT NULL |
utf8, dictionary columns / binary | STRING / BYTES | STRING / BINARY |
int | INTEGER (unsigned 64-bit: NUMERIC, reported) | TINYINT … BIGINT, the next signed width for an unsigned one |
decimal128(p, s) | NUMERIC(p, s), or BIGNUMERIC(p, s) past NUMERIC's 29 integer digits | DECIMAL(p, s) (at most 38 digits) |
date32 / timestamp with a time zone / without | DATE / TIMESTAMP / DATETIME | DATE / TIMESTAMP / TIMESTAMP_NTZ |
time64 | TIME | STRING (reported) |
duration | INTERVAL | INTERVAL DAY TO SECOND |
A UUID (arrow.uuid) | STRING (reported) | STRING (reported) |
JSON (arrow.json) | JSON | STRING |
Descriptions become each column's description (BigQuery) or COMMENT (Spark). BigQuery column names
are letters, digits and underscores, so another name is rewritten (ship-to → ship_to) and reported.
A record nested deeper than BigQuery's 15 levels is a JSON column. Spark names are back-quoted, so
every name is kept.
The fidelity report lists each of these approximations under its table. No importer reads BigQuery or Spark schemas, so nothing about a re-import is reported for these outputs.
What the fidelity report lists
- Dropped: every operation, channel and service, under a critical "types only" warning
(the export is
near-emptyand needs confirmation). Validation constraints are dropped too, except a fixed length or list size that the column's own type keeps. - Read back differently: what a re-import of the export gives back is measured, not guessed. A
nested record is named after the path of its column (
Categoryreads back ascategory). A second table lives in its own file, so importing the export's first schema does not read it. An enumeration reads back as a string, and an alias as the type it names. - Approximated: a union (a dense Arrow union, with no Parquet message for its table), an enumeration
(a dictionary column that keeps no list of allowed values), a recursive record or untyped value written
as JSON, and an Arrow interval unit pyarrow cannot build, written as
MONTH_DAY_NANO. - Made up: a decimal's precision and scale when the source states none.
An item imported from Arrow exports back as it was read; only its unions are listed as approximated.
The same rules apply to every output mode, and to Iceberg, with the differences each format brings:
| Construct | Arrow / Parquet | BigQuery | Spark | Iceberg |
|---|---|---|---|---|
| Operations, channels, services | Dropped (critical "types only") | Dropped (critical) | Dropped (critical) | Dropped (critical) |
| Validation constraints | Dropped | Dropped | Dropped | Dropped |
| A union | Approximated: dense union | Approximated: a RECORD of optional members | Approximated: a STRUCT of optional members | Approximated: a struct of optional members |
| An enumeration | Approximated: dictionary column | Approximated: STRING | Approximated: STRING | Approximated: string |
| Field IDs | None to report | None to report | None to report | Made up: one per field, kept by re-exports |
| What a re-import reads back | Measured | No importer | No importer | No importer |
| Checked by | pyarrow, then re-import | BigQuery's schema rules | Spark's DDL grammar | pyiceberg, unique field IDs |
An export that fails its check is never delivered: the export job fails and names the problem.
How an Arrow export is checked
Before an export is delivered, every .arrow.json file must:
- parse as the Arrow JSON integration form;
- be constructed by pyarrow, so a schema pyarrow cannot build cannot ship;
- import again through the Arrow importer.
The Parquet messages are pyarrow's own output and are not checked again.
The BigQuery and Spark outputs are checked without the engines (bq needs Google credentials, and Spark
a Java runtime):
- BigQuery: every schema must pass BigQuery's documented table-schema rules: legal and unique column
names, known types and modes, sub-fields only on a
RECORD(and at least one), at most 15 nesting levels,NUMERIC/BIGNUMERICprecision and scale in range, descriptions of at most 1,024 characters. - Spark: every DDL line must parse under Spark's column-type grammar, the one
DataType.fromDDLreads, with only type names Spark defines.
Apache Iceberg from any source
When to export to Iceberg
- Create an Iceberg table with the columns an API carries. Export the item's types as Apache Iceberg table schemas, the schema JSON a table's metadata holds. Use it to create the table in a catalog (with pyiceberg, Spark, Trino or Flink).
- Evolve the table as the API changes. Every column has a field ID, and every re-export of the same item keeps it. A reordered column keeps its ID, a new column gets a new one, and a removed column's ID is never used again. That is what Iceberg schema evolution needs.
Iceberg describes tables only, so an API's operations are left out, with a critical warning at the top of the fidelity report.
Iceberg export at a glance
| Step | Where | Details |
|---|---|---|
Pick the card (options: table, indent) | Export dialog → Data schema & graph → Apache Iceberg | Where to find the data-lake cards |
| Keep field IDs stable across exports | Automatic, per item | Field IDs |
| Check what is kept, approximated, dropped or made up | The fidelity report | What the fidelity report lists |
| Trust the file | Parsed by pyiceberg, with every field ID checked unique, before every download | What the fidelity report lists |
| Export from the CLI | apiome export iceberg | Where to find the data-lake cards |
How the item is written
You get one <table>.iceberg.json per table: {"type": "struct", "schema-id": 0, "fields": [ … ]}. The
tables and columns are the same as the Arrow export's: one table per
root record, every record it reaches nested inside it. table exports one record instead, and
indent sets the JSON indentation.
| In the Arrow schema | In the Iceberg schema |
|---|---|
struct | struct |
list | list with its own element-id |
map | map with its own key-id and value-id |
union | A struct with one optional field per member (reported) |
| A non-null column | "required": true |
utf8, dictionary columns / binary / fixedsizebinary(n) | string / binary / fixed[n] |
A UUID (arrow.uuid) | uuid |
int 8–32 bits / 64 bits | int / long (an unsigned integer takes the next signed width; unsigned 64-bit is decimal(20, 0), reported) |
float32 / float64 | float / double |
decimal128(p, s) | decimal(p, s) (at most 38 digits) |
date32 / time64 | date / time |
timestamp with a time zone / without | timestamptz / timestamp |
duration / interval / JSON | long / string / string (reported) |
A field's description is its doc.
Field IDs
Iceberg identifies every column, nested fields, list elements, map keys and values included, by a
field ID. A source rarely has them, so Apiome assigns them on the first export and keeps them for the
item. The next export of the same item reuses each column's ID, even after columns were added, removed
or reordered. A new column gets an ID above every ID the table has ever had, so a removed column's ID is
never handed out again. Columns are matched by their path in the table (lines → element → sku), so
a renamed column counts as a new column and gets a new ID.
An item imported from Arrow whose columns carry PARQUET:field_id keeps those IDs.
What the fidelity report lists
- Made up: every field ID the source does not carry, one item per field. It is assigned once and kept by every re-export.
- Dropped: every operation, channel and service, under a critical "types only" warning, and
validation constraints, except a fixed length that
fixed[n]keeps. - Approximated: a union written as a struct of optional fields, an enumeration written as a
string, and each type Iceberg does not have, listed under its table (a duration aslong, a JSON value asstring…). See the rules per mode.
Before an export is delivered, pyiceberg must parse every schema, and every field ID in it must be unique and positive, or the export job fails. No importer reads Iceberg, so an Iceberg export is not re-imported.
Where to find the data-lake cards
The Export dialog and Export studio offer two cards under Data schema & graph, both marked multi-file (one file per table):
- Apache Arrow / Parquet writes every Arrow mode. Pick Output
arrow(the default),bigqueryorspark. Parquet (on by default) adds the Parquet messages, and Bundle puts every BigQuery or Spark table into one file. - Apache Iceberg writes Iceberg schemas. Field IDs are not an option: Apiome keeps them for you (see Field IDs).
| Source | Apache Arrow / Parquet | Apache Iceberg |
|---|---|---|
| A REST, GraphQL or RPC API, a JSON Schema item, an imported SQL script | types-only, with its preserved share | types-only, with its preserved share |
| An imported Arrow schema | lossless: it exports back as it was read | types-only (its field IDs are made up) |
| A gateway configuration, an agent card, or anything else with no record type | Greyed out, with the reason | Greyed out, with the reason |
An API with operations also starts its fidelity report with the critical "types only" warning. A public
item's Export dialog on Browse offers both cards too; a multi-file export downloads as a .zip.
From the CLI, each mode has a verb of its own:
| Command | Writes |
|---|---|
apiome export parquet <item> --out <folder> | Arrow schemas and Parquet messages (output=arrow) |
apiome export bigquery <item> --out <folder> | BigQuery table schemas (output=bigquery) |
apiome export spark <item> --out <folder> | Spark StructType DDL (output=spark) |
apiome export arrow <item> --out <folder> | Any mode, picked with --option output=… |
apiome export iceberg <item> --out <folder> | Iceberg schemas |
Add --option bundle=true for one BigQuery or Spark file, or --option table=<record> for one table.
apiome export bigquery with --option output=spark is a usage error. Each command prints the fidelity
report and, because these formats keep types only, exits non-zero unless you add --force.
Apache Avro from any source
When to export to Avro
- Give Kafka producers and consumers the schemas of an API's data. Any item's types become Avro
record, enum, union and map schemas, one
.avscper type, each with the Schema Registry subject it is registered under. - Register them on a schema registry. Push the export to a Confluent-compatible registry through a connector; see Push to a schema registry.
Avro describes data, not APIs: operations and channels are not written, so the export is types-only for every source. Export to OpenAPI or AsyncAPI as well to keep them.
Avro export at a glance
| Step | Where | Details |
|---|---|---|
| Pick the Avro card and its options | Export dialog → Data schema & graph → Apache Avro | Where to find the Avro card |
| See how types, fields and names are written | The fidelity report on the card | How the item is written |
| Choose the subject each schema is registered under | The card's subject options | Subjects |
| See what Avro cannot carry, and the defaults it adds | The fidelity report on the card | What the fidelity report lists |
| Trust the files: every schema parses | Automatic before every download | How an Avro export is checked |
| Push the schemas to a registry | The REST API, through a schema registry connector | Push to a schema registry |
How the item is written
Exporting to Avro writes one .avsc JSON schema per named type, in a folder per namespace
(com.acme.Order is com/acme/Order.avsc). Set the output_syntax option to avdl for one
Avro IDL document instead.
- Types. An object becomes a
recordwith its fields in order, an enum anenum, a union an Avro union, and a map amapwith string keys. A list is anarray. - Nullable fields. A field that may be null is the union
["null", T]. - Logical types. A
dateis anintwithlogicalType: date, adate-timealongwithtimestamp-millis, auuidastringwithuuid, and adecimalbyteswithdecimal. An item imported from Avro keeps its own logical types. - Names. Avro names are letters, digits and
_: any other character is replaced, and enum symbols likewise. The namespace is the item's own, or the namespace option for a source that has none.
Subjects
Each schema has the Schema Registry subject it is registered under, chosen with the subject_naming option:
subject_naming | Subject | Example |
|---|---|---|
record_name (the default) | {namespace}.{Type}-value, one subject per type | com.acme.Order-value |
topic_name | {topic}-value, set topic | orders-value |
topic_record_name | {topic}-{namespace}.{Type}-value, set topic | orders-com.acme.Order-value |
Set subject_role to key to end each subject in -key instead of -value. These are
Confluent's RecordNameStrategy, TopicNameStrategy and TopicRecordNameStrategy.
What the fidelity report lists
- Operations and channels are dropped (critical): Avro is types-only.
- Validation rules (lengths, ranges, patterns, formats with no logical type) are dropped: Avro does not enforce them.
- Unions are carried as an Avro union when every member is a record, an enum, a
fixedor a primitive; any other union is approximated. - Nullable fields are approximated as
["null", T]. - Defaults are synthesized for a nullable field that has none (
null), because Avro schema evolution needs one.
How an Avro export is checked
Every schema is parsed with fastavro before the export is delivered, together with the schemas it
references, in whatever order they are written. A schema that does not parse fails the export.
Where to find the Avro card
In the Export dialog, the Apache Avro card is under Data schema & graph on the Target
step, marked multi-file, so you download every schema in one .zip. Its badge is types-only.
Pick the card to set output_syntax, namespace, subject_naming, topic and
subject_role.
From the CLI, apiome export avro --project <project> --version <version> --output <file>.avsc
writes the first schema only, with the fidelity report. To get every schema, export Avro as one
of several formats, which runs a job and unpacks a folder per format:
apiome export openapi-3.1 <item> --targets avro --out exports/. See
Export from the CLI.
Protobuf and Thrift from an OpenAPI source
An OpenAPI schema's type and format become the target's own scalar types:
| OpenAPI | Protobuf | Thrift |
|---|---|---|
integer | int32 | i32 |
integer, format: int64 | int64 | i64 |
number | double | double |
number, format: float | float | double |
boolean | bool | bool |
string | string | string |
OpenAPI has no field numbers, so the first export numbers each field in the order the schema lists
it: 1, 2, 3 and so on. Apiome remembers those numbers for the item, so every later export to
the same format gives each field the same number, even after fields are added, removed or
reordered. A field added since gets the next number not used yet. The fidelity report lists every
number Apiome assigned as synthesized. A source that has its own numbers, such as a Protobuf or
Thrift import, keeps them.
HTTP routes in a Protobuf or Connect RPC export
Protobuf has no place for an operation's HTTP method and route, so by default a REST source exported
to Protocol Buffers (proto3) or Connect RPC loses them. The fidelity report lists each one as
dropped. Turn on the HTTP annotations option (http_annotations) to keep them as google.api.http annotations
instead. gRPC-Gateway, Connect, Envoy and Google Cloud Endpoints all read that annotation to serve
an rpc over HTTP and JSON.
- Pick Protocol Buffers (proto3) or Connect RPC in the Export studio.
- On 3. Options, tick “HTTP annotations”. From the CLI, pass
--option http_annotations=true. - On 5. Verify, each operation's HTTP route now reads retained, or approximated when the annotation cannot bind every input (see the second table below). Click “Continue to review”, then “Generate”.
With the option on, every rpc whose operation has an HTTP method and route gets the rule, and the
file imports google/api/annotations.proto:
import "google/api/annotations.proto";
service PetService {
rpc GetPet (.acme.pets.GetPetRequest) returns (.acme.pets.Pet) {
option (google.api.http) = {
get: "/pets/{pet_id}"
};
}
rpc CreatePet (.acme.pets.Pet) returns (.acme.pets.Pet) {
option (google.api.http) = {
post: "/pets"
body: "*"
};
}
}
| Source operation | Annotation written |
|---|---|
GET, PUT, POST, DELETE or PATCH | That verb with the route, e.g. get: "/pets/{pet_id}" |
Any other method (HEAD, OPTIONS, …) | custom: { kind: "HEAD" path: "…" } |
POST, PUT or PATCH with a request body | Adds body: "*": the whole request message is the HTTP body |
A route variable that is not a valid field name ({pet-id}) | Renamed to one ({pet_id}) |
| A Protobuf or Smithy source whose methods already carry an HTTP binding | That binding, with its own body |
gRPC-Gateway binds a route variable or query parameter to the request-message field with the same name, and cannot bind headers or cookies. The fidelity report says how each route survived:
| Fidelity | When |
|---|---|
| Dropped | HTTP annotations is off (the default) |
| Retained | Every route variable and query parameter is a field of the request message |
| Approximated | The request message has no field for a route variable or query parameter, or the operation reads a header or cookie. The report names each one, e.g. header X-Trace, path owner, query limit |
The bundle's buf lint and buf build checks (on the protobuf and Connect RPC targets) supply
the google/api files the import needs, so an annotated export compiles without network access.
buf lint reports on your exported files only, not on those google/api files.
Validation rules in a Protobuf or Connect RPC export
Protobuf has no validation keywords of its own, so an export to Protocol Buffers (proto3) or
Connect RPC writes constraints as Protovalidate rules, and the file
imports buf/validate/validate.proto:
import "buf/validate/validate.proto";
message CreateAccountRequest {
string handle = 1 [
(buf.validate.field).string.min_len = 3,
(buf.validate.field).string.max_len = 32
];
int32 seats = 2 [
(buf.validate.field).int32.lte = 500,
(buf.validate.field).int32.gte = 1
];
repeated string labels = 3 [(buf.validate.field).repeated.unique = true];
}
| Source constraint | Rule written |
|---|---|
minLength, maxLength (equal values become len) | string.min_len, string.max_len, string.len |
pattern | string.pattern |
format of email, hostname, ipv4, ipv6, uri, uri-reference or uuid | string.email, string.hostname, … |
minimum, exclusiveMinimum, maximum, exclusiveMaximum | gte, gt, lte, lt under the field's numeric type |
enum on a string, number or boolean field | const for one value, in for several |
minItems, maxItems, uniqueItems | repeated.min_items, repeated.max_items, repeated.unique |
A rule imported from a .proto, CEL included | The same rule, unchanged |
multipleOf, any other format, a fractional bound on an integer field | Nothing: the fidelity report lists it as dropped, by name |
A field that is required in an OpenAPI source is not written as (buf.validate.field).required.
That rule also refuses the zero value (0, ""), which an OpenAPI required allows. Only a field
that was required in the Protobuf it was imported from gets the rule back.
The option is Protovalidate rules (protovalidate), on by default. To export a .proto with no
Protovalidate dependency:
- Pick Protocol Buffers (proto3) or Connect RPC in the Export studio.
- On 3. Options, untick “Protovalidate rules”. From the CLI, pass
--option protovalidate=false. - On 5. Verify, each constrained field now reads approximated: its constraints are dropped.
The bundle's buf lint and buf build checks supply buf/validate/validate.proto, so an export
with rules compiles without network access. Your own build needs the Protovalidate module: add
buf.build/bufbuild/protovalidate to the deps of your buf.yaml.
Federation subgraph from a GraphQL export
A plain GraphQL SDL export cannot join a federated supergraph on its own: Apollo Federation needs a
@link header and an @key on every entity. Turn on the Federation subgraph option
(federation) and the GraphQL SDL export is Federation v2 subgraph SDL, ready for an Apollo
subgraph library, rover or GraphOS.
- Pick GraphQL SDL in the Export studio.
- On 3. Options, tick “Federation subgraph”. From the CLI, pass
--federationtoapiome export graphql, or--option federation=truetoapiome export graphql <item>. - On 5. Verify, each entity whose key Apiome chose reads synthesized. Click “Continue to review”, then “Generate”.
The file starts with a @link that imports exactly the Federation directives it uses, and each
entity carries its @key:
extend schema @link(url: "https://specs.apollo.dev/federation/v2.9", import: ["@key"])
type Query {
getProduct(id: String!): Product!
}
type Product @key(fields: "id") {
id: String!
name: String!
warehouse: Warehouse
}
type Warehouse {
city: String
dock: String
}
An object type becomes an entity when it has an identity. Apiome looks for one in this order:
| The type has | Its @key | Fidelity |
|---|---|---|
Its own @key, from a GraphQL subgraph import | Kept as written | Retained |
| A declared primary key, from a SQL or dbt import | @key(fields: "order_id line_no"), every key column | Synthesized |
A field named id | @key(fields: "id") | Synthesized |
Exactly one field of the ID scalar | @key(fields: "<that field>") | Synthesized |
| None of these | No @key: it stays a value type, like Warehouse above | — |
A key field must hold one scalar or enum value, so a list or object field is never used. Input
types, interfaces and the Query / Mutation / Subscription roots never get a key. Every
synthesized key is listed in the fidelity report and on the export, so you can check each choice
before a router depends on it. When no type has an identity, the file still links Federation and the
export says the subgraph declares no entities.
Directives from a subgraph import, such as @shareable or @inaccessible, are kept and imported in
the header. A supergraph import loses its join__ routing machinery, which has no place in a
subgraph.
To check that the file composes, open Test drive and run rover supergraph compose under
Toolchain checks. It composes the export as a one-subgraph
supergraph with Federation 2.9 and shows rover's output. The check needs rover and its
composition plugin on the server; without them it reads unavailable.
Thrift from any source
When to export to Thrift
- Move an API to Thrift. An OpenAPI, gRPC, GraphQL, WSDL or Avro item becomes one
.thriftfile of structs, enums, unions, exceptions and services that the Thrift compiler accepts, for services and stacks that still speak Thrift. What Thrift cannot carry is listed in the fidelity report before you download. - Keep clients compatible across exports. Apiome stores each field id it assigns, so every later export of the item gives a field the same id and never reuses a removed one.
- Round-trip a Thrift item. An item imported from Thrift exports lossless, with its field ids,
namespaces and
typedefs.
Thrift export at a glance
| Step | Where | Details |
|---|---|---|
| Pick the Apache Thrift card and its options (comments, namespaces) | Export dialog → Apache Thrift (under RPC) | Where to find the Apache Thrift card |
| See how types, errors, services, field ids and names are written | The fidelity report on the card | How the item is written · scalar types from OpenAPI |
| See what Thrift cannot carry | The fidelity report on the card | What the fidelity report lists |
| Trust the file: the Thrift compiler, thriftpy2, then re-import | Automatic before every download | How a Thrift export is checked |
| Export from the CLI | apiome export thrift <item> --out <file>.thrift | Where to find the Apache Thrift card |
Exporting to Apache Thrift writes one <Name>.thrift file that the Thrift compiler accepts.
How a Thrift export is checked
Each export is checked before you download it:
- The Thrift compiler (
thrift) compiles it when the server has the compiler. A compile error fails the export and quotes the compiler's message and line. An export thatincludes another file is not compiled, because the compiler is given one file at a time. - thriftpy2, a second Thrift parser, reads it too, and must agree with Apiome's Thrift importer on every enum, struct, union, exception, field id and service method. This check runs with or without the compiler.
- The export imports again as Thrift.
A failed check names the file and the rule (thrift.compile, thrift.thriftpy2-parse,
thrift.parser-disagreement, thrift.reimport). An item imported from Thrift exports and re-imports
unchanged.
How the item is written
- Types. Objects become
structs, enumsenums, and unionsunions. A union that only lists its member types gets one optional field per member. Aliases and named scalars becometypedefs, listslist<…>, setsset<…>, and mapsmap<…, …>. A required field isrequired; every other field isoptional. - Errors. A type returned only as an error response becomes an
exceptionand is listed in the method'sthrows. An error type also used elsewhere stays astruct, and the report says itsthrowsentry is not written, because Thrift throws only exceptions. - Services. Each service becomes a
serviceand each operation a method. A method returns its success response's type. An operation with parameters (an OpenAPI path or query parameter, say) takes one<Method>Requeststruct that holds them and the body; otherwise it takes its request type as1: T arg. - Field ids. A Thrift item keeps its own field ids. A field without one (from OpenAPI, say) gets the next free id, and Apiome stores it, so the next export of the item gives that field the same id. A field you add later gets a new id, and the id of a field you removed is never reused, so clients built from an earlier export keep reading the wire correctly.
- Names. Thrift names are plain identifiers that are not reserved words.
com.acme.Orderis writtencom_acme_Order,order-idisorder_id, anddefaultisdefault_. Each rename is in the fidelity report, and a clash gets a number (addPet2). - Namespaces. Set the namespaces option to write one
namespaceline per language, for example{"java": "com.acme.shop", "py": "acme_shop"}, or*for every language. A Thrift item keeps its own namespaces andtypedefs. - uuid. A UUID is written as
string, because only Thrift 0.21 and later compilers know theuuidtype. An item imported from Thrift keepsuuid. - Constraints. Thrift has no validation, so a field's, parameter's or type's constraints are
written as a comment above it —
// constraints: >= 1; max length 40; pattern ^[A-Z]+$— for the people reading the file. Nothing enforces them.
What the fidelity report lists
The fidelity report lists what Thrift cannot carry, each on the construct it affects:
| What the source has | What the report says | Kind |
|---|---|---|
| Constraints (pattern, bounds, lengths, format) | Written as a comment, not enforced | approximated |
| A nullable field | Written optional: Thrift has no null, so it is absent instead | approximated |
| An HTTP operation | Written as an RPC method | approximated |
| Its HTTP method, path, status codes and parameter locations | Not written | dropped |
| Event operations and channels (AsyncAPI) | Not written: Thrift has no events | dropped |
A type that extends another (TypeScript, Pydantic, SQL INHERITS) | One struct holding the inherited fields | approximated |
| A field with no field id | A field id is assigned | synthesized |
| A streaming call | Written as one call | dropped |
| A map type | Written inline as map<K, V>; its declaration is not kept | dropped |
| The title, version, description and servers | Not written: an IDL file has no place for them | dropped |
A renamed type, service or method, or a <Method>Request struct | Dropped under its old key and added under the new name, which is how it reads back | dropped / synthesized |
Exporting an OpenAPI, gRPC, GraphQL, WSDL or Avro source to Thrift and reading it back shows no change the report did not name.
Where to find the Apache Thrift card
In the Export dialog, the Apache Thrift card is under RPC on the
Target step, as one file. Its badge is lossless for an item imported from Thrift and lossy
for any other source. Pick the card to see Include Comments (on by default), which writes the
header comment. The namespaces option (namespace lines per language) is set from the CLI or the
REST API: run apiome export thrift <item> --out <file>.thrift, and add
--option 'namespaces={"java": "com.acme"}' or --option include_comments=false. A lossy export exits
non-zero unless you add --force, and --json prints the tier. A public item's Export dialog on
Browse offers Thrift too, as the .thrift file.
OMG IDL (CORBA or DDS) from any source
When to export to OMG IDL
- Serve a CORBA estate. With the
corbaprofile, an API's services become IDLinterfaces with their operations and exceptions, for CORBA middleware (defense, telecom, finance) that omniidl compiles. - Define DDS topic types. With the
ddsprofile, the item's data types — with@keyfields and one topic per event channel — are written for a DDS application that Cyclone DDSidlccompiles. - Round-trip a CORBA IDL item. An item imported from CORBA IDL exports lossless, with its
modules,
typedefs and parameter directions.
What IDL cannot carry is listed in the fidelity report, for the profile you pick, before you download.
OMG IDL export at a glance
| Step | Where | Details |
|---|---|---|
| Pick the CORBA IDL card and its options (profile, module, comments) | Export dialog → CORBA IDL (under RPC) | Where to find the CORBA IDL card |
| See how types, modules, interfaces, keys and names are written | The fidelity report on the card | How the item is written |
| See what the profile you picked cannot carry | The fidelity report on the card | What the fidelity report lists |
Trust the file: omniidl or idlc, then re-import | Automatic before every download | How an IDL export is checked |
| Export from the CLI | apiome export idl <item> --out <file>.idl | Where to find the CORBA IDL card |
Exporting to CORBA IDL writes one <Name>.idl file in OMG IDL 4.2 that reference IDL compilers
accept: omniidl for the CORBA parts and Cyclone DDS idlc for the annotated data types.
How an IDL export is checked
Each export is checked before you download it:
- The profile's IDL compiler checks it when the server has that compiler:
omniidlfor acorbaexport,idlcfor addsexport. A compile error fails the export and quotes the compiler's message and line (idl.compile). - Apiome's CORBA IDL importer reads it back (
idl.reimport). Without the compiler, this is the check.
How the item is written
- Profile. The profile option picks what is written.
corba(the default) writes interfaces and exceptions.ddswrites only the data types a DDS topic can use: no interfaces, no exceptions and no member that refers back to its own type. It also marks identifier fields@key. A source with no data types cannot be exported withdds, and the dialog says why. - Types. Objects become
structs, enumsenums, and aliases and named scalarstypedefs. Lists becomesequence<…>. A map becomes a sequence of<Map>Entrykey/value structs. A union becomes a discriminatedunionthat switches on a generated<Union>Kindenum, with one case per member. A nullable field is marked@optional. - Modules. The item's namespace becomes nested modules:
com.acme.ordersis writtenmodule com { module acme { module orders { … }; }; };. Set the module option (acme::orders) to choose another path. Every type reference is written in full (::com::acme::orders::Order). - Interfaces. Each service becomes an
interfaceand each operation an IDL operation. Its parameters and request body areinarguments, and it returns its success response's type. A list in a signature is given atypedef(PetSeq). A type returned only as an error response becomes anexceptionand is listed in the operation'sraises. Any other error response is left out, and the report says so. - Keys (DDS). A field named
id,<type>Idor<type>_idgets@key. Set the key_fields option to choose the keys yourself, for example{"Order": ["region", "number"]}. - Names. IDL names are identifiers, compared without regard to case.
order-idis writtenorder_id,moduleismodule_, and of two membersidandIDthe second becomesID2. A member cannot share its type's name, and an enum value must be unique in its module, so it may be prefixed with its enum's name (Status_ACTIVE). Each rename is in the fidelity report. - Recursion. A type may contain itself only through a
sequence. A direct reference to itself is written as a sequence of at most one element. A member that refers back through another type is left out, and so is any recursive member under theddsprofile. - From a CORBA item. An item imported from CORBA IDL keeps its module,
typedefs, interfaces and parameter directions (in,out,inout). - Constraints. A string's maximum length is written as a bounded string (
string<40>) and a list's maximum size as a bounded sequence (sequence<Tag, 5>), so they are kept. IDL has no other validation, so every other constraint is written as a comment above the member, typedef or operation —// constraints: >= 1; pattern ^[A-Z]+$— and nothing enforces it. - Channels (DDS). Under the
ddsprofile each event channel is a DDS topic: its message type is declared, and a comment names the topic (// DDS topic "orders.placed": ::shop::Order). A DDS application creates the topic from that name and type.
What the fidelity report lists
The fidelity report depends on the profile:
| What the source has | corba | dds |
|---|---|---|
| A maximum string length or list size | Kept as a bound — not reported | Kept as a bound — not reported |
| Any other constraint | Written as a comment, not enforced (approximated) | Same |
| An HTTP operation | An IDL operation (approximated); its method, path, status codes and parameter locations are dropped | Dropped: the profile writes data types only |
| Any other operation | An IDL operation | Dropped |
| An event channel | Dropped | A DDS topic named in a comment (approximated) |
| Publish / subscribe operations | Dropped | Dropped (the channel is the topic) |
| A map | A sequence of key/value entry structs (approximated) | Same |
| A union | Its discriminator enum is generated (synthesized) | Same |
| A source's field numbers (Protobuf, Thrift) | Dropped: IDL has none | Same |
An item imported from CORBA IDL exports back lossless: its members keep their order, which is all IDL records about them.
Where to find the CORBA IDL card
In the Export dialog, the CORBA IDL card is under RPC on the
Target step, as one .idl file. Its badge is lossless for an item imported from CORBA IDL and
lossy for any other source. Pick the card to see Profile (corba by default, or dds),
Module (empty: the item's own module or name) and Include Comments (on by default). The DDS
@key fields are set from the CLI or the REST API with key_fields. From the CLI, run
apiome export idl <item> --out <file>.idl (omg-idl and corba-idl work too), and add
--option profile=dds or --option 'key_fields={"Order": ["orderId"]}'. A CORBA export written
without comments is still checked by omniidl. A lossy export exits non-zero unless you add --force,
and --json prints the tier. A public item's Export dialog on Browse offers IDL too, as the
.idl file.
Smithy from any source
When to export to Smithy
- Move an API to Smithy. Any REST, RPC, GraphQL, JSON Schema or WSDL item becomes a Smithy 2.0
model that
smithy validateaccepts: shapes with traits, services and operations, with each HTTP binding kept. What Smithy cannot carry is listed in the fidelity report before you download. - Round-trip a Smithy item. An item imported from Smithy exports back lossless, with its
namespace,
$versionand operation order.
Smithy export at a glance
| Step | Where | Details |
|---|---|---|
| Pick the Smithy card and its options (IDL, JSON AST or both; protocol) | Export dialog → Smithy (under RPC in Export studio) | Where to find the Smithy card |
| See how shapes, traits, services, errors and names are written | The fidelity report on the card | How the item is written |
| See what Smithy cannot carry | The fidelity report on the card | What the fidelity report lists |
Trust the model: smithy validate, then re-import | Automatic before every download | How a Smithy export is checked |
| Export from the CLI | apiome export smithy <item> --out <file>.smithy | Where to find the Smithy card |
Exporting to Smithy writes a Smithy 2.0 model that smithy validate accepts. Set the output
option to choose the form: idl (the default) writes <Name>.smithy, json-ast writes the Smithy
JSON AST as <Name>.json, and both writes the two. They describe the same model, so load one of
them, not both together.
How a Smithy export is checked
Each export is checked before you download it:
- The Smithy CLI validates each file when the server has it, with the same validators a
smithy buildruns. AnERRORorDANGERevent fails the export and names the validator, shape, line and column (Target.UnresolvedShape).WARNINGandNOTEevents do not. Without the CLI, Apiome's Smithy reader reads the model instead, and a parse error fails the export. - The built model is then imported again. If it does not import, the export fails
(
smithy.reimport).
How the item is written
- Shapes. Objects become
structures, unionsunions, enumsenums, mapsmaps, and named listslists. A list with no name of its own gets a<Element>Listshape. A named scalar or an alias of a scalar becomes a simple shape (string AccountId). An enum value that differs from its member name is writtenin_progress = "in-progress". - Traits. A field that may not be null is
@required, and a field default becomes@default. Length limits become@length, numeric bounds@range, and regular expressions@pattern. A list that must hold unique items targets a<Element>Setshape marked@uniqueItems. Descriptions become doc comments, and deprecated items get@deprecated. A constraint Smithy cannot express, such asmultipleOf, is in the fidelity report. - Services. Each service becomes a
serviceand each operation anoperation. An HTTP operation keeps its binding:@http(method, uri, code), with path, query and header parameters bound by@httpLabel,@httpQueryand@httpHeader, and the body by@httpPayload. When an operation needs one, its input and output are generated structures (<Operation>Input,<Operation>Output). GET operations are@readonly, PUT and DELETE operations@idempotent. A GET, HEAD or DELETE request has no body in Smithy, and transport headers such asAuthorizationare not bound. The report lists both. - Errors. A type returned only as an error response becomes an
@errorstructure, with@httpErrorfor its status, and is listed in the operation'serrors. - Protocol. Set the protocol option to
restJson1orrpcv2Cborto mark each service with that protocol trait. These traits come from separate Smithy packages, so a build needs them as dependencies. - Names. Smithy names are identifiers that must stay unique when case is ignored.
order-idis writtenorder_idand keeps its wire name with@jsonName("order-id"). A shape cannot reuse a prelude name such asString, and a clash gets a number (String2). Each rename is in the fidelity report. - From a Smithy item. An item imported from Smithy keeps its namespace,
$version, service version and operation order. Traits that were imported by name only, such as a@lengthwhose limits were not kept, cannot be written back, and the report says so. Aresourceis not written back either; its operations stay on the service.
What the fidelity report lists
The fidelity report lists what Smithy cannot carry, on the type, field or operation it concerns. The report predicts exactly what the export writes:
- Dropped: constraints with no Smithy trait (
multipleOf, a list of allowed values, a length on a number), and a default that does not fit its type. Also dropped: parameters Smithy cannot bind (cookies, and transport headers such asAuthorization), the body of a GET, HEAD or DELETE request, error responses that are not objects, and event operations and channels. A route that is not a valid Smithy URI, or that repeats another, loses its@httpbinding. - Approximated: renamed shapes and members, aliases written as the type they alias, bodies
wrapped in a
bodymember, scalars written asString, and a required member made optional to break a cycle. - The document. Smithy has no title, description or servers, so for an item not imported from Smithy the report lists each one. The version moves to each service, or is dropped when there is no service.
- Carried. For each operation and type that is carried, the report names the Smithy shape it
became, such as
operation getPet @http(GET /pets/{id})orstructure Pet.
Where to find the Smithy card
In the Export dialog, the Smithy card is on the Target step (under
RPC in Export studio), as one file. Its badge is lossless for an item imported from Smithy
and lossy for any other source. Pick the card to see its four options: Output (idl by
default; json-ast or both), Protocol (none by default; restJson1 or rpcv2Cbor),
Include Comments (on by default), which writes the IDL header comment, and Smithy Version
(2.0). From the CLI, run apiome export smithy <item> --out <file>.smithy, and add
--option output=json-ast or --option protocol=restJson1. A lossy export exits non-zero unless you
add --force, and --json prints the tier. A public item's Export dialog on Browse offers Smithy
too: the .smithy file, or with both a zip of the two views.
TypeSpec from any source
When to export to TypeSpec
- Move an API to TypeSpec. Any REST, RPC, GraphQL, JSON Schema or WSDL item becomes one
.tspfile that compiles, ready to edit as the source of truth. What TypeSpec HTTP cannot carry, and what is reframed as HTTP, is listed in the fidelity report before you download. - Round-trip a TypeSpec item. An item imported from a
.tspfile exports back lossless, with its imports, namespace, routes and decorators.
TypeSpec export at a glance
| Step | Where | Details |
|---|---|---|
| Pick the TypeSpec card and its options | Export dialog → REST & HTTP → TypeSpec | Where to find the TypeSpec card |
| See how the document, types, members and operations are written | The fidelity report on the card | How the item is written |
| See what is dropped, approximated or reframed | The fidelity report on the card | What the fidelity report lists |
| Trust the file: it compiles and its OpenAPI imports | Automatic before every download | How a TypeSpec export is checked |
| Export from the CLI | apiome export typespec <item> --out <file>.tsp | Where to find the TypeSpec card |
Exporting to TypeSpec writes one .tsp file that compiles with the TypeSpec compiler Apiome
ships (tsp 0.65 with @typespec/http), whatever the item was imported from.
How a TypeSpec export is checked
Each export is checked before it is offered:
- It is compiled to OpenAPI with
@typespec/openapi3. A compile error fails the export and names the file, line, column and error code (unknown-identifier). - The OpenAPI the compile writes is imported the way an uploaded OpenAPI would be. If it does not
import, the export fails (
typespec.openapi-import).
Without the compiler on the server, the .tsp is read back by the TypeSpec importer instead.
Compiling to OpenAPI also shows what choosing TypeSpec costs compared with exporting straight to
OpenAPI: @typespec/openapi3 names each operation <Interface>_<operation>
(PetService_listPets), writes a plain integer as int32, and makes a request body required.
How the item is written
- Document. The title becomes
@service({ title: "…" })on the namespace, and the description becomes its doc comment. The version becomes@info({ version: "…" })(from@typespec/openapi), and each server becomes@server(url, description)with its variables. - Types. Objects become
models, enumsenums, and unionsunions, with named variants or their member types. Maps becomemodel X is Record<V>, and named listsmodel X is T[]. A named scalar becomesscalar X extends string(orint64,utcDateTime…), and an alias of another type becomesalias X = T. An enum value that differs from its member name is writteninProgress: "in-progress", and a numeric enum keeps its numbers. - Members. A field that may be null is optional (
tag?: string). Length limits become@minLengthand@maxLength, numeric bounds@minValueand@maxValue(or theirExclusiveforms), list sizes@minItemsand@maxItems, and patterns@pattern. A string format with a TypeSpec type of its own becomes that type (date-timeisutcDateTime); any other format is kept with@format. A default becomes= value. Descriptions become/** … */doc comments, and deprecated items get#deprecated. - Operations. Each service becomes an
interface. An HTTP operation keeps its verb and@route, with parameters marked@path,@query,@header("Name")or@cookie("name"), and the body@body. A body that is not JSON names its media types in aContent-Typeheader. A plain 200 response is the return type. Other responses are variants such as{ @statusCode statusCode: 201; @body body: Pet; }, a4XXrange is a status between 400 and 499, and adefaulterror is an@errormodel. An operation with no HTTP binding is written@post @route("/<Service>/<operation>"). - Decorators. Tags become
@tag("…"). A parameter's or header's description becomes@doc("…"), and a deprecated parameter or header gets#deprecated. A list of allowed values becomes a union of literals (sort?: "name" | "age"). A server variable with allowed values gets them as its type, and its description as@doc. - Names. Every name is kept: a name that is not a TypeSpec identifier, or is a keyword, is written
in backticks (
`order-id`). A type cannot reuse a built-in name such asstring, and a clash gets a number (string2). Each rename is in the fidelity report. - From a TypeSpec item. An item imported from a
.tspfile keeps its imports, namespace, interface routes, field types and decorators, so it exports and re-imports unchanged.
What the fidelity report lists
The fidelity report lists what TypeSpec cannot carry, on the type, field or operation it concerns:
- Dropped: constraints with no decorator (
multipleOf,uniqueItems), a default that does not fit its type, and numeric enum values beside string ones. Also dropped: operations on a method TypeSpec has no verb for (such asOPTIONS), a second operation on the same route, a path parameter missing from its route, multipart media types on a body that is not an object, and event operations and channels. A response's own description is dropped too, since an inline response gets its status's standard text, and so is the document's id. - Approximated: renames, RPC operations given an HTTP route, aliases (they compile to the type
they alias), scalars written as
string, inline schemas written asunknown, synthesized path parameters anddefaultresponse models. Types from another namespace are declared in the document's one namespace. - Other API styles. TypeSpec HTTP describes REST APIs. For a GraphQL, gRPC, event or data-schema
item the report says the API is reframed as HTTP. Each operation without an HTTP binding is
listed as a GraphQL query, mutation or subscription, a one-way call or an RPC call, with the
POSTroute it became. A GraphQL subscription or a streaming call is listed as one request and response, and event messages and a second request body are listed as dropped. - Carried. For each operation and type that is carried, the report names what it became, such as
op getPet @get /pets/{id}ormodel Pet.
Where to find the TypeSpec card
In the Export dialog, the TypeSpec card is under REST & HTTP on the
Target step, as one file. Its badge is lossy for a REST, RPC, GraphQL, JSON Schema or WSDL
source and lossless for an item imported from TypeSpec. Pick the card to see its two options, both
on by default: Include Http Imports writes the @typespec/http import and using the document
needs to compile (turn it off only if you add them yourself), and Include Comments writes the
header comment. From the CLI, run apiome export typespec <item> --out <file>.tsp, and add
--option include_http_imports=false or --option include_comments=false. A lossy export exits
non-zero unless you add --force, and --json prints the tier. A public item's Export dialog on
Browse offers TypeSpec too, as the .tsp file.
Healthcare exports
Healthcare interfaces describe their data in two generations of HL7 standards: FHIR for modern REST APIs, and HL7 v2 for the pipe-and-hat messages most hospital integration engines still run on. Apiome writes both from an item's types, plus the original message for an item imported from HL7 v2. In Export studio, the three cards sit together under Healthcare on the Target step.
When to use which
- A FHIR server or profile author: FHIR. Export FHIR for a StructureDefinition logical model per type (R4 or R5), a CodeSystem and ValueSet per enum, and the source's operations summarized in a CapabilityStatement. It is checked by the official HL7 FHIR validator when the server has it.
- An interface partner on HL7 v2: HL7 v2 segment guide. Export an HL7 v2 segment guide for the message and segment definitions an integration engine (Mirth Connect, Rhapsody, Cloverleaf) is configured from: Z-segments, typed fields and a user-defined table per enum. It is laid out by the same plan as the X12 and UN/EDIFACT guides.
- An HL7 v2 message back out: HL7 v2. An item imported from an HL7 v2 message exports back to HL7 v2, its segments and envelope as they were imported. It is not offered for any other source.
Moving from HL7 v2 to FHIR? An HL7 v2 item names the FHIR resource each segment maps to; see Migrate to FHIR.
Healthcare exports at a glance
| FHIR | HL7 v2 segment guide | HL7 v2 | |
|---|---|---|---|
| From | Any source | Any source with a record type | An item imported from HL7 v2 |
| You get | A collection Bundle, or one JSON file per resource | JSON guide, segment CSV, Markdown guide | The HL7 v2 message |
| Options | fhir_version (R4, R5), packaging, capability_statement | message_type, version, first_table_number … | — |
| Enums become | A CodeSystem and a ValueSet, with a required binding | A user-defined table (9001 …) | — |
| Operations | Summarized in a CapabilityStatement | Left out (types-only) | Left out (types-only) |
| Checked by | The HL7 FHIR validator, else Apiome's structural FHIR rules | Apiome's guide rules | Apiome's HL7 v2 parser |
| CLI | apiome export fhir | apiome export hl7guide | apiome export hl7v2 |
Every length, code, name and identifier an export invents is listed in its fidelity report before you download.
FHIR (StructureDefinition) from any source
Exporting to FHIR writes each cataloged type as a FHIR StructureDefinition logical model
(kind: logical), with a CodeSystem and ValueSet for each enum, in one collection Bundle.
Set fhir_version to R4 (4.0.1, the default) or R5 (5.0.0). Set packaging to per-type for
one JSON file per resource.
Each export is checked before you download it:
- With the official HL7 FHIR validator, when the server has it. Every file is validated against the
version the export declares (R4
4.0.1or R55.0.0), offline (no terminology server). Eacherrororfatalissue fails the export and is listed with the validator's own message, the resource path and its code (invariant,structure,code-invalid). Warnings do not fail it. - Without it, Apiome's structural FHIR rules check each file and list each broken rule on its own
with its resource path (
fhir.structure), then the FHIR reader reads it back (fhir.reimport).
Where to find it. In Export studio, the FHIR and HL7 v2 cards are under
Healthcare on the Target step. From the CLI, run
apiome export fhir <item> --option fhir_version=R5 --option packaging=per-type or
apiome export hl7v2 <item>; apiome export targets --project <item> lists both. A public item's
Export dialog on Browse offers the same two targets.
- Elements. Each field is an element. An object used by only one field is nested in its
parent as a
BackboneElement(Pet.owner.name), and theexplicit-type-nameextension keeps its type name. Any other object is a logical model of its own, referenced by its canonical URL (http://example.org/fhir/StructureDefinition/Owner; set canonical_base to use your own). - Cardinality. A field that may not be null has
min1, and a list hasmax*.minItemsandmaxItemsset the bounds. - Types. FHIR primitives:
string,boolean,integer,decimal,date,dateTime,time,uri,uuidandbase64Binary. A 64-bit integer isinteger64in R5. R4 has nointeger64, so it is written asinteger, and the report says so. - Enums. Each enum becomes a CodeSystem with one concept per value, plus a ValueSet that
includes it. The field is a
codewith arequiredbinding to that ValueSet. - Constraints.
maxLength,minValue[x]andmaxValue[x], anddefaultValue[x]are written as element properties. Patterns, minimum lengths, exclusive bounds,multipleOfand allowed values become FHIRPathconstraints, such asmatches('^[A-Z]+$'). - Unions. A union whose alternatives are distinct single types (primitives, other models, at
most one enum) becomes a FHIR choice element: a field
valueof that union is writtenvalue[x], with one type per alternative. Any other union, such as one with two alternatives of the same type or a list of the union, becomes a model with one optional element per alternative, plus an invariant that exactly one is present. - Operations. FHIR cannot declare operations on logical models. The capability_statement option (on by default) lists the source's operations in a CapabilityStatement's REST documentation, which also carries the title, description and version.
- From a FHIR item. An item imported from a FHIR profile or resource is written back in that form. An exported logical-model Bundle imports back unchanged.
The fidelity report lists what FHIR logical models cannot express, construct by construct:
| Source construct | In the report |
|---|---|
| Operations | Approximated: they are summarized in the CapabilityStatement, and the report warns that the source has operations. Without the CapabilityStatement they are dropped |
| A union of distinct single alternatives | Approximated: a choice element ([x]); the alternatives' names are not kept |
| Any other union | Dropped as a type: a model of optional elements with an exactly-one invariant |
| A map, and every field typed by one | Dropped |
A regular expression, or an email, hostname, ipv4 or ipv6 format | Approximated: a FHIRPath matches() constraint, whose regex dialect may differ |
Another format, uniqueItems, a default that does not fit | Dropped |
| A type that contains itself | Approximated: it is modelled by reference, and FHIR tools expand it only to a limited depth |
A name that is not a FHIR name (order-line, unit-price) | Synthesized: OrderLine, unitPrice |
| Event operations, channels, servers | Dropped |
| Aliases, named scalars, coerced primitives | Approximated |
OData (CSDL) from any source
When to export to OData
- Describe an API as an OData service. Any REST, RPC, GraphQL, JSON Schema or WSDL item becomes CSDL metadata: its resources become entity types with keys and entity sets, and every other operation a Function or Action. Keys Apiome had to infer or add, and what CSDL's type system cannot hold, are listed in the fidelity report before you download.
- Round-trip an OData item. An item imported from OData exports back lossless; an OData 2 or 3 item is written as CSDL 4.01.
OData export at a glance
| Step | Where | Details |
|---|---|---|
| Pick the OData card and its output (CSDL JSON, XML or both) | Export dialog → REST & HTTP → OData | Where to find the OData card |
| See how types, keys, properties and operations are written | The fidelity report on the card | How the item is written |
| See what is approximated, synthesized or dropped | The fidelity report on the card | What the fidelity report lists |
| Trust the file: OASIS schema, references and keys, re-import | Automatic before every download | How an OData export is checked |
| Export from the CLI | apiome export odata <item> --out <file>.csdl.json | Where to find the OData card |
Exporting to OData writes the service's metadata as CSDL JSON 4.01 (<Namespace>.csdl.json),
the canonical form. Set the output option to xml for CSDL XML (<Namespace>.edmx), or both
for the two.
How an OData export is checked
Each export is checked before you download it, with the same checks an OData import runs:
- The OASIS CSDL JSON schema, or for CSDL XML the OASIS EDMX / EDM XML schemas. Each
violation is listed on its own, with the JSON pointer where it is (
/Demo/Product/ID/$Type). - References and keys. Every
$Type, base type, entity set and navigation target must name a declared element, and every$Keyproperty must exist. A schema accepts"$Type": "Demo.Missing"; this check does not. - The document imports again. With
both, the two documents must describe the same model.
A failed check names the file, the pointer and the rule (odata.csdl-schema,
odata.csdl-xml-schema, odata.unresolved-reference, odata.key, odata.outputs-disagree,
odata.reimport). An item imported from OData exports and re-imports as it was read; its types are
written in one namespace, and every reference is re-qualified to match.
How the item is written
- Entity and complex types. An object an HTTP operation sends or returns is a resource and
becomes an
EntityTypewith an entity set. Any other object becomes aComplexType. An item with no operations (a data schema) exposes each object that no other object contains. An item imported from OData keeps its own entity types, complex types and entity sets. - Keys. Every entity type has a
$Key. An OData item keeps its own key. Otherwise a property namedid,<Type>Idorkeybecomes the key, and the report says it was inferred. With no such property, a stringIdproperty is added as the key, and the report says it was synthesized. - Types. Primitives become their CSDL type:
int64isEdm.Int64,date-timeisEdm.DateTimeOffset, anduuidisEdm.Guid. An unsigned type is widened (uint32isEdm.Int64), and an unknown one isEdm.String; the report lists both. Enums becomeEnumTypes, and a named scalar becomes aTypeDefinition. Unions become complex types with one nullable property per variant, and maps become open complex types; the report lists both. - Properties. Lists become
$Collection, and a property whose type is an entity becomes aNavigationProperty.maxLengthbecomes$MaxLengthand a default$DefaultValue. Patterns, ranges, list sizes and allowed values becomeValidationannotations, descriptionsCore.Description, and deprecationsCore.Revisions. - Operations. An entity set serves the CRUD operations on its resource:
GET /pets,GET /pets/{id},POST /pets, andPUT,PATCHandDELETE /pets/{id}. Every other operation becomes an unbound Function (aGETor query that returns a result) or Action, imported into the entity container. Its path and query parameters and its body become the operation's parameters. - From an OData 2 or 3 item. It is written as CSDL 4.01.
MaxLength,PrecisionandScalestay facets, andEdm.DateTimebecomesEdm.DateTimeOffset. The report lists the version upgrade and thesap:andm:annotations, which are not written.
What the fidelity report lists
The fidelity report lists what OData cannot carry, in three groups:
| Group | Source construct | In the report |
|---|---|---|
| Keyless types | An entity with an id-like property but no declared key | Approximated: the property becomes the key, and is made non-nullable if it was nullable |
| Keyless types | An entity with no key and no id-like property | Synthesized: a string Id key is added |
| RPC and events | A unary RPC or a GraphQL query or mutation | Approximated: it becomes an Action, or a Function when it is a query that returns a result |
| RPC and events | A gRPC client or bidirectional stream, a GraphQL subscription | Dropped (critical): it is not written |
| RPC and events | A gRPC server stream | Approximated: it returns a collection of its messages |
| RPC and events | Publish and subscribe operations, channels | Dropped |
| Type coercion | An unsigned or unknown primitive | Approximated: it is widened, or written as Edm.String |
| Type coercion | A format with no CSDL type, such as email or uri | Dropped |
| Type coercion | minLength, multipleOf, uniqueItems | Dropped |
| Type coercion | Field numbers (Protobuf, Thrift) | Dropped (info). An OData item's properties keep their order, so they are not listed |
Also dropped: header and cookie parameters, declared error responses (OData uses its standard
error format), defaults that do not fit, servers, and the document's title, description and
version. Also approximated: CRUD operations served by an entity set (their query parameters become
OData query options such as $top and $filter), unions, maps, aliases and renamed elements.
Where to find the OData card
In the Export dialog, the OData card is under REST & HTTP on the
Target step, as one file. Its badge is lossy for a REST, RPC, GraphQL, JSON Schema or WSDL
source and lossless for an item imported from OData. Pick the card to see its two options:
Output (json by default; xml or both) and Include Comments (on by default), which writes
the comment header in the CSDL XML document. From the CLI, run
apiome export odata <item> --out <file>.csdl.json, and add --option output=xml or
--option include_comments=false. A lossy export exits non-zero unless you add --force, and --json
prints the tier. A public item's Export dialog on Browse offers OData too: the .csdl.json file,
or with both a zip of the two documents.
OpenRPC from any source
When to export to OpenRPC
- Describe an API as JSON-RPC 2.0. A gRPC, REST, GraphQL or event item becomes an OpenRPC
document of methods and notifications, the description format of the JSON-RPC ecosystem (Ethereum,
MetaMask, Filecoin, Starknet). REST operations are reframed as methods with by-name
params, and publish and subscribe operations as notifications. What JSON-RPC cannot carry is listed in the fidelity report before you download. - Round-trip an OpenRPC item. An item imported from OpenRPC exports lossless and re-imports unchanged.
OpenRPC export at a glance
| Step | Where | Details |
|---|---|---|
Pick the OpenRPC card (one option: indent, set from the CLI or the API) | Export dialog → OpenRPC (under RPC) | Where to find the OpenRPC card |
| See how the document, methods, notifications, REST operations, events and schemas are written | The fidelity report on the card | How the item is written |
| See what OpenRPC cannot carry | The fidelity report on the card | What the fidelity report lists |
Trust the document: the meta-schema, $ref resolution, then re-import | Automatic before every download | How an OpenRPC export is checked |
| Export from the CLI | apiome export openrpc <item> --out <file>.openrpc.json | Where to find the OpenRPC card |
Exporting to OpenRPC writes an openrpc.json document that is valid against the OpenRPC
meta-schema.
How an OpenRPC export is checked
Each export is checked before it is offered:
- It is validated against the OpenRPC meta-schema. Each violation is listed on its own, with the
JSON pointer where it is (
/methods/0/params). - Every
$refmust name something in the document: a reference to a missing#/components/schemas/…fails, though the meta-schema alone would accept it. - It is imported again by the OpenRPC importer.
A failed check names the rule (openrpc.meta-schema, openrpc.unresolved-ref, openrpc.reimport).
An item imported from OpenRPC exports and re-imports unchanged.
How the item is written
- Document.
infocarries the title, version and description. OpenRPC requires a version, so an item without one gets0.0.0, and the report says so. Servers keep their name, description and variables. An item imported from OpenRPC keeps its ownopenrpcversion. - Methods. Each operation becomes a method named after the operation. When two services have
an operation with the same name, the second is written
<Service>.<operation>. The request becomesparams: an OpenRPC item keeps its own parameter list, and another RPC item gets oneparamsparameter holding its request type. The response becomesresult, error responseserrors(code,messageanddata), tagstags, and a deprecated operation getsdeprecated: true. - Notifications. A one-way operation is written as a notification: a method with no
result. An item imported from OpenRPC reads its result-less methods back as notifications. - From a REST source. Each REST operation is reframed as a method, and the report lists each
one:
- its path, query, header and cookie parameters and its body become by-name
params(paramStructure: by-name), each labeled with where it came from; - the success response becomes
result, and a response with no body is{"type": "null"}; - numeric error statuses become
errorswith the status as thecode; - the HTTP method and path are kept in the extension
x-http.
- its path, query, header and cookie parameters and its body become by-name
- Events. A publish or subscribe operation (from AsyncAPI, for example) becomes a notification.
Its message and its channel's address parameters become by-name
params, and the channel address is kept in the extensionx-channel. - Schemas. Named types become
components/schemas, written with the same JSON Schema mapping as the OpenAPI export. Every$refnames a written component, and scalars such asint64ortimestampbecome their JSON Schema form ({"type": "integer", "format": "int64"}).
What the fidelity report lists
The fidelity report lists what OpenRPC cannot carry. JSON-RPC 2.0 has no HTTP semantics, no streams and no channels, so each loss of a REST, gRPC or event item is listed on its own:
| Source construct | In the report | Why |
|---|---|---|
| HTTP method and path | Dropped | A method has a name only. x-http keeps them, but JSON-RPC clients ignore it. |
| Path, query, header and cookie parameters | Approximated | They become by-name params, and each one's description names where it came from. |
A success status other than 200, such as 201 | Dropped | A result has no status. |
Error statuses such as 404 | Approximated | They become error codes with the same number. |
default and 4XX error responses | Dropped | An error needs an integer code. |
| Response headers | Dropped | A result has no headers. |
| gRPC streams, GraphQL subscriptions | Dropped | A JSON-RPC call is one request and one response. |
| Publish and subscribe operations | Approximated | They become notifications. |
| A channel used by an operation | Approximated | Its address is the notification's x-channel. |
| A channel no operation uses | Dropped | Nothing carries it. |
| Field numbers (Protobuf, Thrift) | Dropped (info) | JSON Schema properties have no numbers. |
Also dropped: a second success response (a method has one result), error payload types (an
OpenRPC error carries a data value, not a schema) and repeated field names. Also approximated: a
synthesized version, renamed methods and components, and types with no JSON Schema form (written as
any value).
- Carried. For each operation that is carried, the report names the method or notification it
became, such as
method getPet.
Where to find the OpenRPC card
In the Export dialog, the OpenRPC card is under RPC on the Target
step, as one <Name>.openrpc.json file. Its badge is lossless for an item imported from OpenRPC and
lossy, with the share it keeps, for an item of any other paradigm: REST (OpenAPI, WSDL, RAML), RPC
(Thrift, Smithy), GraphQL or a data schema. Its one option, indent (2 by default; 0 for compact
JSON), is a number, so the card has no options panel; set it from the CLI or the REST API. From the
CLI, run apiome export openrpc <item> --out <file>.openrpc.json, and add --option indent=0. The
CLI prints the fidelity report: the tier and preserved share, the counts, and the worst losses first.
A lossy export exits non-zero unless you add --force, and --json prints the tier. A public item's
Export dialog on Browse offers OpenRPC too, as the .openrpc.json file.
Cap'n Proto from any source
When to export to Cap'n Proto
- Move an API to Cap'n Proto. Any item becomes a
.capnpschema of structs, enums, unions and interfaces thatcapnp compileaccepts, for a Cap'n Proto RPC service and its messages. What Cap'n Proto cannot carry is listed in the fidelity report before you download. - Keep readers compatible across exports. Apiome stores each field number and the file's
@0x…id, so every later export writes the same ones, and a removed field keeps its slot asobsolete<Name>. - Round-trip a Cap'n Proto item. An item imported from Cap'n Proto exports lossless, with its own numbers and file id.
Cap'n Proto export at a glance
| Step | Where | Details |
|---|---|---|
| Pick the Cap'n Proto card and its option (comments) | Export dialog → Cap'n Proto (under RPC) | Where to find the Cap'n Proto card |
| See how types, services, names, numbers and constraints are written | The fidelity report on the card | How the item is written |
| See what Cap'n Proto cannot carry | The fidelity report on the card | What the fidelity report lists |
Trust the schema: capnp compile | Automatic before every download, when the server has the compiler | How a Cap'n Proto export is checked |
| Export from the CLI | apiome export capnp <item> --out <file>.capnp | Where to find the Cap'n Proto card |
How the item is written
Exporting to Cap'n Proto writes a .capnp schema that compiles with capnp compile, whatever
the item was imported from:
- Types. An object becomes a
struct, an enumeration anenum, aoneOf(or another union) astructholding aunionof its variants, a map astructwith a list ofkey/valueentries, and a listList(T). Scalars map as for Protobuf, with Cap'n Proto's own names:integerisInt32(Int64withformat: int64),numberisFloat64,stringisText. - Services. Each service becomes an
interface, and each operation a method. Its path, query and header parameters and its request body are the method's parameters, and its response body is the result. - Names. Cap'n Proto wants type names that start with a capital letter and other names in
camelCase with no underscore, so
first_nameis writtenfirstNameandSTATUS_ACTIVEisstatusActive. - Numbers. Fields, enum values and methods are numbered
@0,@1,@2in the order the source lists them, and the file gets its own@0x…id. Apiome remembers both for the item, so every later export writes the same numbers and the same file id. A field added since gets the next number. Cap'n Proto cannot leave a gap or drop a field, so a field removed from the source stays in the schema asobsolete<Name>, keeping its number and its size. The fidelity report lists every number Apiome assigned as synthesized. A Cap'n Proto import keeps its own numbers and file id. - Constraints. Cap'n Proto has no validation rules, so a field's constraints are written as a
comment just above it (
# constraints: >= 1; <= 100). Nothing checks them. With include_comments off they are left out.
What the fidelity report lists
The fidelity report lists, on each operation, type and field, what the schema changed:
| In the source | In the report |
|---|---|
| An operation (not from a Cap'n Proto import) | Approximated (warning): an interface method; its HTTP method, path and parameter locations are not kept |
| An operation's error responses | Dropped (warning): Cap'n Proto methods declare no errors |
| An event operation, a channel | Dropped |
| Constraints | Approximated (warning): a comment nothing checks. Dropped with comments off |
| A map | Approximated (warning): a list of key/value entries |
| A field, enum value or method with no Cap'n Proto number; the file id | Synthesized (note) |
| A name that breaks Cap'n Proto's rules | Approximated (note), naming the new name |
How a Cap'n Proto export is checked
When the server has the Cap'n Proto compiler, every export is compiled before it is delivered. A
schema that does not compile fails the export, and the check lists each compiler error with its file,
line and column. A schema that imports other .capnp files is not compiled on its own.
Where to find the Cap'n Proto card
In the Export dialog, the Cap'n Proto card is under RPC on the
Target step, as one .capnp file. Its badge is lossless for an item imported from Cap'n Proto
and lossy for any other source. Pick the card to see Include Comments (on by default). The
numbers and file id Apiome stored for the item are reused on every export, so a field you remove keeps
its number as an obsolete… placeholder and the next export keeps the same @0x… file id. From the
CLI, run apiome export capnp <item> --out <file>.capnp (capnproto works too). A lossy export exits
non-zero unless you add --force, and --json prints the tier. A public item's Export dialog on
Browse offers Cap'n Proto too, as the .capnp file.
FlatBuffers from any source
When to export to FlatBuffers
- Hand the data types to a FlatBuffers reader. Any item becomes one
.fbsschema of tables, structs, enums and unions thatflatccompiles, for games, embedded devices and robotics. Operations and channels are left out, and the card says so (types-only). - Keep readers compatible across exports. Apiome stores each field id, so every later export
writes the same ids, and a removed field keeps its slot as
(deprecated). - Round-trip a FlatBuffers item. An item imported from FlatBuffers exports lossless, with its
own ids, deprecated slots and
root_type.
FlatBuffers export at a glance
| Step | Where | Details |
|---|---|---|
| Pick the FlatBuffers card and its options (root type, comments) | Export dialog → FlatBuffers (under Data schema & graph) | Options · Where to find the FlatBuffers card |
| See how types, scalars, defaults, names and constraints are written | The fidelity report on the card | How the item is written |
| See how field ids are kept from one export to the next | — | Field ids |
| See what FlatBuffers cannot carry | The fidelity report on the card | What the fidelity report lists |
Trust the schema: flatc, or a re-import without it | Automatic before every download | How a FlatBuffers export is checked |
| Export from the CLI | apiome export flatbuffers <item> --out <file>.fbs | Where to find the FlatBuffers card |
How the item is written
Exporting to FlatBuffers writes one <Name>.fbs schema that compiles with flatc, whatever the
item was imported from — for games, embedded devices and robotics. Operations and channels are left
out: a FlatBuffers schema describes data only.
- Types. An object becomes a
table, an enumeration anenum, aoneOf(or another union) aunion, and a list a vector[T]. An object imported from a FlatBuffersstructstays astructwhen all its fields fit one (numbers, enums and other structs). An enum gets the smallest integer type its values fit (enum Status : byte) and lists them in ascending order. - Scalars. Sized integers keep their width (
int32isint,uint8isubyte), an unsizedintegerislong,numberisdouble, text and timestamps arestring, and bytes are[ubyte]. FlatBuffers has no typedef, so an alias is written as the type it stands for. - What FlatBuffers cannot hold directly gets a small table of its own, listed in the fidelity
report: a map becomes a vector of
<Map>Entrytables with akey(marked(key), so a reader can look entries up) and avalue; a list of lists becomes a vector of<Name>Itemtables; a union member that is not a table (astring, say) is wrapped in<Union><Member>. - Required and defaults. A required text, bytes, list or object field is marked
(required). A number, boolean or enum default is written as= value; an enum field with no default gets the enum's first value when0is not one of its values, because FlatBuffers would otherwise default it to0. - Names. Names use letters, digits and underscores and are not FlatBuffers keywords:
order-idis writtenorder_idand a field namedstringisstring_. Each rename is in the fidelity report. - Constraints. FlatBuffers has no validation rules, so a field's constraints are written as a
comment just above it (
// constraints: max length 12; pattern ^[A-Z]+$). Nothing checks them. With include_comments off they are left out.
Field ids
Every table field is written with its id, (id: N), in id order — the id is what a
reader matches a field by. Ids start at 0, and a union field takes two (its hidden <name>_type
field and its value). Apiome remembers the ids it assigned for the item, so every later export writes
the same ids and an unchanged item exports byte for byte the same. A field added since gets the next
free id. A field removed from the source keeps its id as a (deprecated) placeholder, so readers built
from the earlier schema still read the other fields correctly. A FlatBuffers import keeps its own ids
and deprecated slots.
Options
- root_type — the table a buffer starts with, by type name (
Order) or key. By default it is the imported schema'sroot_type, and none for other sources. Naming a type that is not a table is refused. - include_comments — on by default; descriptions are written as
///comments.
What the fidelity report lists
The fidelity report lists, on each type and field, what the schema changed:
| In the source | In the report |
|---|---|
| Operations, services and channels | Dropped (critical). An item that has any also gets a types-only warning counting them — export it to OpenAPI or AsyncAPI as well to keep them |
| Constraints | Approximated (warning): a comment nothing checks. Dropped with comments off |
| A map | Approximated (warning): a vector of <Map>Entry key/value tables |
| A field with no FlatBuffers id | Synthesized (note), naming the id |
| A wrapper table for a list of lists or a union member | Synthesized (note) |
| An alias, a struct written as a table, a renamed name | Approximated (note) |
| A default FlatBuffers cannot hold, a field whose type holds no value | Dropped |
A FlatBuffers import keeps its own ids, so its report lists no synthesized id.
How a FlatBuffers export is checked
When the server has the FlatBuffers compiler, every export is compiled with flatc before it is
delivered. A schema that does not compile fails the export, and the check lists each compiler error
with its file, line and column. Without the compiler, the export is read back with Apiome's FlatBuffers
importer. A schema that includes other .fbs files is not compiled on its own.
Where to find the FlatBuffers card
In the Export dialog, the FlatBuffers card is under Data schema &
graph on the Target step, as one .fbs file. Its badge is lossless for an item imported from
FlatBuffers and types-only for any other source (FlatBuffers keeps the tables and leaves out the
operations). Pick the card to see Include Comments (on by default) and Root Type (the table
root_type names; empty picks one). From the CLI, run apiome export flatbuffers <item> --out <file>.fbs
(fbs works too), and add --option root_type=Pet. A types-only export exits non-zero unless you add
--force, and --json prints the tier. A public item's Export dialog on Browse offers FlatBuffers
too, as the .fbs file.
COBOL copybook from any source
Exporting to COBOL Copybook writes the item's data types as copybook record layouts, <Name>.cpy,
for z/OS Connect, CICS and IMS programs. An item imported from a copybook is written back exactly as
it was imported — its pictures, usages, tables and REDEFINES — and the options below do not change it.
When to export to a COBOL copybook
- Hand a record layout to a mainframe program. Any REST, RPC, JSON Schema or other item becomes
fixed-width
01records for z/OS Connect, CICS, IMS or batch COBOL. Lengths, table sizes and names are synthesized where the source does not say, operations are left out, and the card says types-only. - Round-trip a copybook. An item imported from a copybook exports back lossless, with its own
pictures, usages, tables and
REDEFINES. - Serve a PL/I program. The same record layout as PL/I
DECLAREstructures, with modepli.
COBOL copybook export at a glance
| Step | Where | Details |
|---|---|---|
| Pick the COBOL Copybook card and its options (numeric usage, format, mode) | Export dialog → Data schema & graph → COBOL Copybook | Below, Where to find it |
| See how records, names, text, numbers, lists and unions are laid out | The fidelity report on the card | The list below |
| See everything the layout had to invent or change, field by field | The fidelity report on the card | The table below |
| Write PL/I include structures instead | mode pli | PL/I include structure output |
| Trust the export: read back, and checked with cb2xml when the server has it | Automatic before every download | Below, Checked with cb2xml |
| Export from the CLI | apiome export copybook <item> --out <Name>.cpy | Below, Where to find it |
| Download from a public item | Browse → Export | Below, Where to find it |
Any other item is laid out like this:
- Records. Each object that no other object contains is an
01record. Objects inside it are written inline as group items, with levels05,10,15… (a smaller step when a record nests too deep to stay within level 49). An object that contains itself is written once; the inner reference is left out and listed in the report. A model with no object is refused. - Names. COBOL data names:
orderLineItemsandorder_line_itemsare writtenORDER-LINE-ITEMS, a reserved word gets-X(STATUS-X), and a name is cut to 30 characters. Every name is unique in the copybook — a clash gets-2,-3… within the 30 — so nothing needsOFto be referenced, and the same item always gets the same names. - Text is
PIC X(n),nfrommaxLength. Dates arePIC X(10)(YYYY-MM-DD), timesX(15), timestampsX(32)and UUIDsX(36). Other text gets the default_string_length (255), and the report lists each. - Numbers. 16-, 32- and 64-bit integers are
PIC S9(4),S9(9)andS9(18)(9(n)when the minimum is 0 or more), binary (COMP). A decimal is packed,PIC S9(p)V9(s) COMP-3, with 18 digits in all and its scale frommultipleOf(0.01is 2 places), else decimal_scale. A float isCOMP-1orCOMP-2. - Booleans and enumerations. A boolean is a one-character flag with two condition names,
88 <NAME>-TRUE VALUE 'Y'and88 <NAME>-FALSE VALUE 'N'. An enumeration isPIC X(n)(or a number) with one88level per value. - Lists. A list of a fixed size is
OCCURS n TIMES. Any other list isOCCURS min TO max TIMES DEPENDING ON <NAME>-COUNT, with the counter written just before it;maxismaxItems, else default_occurs (10). A list inside another list is a fixed table of its maximum, becauseDEPENDING ONis not allowed there. - Unions are written as items that share storage: each member after the largest one
REDEFINESit. A union with a member holding a list that varies in size is left out, because COBOL cannot overlay anOCCURS DEPENDING ONtable. - Rules a picture cannot hold — a
pattern, aformatsuch asemail— are written as comment lines just above the item (* pattern: ^[A-Z]{3}$). - Left out: maps, operations and channels — a copybook describes record layouts only.
Options:
- numeric_usage —
comp(default): binary integers, packed decimals and floats;display: every number zoned (PIC S9(9), floats as decimals). - default_string_length, default_occurs, decimal_scale — what is used when the source does not say (255, 10 and 2).
- fixed_format — on by default: code in columns 8–72, a long entry continued on the next line, and
*comments in column 7. Turn it off for free format: no column limits and*>comments. - include_comments — on by default; turn it off to leave out the header comment.
A copybook is fixed-width and positional, so the fidelity report lists — on each field, by its path in the source — everything the layout had to invent or change, computed for the options you pick:
| In the source | In the report |
|---|---|
| Operations, services and channels | Dropped (critical). An item that has any also gets a types-only warning counting them — export it to OpenAPI or AsyncAPI as well to keep them |
Text with no maxLength | Synthesized (warning): the default PIC X(n) |
| A list that varies in size | Synthesized (note): the <NAME>-COUNT counter. With no maxItems, also approximated (warning): the default maximum |
A name changed to COBOL's rules (order_id → ORDER-ID) | Synthesized (note), naming the COBOL name |
| A union | Approximated (warning): REDEFINES. Dropped when a member varies in size |
A pattern, a format | Approximated: a comment line, which nothing checks |
| An optional field | Approximated (note): a record has no null — the field is always present, and an absent value is written as spaces or zeros, a convention to agree with the record's readers |
A list inside a list, a float with display usage, a type with no COBOL form | Approximated (warning) |
| A map, a record that contains itself, a field whose type holds no value | Dropped |
| A document of another format | Approximated (note): it reads back as a copybook item |
An item imported from a copybook is written back as it was, so its report lists nothing invented.
Checked with cb2xml. When the server has cb2xml, it parses every copybook export, the same way a mainframe toolchain would read it. The export fails when:
- cb2xml cannot parse it. The check shows cb2xml's error message, and for a fixed-format copybook the line and column.
- cb2xml reads a different layout. The records and items, in order, must match the layout Apiome
planned with your options: each item's level, name,
PIC, usage,OCCURS(andDEPENDING ON),REDEFINESand88values. Each difference is listed at the item's path, such asPURCHASE.LINES-X. Spellings COBOL treats as the same pass:X(3)andXXX,COMPandBINARY,COMP-3andPACKED-DECIMAL.
cb2xml reads fixed format only, so a free-format export is laid out in columns 8–72 for the check; an error in it then has no line number. Without cb2xml, the export is read back by Apiome's copybook reader.
PL/I include structure output
PL/I programs read record layouts as DECLARE structures rather than copybooks. Set mode to pli to
write the same record layout as a PL/I include member, <Name>.pli: the same records and items, in the
same order, each taking the same bytes. Everything above about how an item is laid out (names, lengths,
tables, unions, the options) applies; only the declaration syntax changes:
| Copybook | PL/I |
|---|---|
01 / 05 / 10 … | Levels 1 / 2 / 3 … by depth |
CUST-ID, FILLER | CUST_ID, * (an unnamed member) |
PIC X(n), PIC A(n) | CHAR(n) |
PIC N(n) | WIDECHAR(n) |
PIC S9(p)V9(s) COMP-3 | FIXED DEC(p+s,s) |
PIC S9(4), S9(9), S9(18) COMP | FIXED BIN(15), FIXED BIN(31), FIXED BIN(63) |
PIC S9(5) (zoned) | PIC'(4)9T' — T is the sign overpunched on the last digit |
COMP-1, COMP-2 | FLOAT DEC(6), FLOAT DEC(16) |
OCCURS 10 TIMES | The dimension (10) |
OCCURS 0 TO 50 TIMES DEPENDING ON LINES-COUNT | (50 REFER(LINES_COUNT)), in a BASED structure, as REFER requires |
B REDEFINES A | A and B as members of a UNION |
88 condition names | A comment above the item: /* values: GIFT_TRUE = 'Y', GIFT_FALSE = 'N' */ |
Every structure is declared UNALIGNED, so binary and float items are not moved to a word boundary and
the offsets are the copybook's. With fixed_format on (the default), the source stays within PL/I's
default margins, columns 2–72; off, each declaration is one line.
The fidelity report lists the same entries as for a copybook — on the same fields, with the same grades —
in PL/I terms (CHAR(255) for the default length, REFER for a counter, UNION for a union). A name that
only needed an underscore is not listed: PL/I keeps CUSTOMER_NAME where COBOL wrote CUSTOMER-NAME.
PL/I also lists what only it changes:
| In the copybook | In the report |
|---|---|
88 condition names | Approximated (note): a comment, which nothing checks |
| A data name with a hyphen (an item imported from a copybook) | Approximated (note), once: each hyphen is an underscore |
REDEFINES beside other items | Synthesized (note): the overlay is wrapped in a UNION group, such as PAYMENT_DETAIL_UNION, a level the copybook does not have |
A REDEFINES of an item that is not before it | Approximated (warning): written as an item of its own |
An edited or mixed picture (Z(5)9.99) | Approximated (warning): CHAR(n) of the bytes it takes, with the picture in a comment |
A binary number with decimal places (S9(5)V99 COMP) | Approximated (warning): FIXED BIN, with the decimal places in a comment |
A 66 RENAMES item | Dropped (warning): it takes no storage of its own |
An item imported from a copybook is exported through its own layout in this mode too.
Each PL/I export is checked before you download it. Apiome's PL/I reader must parse it with no attribute
it does not know, and every record and item, in order, must take the bytes the copybook item does. Each
difference is a pli.layout finding, such as PURCHASE.CUSTOMER_NAME takes 39 byte(s); the copybook item PURCHASE.CUSTOMER-NAME takes 40.
Where to find it. In the Export dialog, the COBOL Copybook card is under Data schema &
graph on the Target step. Its badge is computed for the item. Copybook is one of the lossiest
targets: anything that is not a copybook (a REST API, a gRPC service, a JSON Schema) is types-only,
with most of its layout synthesized, while an item imported from a copybook is lossless. Pick the
card to set Numeric Usage, Fixed Format, Include Comments and Mode (copybook by
default, or pli); the three defaults
(default_string_length, default_occurs, decimal_scale) are set from the CLI. Run
apiome export copybook <item> --out <Name>.cpy (cobol and cobolcopybook work too) and add
--option numeric_usage=display, --option fixed_format=false, --option default_occurs=25 or
--option mode=pli --out <Name>.pli.
A types-only export exits non-zero unless you add --force; --out - writes the copybook to
standard output, and --json prints the file written and its tier as JSON. A public item's Export
dialog on Browse offers the same target.
EDI and e-invoicing guides
Trading partners agree on the documents they exchange before they exchange any: which segments or elements a purchase order or an invoice carries, how long each value is, which codes it may hold. Apiome writes that agreement from an item's types, for the three families B2B partners use and for HL7 v2 healthcare interfaces. Each is a guide or schema partners build their documents from, not a document itself.
When to use which
- North American partners: X12. Retail, logistics and healthcare in North America exchange X12
transaction sets (
850purchase order,810invoice,837claim). Export an X12 implementation guide. - International partners: UN/EDIFACT. Most other partners exchange UN/EDIFACT messages (
ORDERS,INVOIC,DESADV). Export a UN/EDIFACT message guide. It is laid out by the same plan as the X12 guide, so an item's two guides list the same segments in the same order. - E-invoicing and XML business documents: UBL and Peppol. EU e-invoicing runs on Peppol BIS Billing 3.0, whose invoices and credit notes are UBL 2.1 documents. Export XSD with the UBL and Peppol BIS profiles for a UBL document schema, validated against the official UBL 2.1 schemas it ships with.
- Healthcare interface partners: HL7 v2. Hospital interfaces exchange HL7 v2 messages (
ADT^A01,ORU^R01). Export an HL7 v2 segment guide — the message and segment definitions an integration engine is configured from, laid out by the same plan as the X12 guide.
EDI and e-invoicing at a glance
| | X12 implementation guide | UN/EDIFACT message guide | UBL / Peppol (XSD profile) || HL7 v2 segment guide |
| --- | --- | --- | --- |--- |
| Card (Data schema & graph) | X12 implementation guide | UN/EDIFACT message guide | XSD, Profile ubl or peppol | HL7 v2 segment guide |
| You get | JSON guide, segment CSV, Markdown guide | JSON guide, segment CSV, Markdown guide | Document schema, the OASIS UBL 2.1 schemas, notice, guide | JSON guide, segment CSV, Markdown guide |
| Pick the document | Transaction Set, Version | Message Type, Release | Ubl Document (Peppol: Invoice or CreditNote) | Message Type, Version |
| Units | Segments and loops, X12 element types | Segments and segment groups, simple and composite data elements | UBL aggregates and data types, cbc: components | Z-segments and segment groups, HL7 data types and tables |
| Checked by | Apiome's guide rules, pyx12's dictionary when installed | Apiome's guide rules | An XML Schema processor against the UBL 2.1 schemas, the Peppol conventions | Apiome's guide rules |
| CLI | apiome export x12 | apiome export edifact | apiome export xsd --option profile=peppol | apiome export hl7guide |
All four describe types only — operations and channels are left out — and every length, code and identifier the guide invents is listed in the fidelity report.
X12 implementation guide from any source
Exporting to X12 implementation guide describes the item's types as an X12 transaction set, for
onboarding trading partners. It is not an interchange: it is the guide partners build their
interchanges from. You get three files, downloaded together as a .zip:
<Name>.x12-guide.json— the machine-readable guide: the transaction set, every segment with its elements, and the structure (positions, loops, usage and maximum use);<Name>.x12-segments.csv— the segment dictionary, one row per element, for spreadsheet tools;<Name>.x12-guide.md— the same guide for people to read.
How the types are laid out:
- Segments. Each object becomes a segment of its plain values, in field order. Its segment ID is
made from its name —
PurchaseOrderisPUR,OrderLineisORD— unique in the guide and never an envelope ID (ST,SE,GS…). Elements are referred to by segment and position:PUR01,PUR02… - Loops. An object inside another object follows it as a child segment. A list of objects is a loop
that repeats up to
maxItems(>1when there is no limit), and a list of plain values is a segment of one element, repeated. The item's top-level objects sit directly in the transaction set, between theSTheader and theSEtrailer, and positions number the whole structure0100,0200… (closer together when a guide has more than 98 segments, so a position always has four digits) - Usage. A required field is mandatory (
M), any other optional (O). - Notes. A rule an element type cannot enforce — a
pattern, aformatsuch asemail, a minimum or maximum, a set of allowed values — is written as a note on the element (in the JSON, the CSV and the Markdown guide). - Codes. An enum value is used as a code when it is upper-case letters and digits no longer than
max_code_length (3). Any other value gets a code made from it —
ON-HOLDbecomesONH— and the guide shows the value next to it. - Left out: unions and maps (a segment holds flat values only), an object that contains itself, operations and channels. Each is listed in the export's losses.
| In the source | In the guide |
|---|---|
| Text | AN, maxLength (or the default_element_length, 80) as its maximum; a UUID AN 36/36 |
| An enumeration, a boolean | ID with a code list — the enum's values, or Y/N |
| An integer | N0, as many digits as its width allows (3, 5, 10 or 18) |
| A decimal | N2 (implied decimal places) when multipleOf gives its scale (0.01), else R |
| A float | R |
| A date | DT (CCYYMMDD) |
| A time | TM (HHMM to HHMMSSDD) |
| A timestamp | Two elements: its date (DT) and its time (TM) |
An item imported from X12 keeps its segment IDs, its element references and the order of its
interchange, and a position the sample left empty is marked not used (X).
Options:
- transaction_set — the set's 3-digit ID (
850,810,837…). By default an imported X12 item's own, else850. - version — the 6-digit X12 version (
005010,004010…). By default an imported X12 item's own, else005010. - default_element_length — the maximum of a text element whose source has no
maxLength(80). - max_code_length — the longest enum value used as a code as it is (3).
A model with no object at all is refused: there is nothing to lay out.
X12 is the most constrained target, so its fidelity report lists every change on the field it came from, computed for the options you pick:
| In the source | In the report |
|---|---|
| A union, a map, an object that contains itself, more than 99 values in one object | Dropped (critical) |
| Operations, services and channels | Dropped (critical), with a types-only warning counting them |
Text with no maxLength | Synthesized (warning): the default element length |
| An enum value that is not a valid code | Synthesized (warning): the code made for it |
| A segment ID made from a name, a marker element for an object with no plain value | Synthesized (note) |
| A list of lists | Approximated (warning): flattened into one list |
| A rule kept only as a guide note | Approximated (warning) |
| A decimal with no known scale | Approximated (warning): R, so its precision is not fixed |
A decimal with implied places (N2), a float (R), a timestamp split into date and time | Approximated (note) |
Critical losses need confirming. When a type would lose a union, a map or other values
outright, the export is a severe conversion: the Export dialog, POST …/dispatch and export jobs
ask you to confirm before they run, and the warning names each construct and why (in the guard's
reasons, and in full in critical_details). An item with operations is warned that only its schemas
export, and still lists those constructs.
Checked before you download it. A guide cannot be imported back, so every export is checked
instead. The export fails, and lists every problem with its file, its place in the guide (a JSON
pointer such as /segments/2/elements/0) and its rule, when:
- The JSON guide is not the guide format (
x12-guide.schema): a missingtransactionSet,version,segmentsorstructure, or a value of the wrong type. - A segment or element is wrong: a segment ID that is not 2–3 letters or digits, or is defined
twice; element references that are not
<ID>01upward with no gap; an unknown element type; lengths whereminLengthis abovemaxLength; usage other thanM,OorX. - The structure and the segments disagree: the structure uses a segment that is not defined, or a
segment is defined and never used; a loop does not start with its own segment; positions are not four
digits in increasing order; the guide does not start with
STand end withSE. - A code list is wrong: an
IDelement with no codes, a code longer or shorter than the element, a code listed twice, codes on an element that is notID, orST01not listing the transaction set. - The files disagree (
x12-guide.files): the.csvor.mdfile does not list exactly what the JSON guide says, or one of the three files is missing. - The X12 dictionary disagrees (
x12-guide.dictionary): when the server has pyx12 and pyx12 has segment definitions for the guide's version (005010,004010), theSTandSEelements must have the standard types and lengths, and a segment carried from an imported X12 item must not have more elements than the standard segment. A segment Apiome made from a type is not compared with a standard segment that happens to share its ID. Without pyx12, or for another version, this check is skipped and the export says so; the other checks still run.
A 004010 guide's ST has two elements: ST03 (implementation convention reference) exists from
004020.
Where to find it. In the Export dialog, the X12 implementation guide card is under Data
schema & graph on the Target step, marked multi-file. Its badge is types-only for every source,
an imported X12 item included: a guide invents the lengths, codes and segment IDs an interchange does
not state, and leaves operations out. Pick the card and type the Transaction Set (850, 810,
837 …) and Version (005010, 004010 …); leave them empty for the item's own, else 850 and
005010. From the CLI, run apiome export x12 <item> --out <folder> (the three files are unpacked into
the folder) and add --option transaction_set=810 or --option version=004010. apiome export x12
writes the guide; the X12 interchange itself is apiome export edix12. A types-only export exits
non-zero unless you add --force, and --json prints the tier. A public item's Export dialog on
Browse offers the guide too, as a .zip. For trading partners who use UN/EDIFACT instead, see the
UN/EDIFACT message guide: the same layout in EDIFACT terms.
UN/EDIFACT message guide from any source
International trading partners exchange UN/EDIFACT messages — ORDERS, INVOIC, DESADV — rather than
X12 transaction sets. Exporting to UN/EDIFACT message guide describes the item's types as one EDIFACT
message, for onboarding those partners. Like the X12 guide, it is the guide partners build their messages
from, not a message. You get three files, downloaded together as a .zip:
<Name>.edifact-guide.json— the machine-readable guide: the message, every segment with its data elements, and the structure (positions, segment groups, status and maximum repetitions);<Name>.edifact-segments.csv— the segment directory, one row per data element and per component;<Name>.edifact-guide.md— the same guide for people to read.
One layout for both guides. The EDIFACT guide is laid out by the same plan as the X12 implementation guide: the same segments, in the same order, with the same values, the same loops (segment groups here) and the same usage and repetitions. Only the spelling differs, so an item's two guides never disagree. Everything the X12 section says about segments, loops, notes and codes applies; in EDIFACT terms:
- Tags. A segment's tag is three letters, made from its name (
PurchaseOrderisPUR), and never a service tag — none starts withU. Data elements are referred to by tag and position:PUR01,PUR02…; a composite's components byPUR02-1,PUR02-2… - Segment groups. A loop is a segment group,
SG1,SG2… in order, started by its trigger segment. The message sits between theUNHheader and theUNTtrailer, and positions number the structure0010,0020… - Status. A required field is mandatory (
M), any other conditional (C); a position the item leaves empty is not used (N). - Repetitions. Every repetition is a number: a list with no
maxItemsrepeats at most default_max_use times (9999). - Codes. An enum's values are the code list of a coded value (what EDIFACT calls a qualifier when it says what the next value means), with the same rule for values that are not valid codes as the X12 guide.
| In the source | In the guide |
|---|---|
| Text | an..35 — maxLength (or the default_element_length, 35) as its maximum; an36 for a UUID |
| An enumeration, a boolean | A coded value with its code list — the enum's values, or Y/N (an2, an1 …) |
| An integer | n..10, as many digits as its width allows (3, 5, 10 or 18) |
| A decimal | n..15 with its decimals count when multipleOf gives its scale: EDIFACT always sends the decimal mark |
| A float | n..15 |
| A date | n8, format 102 (CCYYMMDD) |
| A time | n..8 (HHMM[SS]) |
| A timestamp | One composite of two components, its date and its time |
UNH02 identifies the message: its type, version D, release and agency UN.
An item imported from EDIFACT keeps its tags, the order of its segments, and its composites: NAD02 is a
composite whose components are NAD02-1, NAD02-2 … , and a component the sample left empty is not used.
An item imported from X12 keeps its segments and their order; a segment whose X12 ID is not a valid tag
(N1, PO1) gets a new one. A service segment the item carries (UNS) gets a new tag too.
Options:
- message_type — six letters (
ORDERS,INVOIC,DESADV…). By default an imported EDIFACT item's own, elseORDERS. - release — the directory release (
96A,01B…;D.01Bworks too). By default an imported EDIFACT item's own, else01B. - default_element_length — the maximum of a text value whose source has no
maxLength(35). - max_code_length — the longest enum value used as a code as it is (3).
- default_max_use — how often a segment or group from a list with no
maxItemsmay repeat (9999).
The fidelity report lists the same entries as the X12 guide's, on the same fields and with the same grades, in EDIFACT terms. One entry is the EDIFACT guide's own:
| In the source | In the report |
|---|---|
A list with no maxItems | Synthesized (note): the default maximum repetitions |
Checked before you download it. As for the X12 guide, every export is checked instead of read back, and fails — listing every problem with its file, JSON pointer and rule — when:
- The JSON guide is not the guide format (
edifact-guide.schema). - A segment or data element is wrong: a tag that is not three letters, or is a service tag
(
edifact-guide.segment-tag), or is defined twice; data element references that are not<TAG>01upward, or components that are not<ref>-1upward (edifact-guide.element-ref); a representation that is notanornwith a length, or does not match the lengths (edifact-guide.representation,edifact-guide.lengths); a status other thanM,CorN. - The message is wrong: a message type that is not six letters, a release that is not a directory
release (
edifact-guide.message), orUNH02not naming them (edifact-guide.envelope). - The structure and the segments disagree: an undefined or unused segment, a segment group that does
not start with its trigger or is numbered out of order (
edifact-guide.group), positions not in increasing order, a repetition that is not a positive count, or a guide that does not start withUNHand end withUNT. - A code list is wrong: a code longer or shorter than its value, or listed twice.
- The files disagree (
edifact-guide.files): the.csvor.mdfile does not list exactly what the JSON guide says, or one of the three files is missing.
Where to find it. In the Export dialog, the UN/EDIFACT message guide card is under Data
schema & graph on the Target step, marked multi-file. Its badge is types-only for every source,
an imported EDIFACT item included. Pick the card and type the Message Type (ORDERS, INVOIC …) and
Release (96A, 01B …); leave them empty for the item's own, else ORDERS and 01B. From the CLI,
run apiome export edifact <item> --out <folder> and add --option message_type=INVOIC or
--option release=96A. A types-only export exits non-zero unless you add --force. A public item's
Export dialog on Browse offers the guide too, as a .zip.
HL7 v2 segment guide from any source
Hospital integration engines — Mirth Connect, Rhapsody, Cloverleaf — are configured from HL7 v2 message and
segment definitions: which segments a message holds, in what order and how often, and each segment's fields.
Exporting to HL7 v2 segment guide writes that definition for the item's types, for onboarding an interface
partner. It is the guide partners build their messages from, not a message (to write an imported HL7 v2 message
back out, export to HL7 v2). You get three files, downloaded together as a .zip:
<Name>.hl7v2-guide.json— the machine-readable definition: the message, every segment with its fields, the tables and the structure (segment groups, optionality and repetition);<Name>.hl7v2-segments.csv— the segment definitions, one row per field;<Name>.hl7v2-guide.md— the same guide for people to read, with the message's abstract message syntax (MSH ZPU ZPA { ZOR } [ { ZNO } ]:[ ]optional,{ }repeating).
One layout for every guide. The HL7 v2 guide is laid out by the same plan as the X12 implementation guide and the UN/EDIFACT message guide: the same segments, in the same order, holding the same values. Only the spelling differs; in HL7 v2 terms:
- Segments. A segment made from a type is a site-defined Z-segment, its ID made from its name
(
PurchaseOrderisZPU). Its fields areZPU-1,ZPU-2… in order. - The header. The message starts with the standard
MSHsegment, withMSH-9the message type andMSH-12the version. - Segment groups. A loop is a segment group named after its record (
ORDER_LINE). - Optionality. A required field or segment is
R, any otherO; a position the item leaves empty is not used (X). - Repetition.
N(once),Y(any number: a list with nomaxItems) or the list'smaxItems. - Tables. Each enum is a user-defined table, numbered from first_table_number (
9001,9002…), listing its codes and the values they stand for; the coded field names its table. An enum value longer than max_code_length, or not a valid code, gets a shorter code, with the value as its description.
| In the source | In the guide |
|---|---|
| Text | ST — maxLength (or the default_field_length, 199) as its length |
| An enumeration | IS (CWE from v2.7) bound to the enum's user-defined table |
| A boolean | ID bound to HL7 table 0136 (Yes/no indicator: Y, N) |
| An integer, a decimal, a float | NM — HL7 sends the decimal point |
| A date | DT (YYYYMMDD) |
| A time | TM (HHMM[SS]) |
| A timestamp | One TS field (DTM from v2.6), YYYYMMDDHHMM[SS] |
An item imported from HL7 v2 keeps its own segments (MSH, PID, PV1 …), their order and their field
sequence (PID-1, PID-2 …), and its own message type and version in MSH-9 and MSH-12 unless you pick
others.
Options:
- message_type —
<code>^<event>, optionally with the message structure (ADT^A01,ORU^R01,ORM^O01^ORM_O01). By default an imported HL7 v2 item's own, elseZZZ^Z01, a site-defined message. - version — the HL7 v2 version (
2.3,2.5.1,2.8…). By default an imported HL7 v2 item's own, else2.5.1. - default_field_length — the length of a text field whose source has no
maxLength(199). - max_code_length — the longest enum value used as a code as it is (20).
- first_table_number — the number of the first user-defined table (9001).
The fidelity report lists the same entries as the X12 guide's, on the same fields and with the same grades, in HL7 v2 terms — a Z-segment ID made from a type's name is synthesized, and so on. One entry is the HL7 v2 guide's own:
| In the source | In the report |
|---|---|
| An enumeration | Synthesized (note): the user-defined table number the export assigns |
Checked before you download it. As for the other guides, every export is checked instead of read back, and fails — listing every problem with its file, JSON pointer and rule — when:
- The JSON guide is not the guide format (
hl7v2-guide.schema). - A segment or field is wrong: an ID that is not three letters or digits starting with a letter
(
hl7v2-guide.segment-id), or is defined twice (hl7v2-guide.duplicate-segment); fields that are not<ID>-1upward with no gap (hl7v2-guide.field-ref); an unknown data type (hl7v2-guide.data-type); a length that is not positive (hl7v2-guide.length); optionality other thanR,OorX(hl7v2-guide.optionality); a repetition other thanN,Yor a positive count (hl7v2-guide.repetition). - The message is wrong: a message type that is not
<code>^<event>, a version that is not an HL7 v2 version (hl7v2-guide.message), or a structure that does not start withMSH, orMSH-9andMSH-12not naming them (hl7v2-guide.envelope). - A table is wrong (
hl7v2-guide.table): a coded field (ID,IS,CWE) with no table or one the guide does not define, a table no field uses, or a code listed twice or longer than its field. - The structure and the segments disagree: an undefined or unused segment
(
hl7v2-guide.undefined-segment,hl7v2-guide.unused-segment), or an unnamed or empty segment group (hl7v2-guide.group). - The files disagree (
hl7v2-guide.files): the.csvor.mdfile does not list exactly what the JSON guide says, or one of the three files is missing.
Where to find it. In the Export dialog, pick the HL7 v2 segment guide card on the Target
step (in Export studio it is under Healthcare, with FHIR and HL7 v2), marked multi-file. Its badge is types-only for every source,
an imported HL7 v2 item included. Pick the card and type the Message Type (ADT^A01, ORU^R01 …) and
Version (2.5.1, 2.8 …); leave them empty for the item's own, else ZZZ^Z01 and 2.5.1. From the CLI,
run apiome export hl7guide <item> --out <folder> and add --option message_type=ORU^R01 or
--option version=2.8. A types-only export exits non-zero unless you add --force. A public item's
Export dialog on Browse offers the guide too, as a .zip.
FIX Orchestra from any source
When to export to FIX Orchestra
- Publish the rules of engagement of a FIX interface. Export the item's types as a FIX Orchestra repository: the machine-readable description of messages, components, repeating groups, fields with their tags, and code sets that FIX engines and tools read.
- Describe an API's payloads to a capital-markets counterparty. A REST, JSON Schema or GraphQL item becomes Orchestra messages and fields, with FIX tags assigned for you.
- Round-trip an Orchestra item. An item imported from Orchestra
(Import a FIX Orchestra repository) exports back with its tags, ids,
msgTypes, scenarios, presence and rules, actors and flows.
An Orchestra repository describes messages, not an API's operations, so those are left out, with a critical warning at the top of the fidelity report.
FIX Orchestra export at a glance
| Step | Where | Details |
|---|---|---|
| Pick the card (option: Version) | Export dialog → Data schema & graph → FIX Orchestra | Where to find the FIX Orchestra card |
| See which types become messages, components, groups and code sets | This section | How the item is written |
| Keep the FIX tags stable across exports | Automatic, per item | How the item is written (Tags and ids) |
| Check what is kept, approximated, dropped or made up | The fidelity report | What the fidelity report lists |
| Trust the file | Checked against the official Orchestra XSD and re-imported before every download | How a FIX Orchestra export is checked |
| Export from the CLI | apiome export fix-orchestra (also orchestra) | Where to find the FIX Orchestra card |
How the item is written
You get one <name>.orchestra.xml: an Orchestra 1.0 repository in the
http://fixprotocol.io/2020/orchestra/repository namespace, checked against the official FIX Orchestra 1.0
repository XSD before you download it (see How a FIX Orchestra export is checked).
| In the item | In the repository |
|---|---|
| An Orchestra message, else a root record (one no other record holds) | A message, with its msgType, flow, scenario and responses when the source has them |
| A record another record holds | A component, used by a componentRef |
| A list of records | A repeating group with its NumInGroup counter field, used by a groupRef |
| A list of plain values / a map | A group with one entry field / a group of key and value (reported) |
| A union | A component with one optional member per alternative (reported) |
| An enumeration | A codeSet; each value is a code (char for one-character codes, int, else String) |
| A field | A field, declared once with its tag (id) and datatype, and a fieldRef by tag |
| A required field / constant / conditional rule | presence="required" / presence="constant" with its value / a rule with its when |
An inline enum on a field | A code set of its own (<field>CodeSet) |
minimum / maximum, minLength / maxLength | The fieldRef's minInclusive / maxInclusive, implMinLength / implMaxLength |
A list's minItems / maxItems | The groupRef's implMinOccurs / implMaxOccurs |
Any other constraint (pattern, multipleOf …) | The fieldRef's documentation (Constraints: pattern …) |
| An operation whose request or response body is a message | A scenario: the request message's responses name the response messages |
| Actors, state machines and flows | actors, when the source carries them |
Tags and ids. An item imported from FIX or Orchestra keeps its tags and its message, component, group
and code-set ids. Any other source has none, so tags are assigned from 5000, FIX's user-defined range,
skipping every tag the source already uses, and ids from 1. Apiome keeps every tag it assigns for the item:
the next export of the same item reuses each field's tag, and a new field gets a tag no field of the item has
had, so a counterparty's FIX dictionary stays valid. Datatypes are the standard FIX ones (String,
int, float, Boolean, UTCTimestamp, LocalMktDate, UTCTimeOnly, data).
What the schema requires. A name Orchestra does not allow is rewritten (placed-at → placed_at).
The repository version is the source's FIX version, else the item's version as major.minor, else
FIX.Latest, or what the version option says. Orchestra requires a code set, so a model without an
enumeration gets an empty NoCodeSet. Each of these is reported.
What the fidelity report lists
| Construct | Reported as | Why |
|---|---|---|
| An operation whose request or response body is written as a message | Approximated (a message scenario) and the operation itself dropped (info) | The messages and their responses survive; the binding, parameters and errors do not |
| Any other operation, channel or service | Dropped, under a critical "types only" warning that counts the dropped operations and the scenarios | Orchestra describes messages, not an API |
| A FIX tag the source does not carry | Made up | Assigned once, then kept by every re-export of the item |
| An inline enumeration | Approximated: a code set | The values are kept as codes; a re-import types the field by the code set |
| Bounds, lengths, list counts | Approximated: fieldRef and groupRef attributes | Orchestra records them for implementations; it does not validate with them |
| Any other constraint | Approximated: written in the documentation | Orchestra has no form for it |
| A record from another format | Approximated: flattened into a message, component or group | Its fields become refs to fields declared once for the repository |
| A list of plain values, a map, a union | Approximated: a group, a group of key / value entries, a component | Orchestra has no lists of values, maps or unions |
| A name Orchestra does not allow, the version, a placeholder code set | Approximated / made up | What the schema requires |
What a re-import gives back is measured, not guessed: an entity reads back under its Orchestra name, and the API's identity as the repository's name, version and title. An item imported from Orchestra reports no made-up tag and no flattening.
How a FIX Orchestra export is checked
Before an export is delivered, the repository must pass two checks:
- The official schema: it validates against the FIX Orchestra 1.0 repository XSD from FIX Trading Community, which Apiome ships with and checks offline.
- Round trip: it imports again through the FIX Orchestra importer (Import a FIX Orchestra repository), and every message it declares reads back as a message.
An export that fails either check is never delivered. The export job fails, and its validation report lists
every problem with its rule (orchestra.xsd, xml or reimport), its path in the repository and the file.
Where to find the FIX Orchestra card
The Export dialog and Export studio offer FIX Orchestra under Data schema & graph. It writes one
file, <name>.orchestra.xml, and its one option is Version, the repository's FIX version (FIX.Latest,
FIX.4.4, FIX.5.0SP2_EP254, 1.0 …; empty uses the item's own). The tags Apiome keeps for the item are not an
option: they are applied for you.
| Source | Badge |
|---|---|
| An imported FIX Orchestra repository | types-only, with a high preserved share: its messages, fields, tags and code sets come back |
| A REST, GraphQL or RPC API, a JSON Schema item | types-only, with its preserved share: its records are flattened and its tags made up |
| A gateway configuration, an agent card, or anything else with no record type | Greyed out, with the reason |
An API with operations also starts its fidelity report with the critical "types only" warning. A public item's Export dialog on Browse offers the card too.
From the CLI:
| Command | Writes |
|---|---|
apiome export fix-orchestra <item> --out <name>.orchestra.xml (also orchestra) | The repository |
apiome export fix-orchestra <item> --out … --option version=FIX.5.0SP2 | The repository, for that FIX version |
The command prints the fidelity report and, because Orchestra keeps types only, exits non-zero unless you add
--force.
WSDL and XSD from any source
When to export to WSDL
- Hand a SOAP description to a SOAP toolchain. Any REST, RPC, GraphQL or JSON Schema item becomes a WS-I document/literal SOAP 1.1 service: one SOAP operation per operation, its types as XML Schema. The HTTP method and path, and what JSON says that XML Schema cannot, are listed in the fidelity report before you download.
- Round-trip a WSDL. An item imported from WSDL exports back lossless, with its own messages, parts, bindings and SOAP versions.
- Hand a WSDL 2.0 description to a toolchain that reads 2.0. Set Wsdl Version to
2.0to get a W3C WSDL 2.0descriptioninstead of a WSDL 1.1 one. An item imported from WSDL 2.0 round-trips unchanged; what a WSDL 1.1 item has that 2.0 cannot say is listed in the fidelity report.
WSDL export at a glance
| Step | Where | Details |
|---|---|---|
| Pick the WSDL card and its layout (bundle or single file) | Export dialog → REST & HTTP → WSDL | Where to find the WSDL card |
| Write WSDL 2.0 instead of 1.1 | Wsdl Version 2.0 on the card | WSDL 2.0 |
| See how types, rules, operations and names are written | The fidelity report on the card | How the item is written |
| See what XML Schema cannot say the way JSON does | The fidelity report on the card | What the fidelity report lists |
| Trust the bundle: packaged, WS-I, valid, re-imports | Automatic before every download | How a WSDL export is checked |
| Export from the CLI | apiome export wsdl <item> --out <folder> | Where to find the WSDL card |
How the item is written
Exporting to WSDL writes a SOAP 1.1 description in the WS-I document/literal style, whatever the
item was imported from. By default you get two files, downloaded together as a .zip:
<Name>.wsdlholds the messages, port types, bindings and service, and<Name>.xsdholds the types. The WSDL imports it withxsd:import.
To get one file with the types inline, set the layout option to single.
- Types. An object becomes an XSD
complexTypewith asequence, an enumeration asimpleTypewithenumerationvalues, aoneOf(or another union) acomplexTypewith anxs:choiceof its variants, and a map a list ofentryelements, each with akeyand avalue. A list repeats its element (maxOccurs="unbounded", or the schema'sminItems/maxItems). An optional or nullable field isminOccurs="0" nillable="true". Descriptions becomexs:annotationdocumentation. - Precision. Scalars keep their width:
integerisxs:int(xs:longwithformat: int64),numberisxs:double, a string withformat: date-timeisxs:dateTime, anddecimalstaysxs:decimal. - Rules.
minLength,maxLength,minimum,maximum, the exclusive bounds,patternandenumbecome XSD facets. A JSON Schema pattern is translated to XSD's dialect (^[A-Z]{3}$is written[A-Z]{3}, because an XSD pattern always matches the whole value). XSD has no facet formultipleOforuniqueItems, nor for a pattern that uses lookahead, lazy quantifiers or\b; those rules are not written, and the fidelity report lists each one as dropped. - Operations. Each operation becomes a SOAP operation with a request element named after it,
carrying its path, query and header parameters and its request body, a
<operation>Responseelement carrying the response body, and one element per error response (getPetByIdStatus404Fault). The HTTP method and path are not carried; the fidelity report says so for each operation. - Names. Names must be valid XML names:
GET /pets/{petId}is writtengetPetsPetId, and two names that end up the same get a number (firstName2). The fidelity report lists every rename. - Namespace. Every type and operation lives in the WSDL's target namespace: the item's own
namespace, or
http://example.com/servicewhen it has none (reported as synthesized).
An item imported from WSDL is written back as it was read: its messages, parts, bindings, SOAP versions and XSD details round-trip unchanged.
- Field numbers. WSDL has no field numbers, only element order. An item imported from WSDL or XSD numbers its fields by their order, which the export keeps, so nothing is reported. Real field numbers (from Protobuf or Thrift) are not written; the report lists each one.
- One-way operations. An operation with no reply is written with an
inputand nooutput. WSDL 1.1 has no message-exchange pattern, so importing the file again reads it as a request/response operation; the report says so for each one. WSDL 2.0 states the pattern, so a 2.0 export does not have this problem.
WSDL 2.0
Set Wsdl Version to 2.0 (the default is 1.1) to write the same types and operations as a
W3C WSDL 2.0 description. The files, the layouts and the XML Schema
are the same as for 1.1; only the description changes:
| WSDL 1.1 | WSDL 2.0 |
|---|---|
definitions with a name | description, which has no name |
xsd:import inside an xsd:schema in types | xsd:import directly in types (bundle), or the schema inline (single) |
message and part | No messages: each operation's input and output name their element |
portType | interface, with each fault declared once as an interface fault |
| No message-exchange pattern | pattern on each operation: in-out, in-only for an operation with no reply, robust-in-only when it also has faults, out-only for an imported WSDL notification |
soap:binding / soap12:binding with a transport | binding of type soap with wsoap:version (1.1 or 1.2) and wsoap:protocol; a soapAction is wsoap:action |
http:binding | binding of type http with whttp:methodDefault="POST" |
service and port | service (one interface each) and endpoint |
The fidelity report lists what WSDL 2.0 cannot say the way WSDL 1.1 did:
| What the item has | How 2.0 writes it | In the report |
|---|---|---|
| A message with several parts (imported from WSDL 1.1) | One element named after the message, with the parts as its children | Approximated |
The rpc binding style | Document/literal: 2.0 has no SOAP rpc style | Approximated |
A payload that is a built-in type (xsd:string) | An element of that type, named after the message (pingInput) or the fault | Approximated (info) |
| A WSDL 1.1 service whose ports bind different port types | One service per interface: the later ones are named <service><interface> | Approximated (info) |
| The item's name | Not written: a 2.0 description has no name, so importing the file again names the item after its first service | Approximated (info) |
| No operations at all (types only) | One empty interface named after the item, so the file imports again | Synthesized (info) |
An item imported from WSDL 2.0 has none of these to lose: it exports back unchanged.
What the fidelity report lists
For an item that is not XML already (OpenAPI, JSON Schema, GraphQL, Protobuf …), the report names each place where XML Schema cannot say what JSON says, on the type or field it concerns:
| What the source has | How it is written | In the report |
|---|---|---|
A union (oneOf, anyOf) | An xs:choice of child elements: a document wraps the value in the element of its alternative | Approximated |
| A union with no alternatives | An empty xs:choice, which no value matches | Dropped |
| A nullable field | nillable="true" minOccurs="0": XML tells an absent element from xsi:nil, JSON tells null from absent | Approximated (info) |
| Examples | Not written: XML Schema has no examples | Dropped (info) |
multipleOf, uniqueItems, a pattern XSD cannot express | Not written: XML Schema has no facet for them | Dropped |
An item imported from WSDL or XSD is XML already, so none of these is listed for it.
Where to find the WSDL card
In the Export dialog, the WSDL card is under REST & HTTP on the
Target step, marked multi-file. Its badge is lossy for a REST, RPC, GraphQL or JSON Schema
source (the HTTP method and path, field numbers and JSON-only rules are not carried) and lossless
for an item imported from WSDL. Pick the card and choose the Layout: bundle (the default, the
WSDL and its XSD) or single (the types inline), and the Wsdl Version: 1.1 (the default) or
2.0. The fidelity report on the card follows the version you pick. From the CLI, run
apiome export wsdl <item> --out <folder> (the files are unpacked into the folder) and add
--option layout=single for one file or --option wsdl_version=2.0 for WSDL 2.0. A lossy export
exits non-zero unless you add --force, and --json prints the tier. A public item's Export dialog on Browse offers WSDL too, as a .zip.
How a WSDL export is checked
Every WSDL export is checked before you can download it, the way it arrives once you unzip it:
- Packaged. The bundle holds exactly one WSDL, and every
xsd:import,xsd:includeandwsdl:importnames a file inside the.zip. A link to a web address or outside the folder fails. - WS-I. The description passes the WS-I Basic Profile checks: literal use, one binding style,
document/literal parts, unique operation signatures and
soapActions. - Valid. The WSDL validates against the WSDL 1.1 schema, every XSD type and facet is legal, and every message, part, port type, binding and port it names exists. A WSDL 2.0 export validates against the W3C WSDL 2.0 schema instead, and every element, fault, interface, binding and operation it names exists.
- Re-imports. The bundle imports into Apiome as a WSDL.
If a check fails, the export fails and lists each problem with its file and rule (wsi.literal-use,
wsdl.bundle-reference, wsdl.structure). An item imported from WSDL keeps its own bindings, so a
WS-I problem the original WSDL already had is not counted again; the item's lint report shows it.
JSON Schema from any source
When to export to JSON Schema
- Share the data types on their own. Any item — an OpenAPI or AsyncAPI API, a gRPC service, an Avro or Protobuf schema, a GraphQL schema — becomes a standalone JSON Schema of its types, for validation pipelines, Kafka JSON subjects, config contracts and database validators. Operations and channels are left out, and the card says so (types-only).
- Target an older validator. Pick
draft-07ordraft-04for a tool that does not read 2020-12; the fidelity report lists each keyword the older draft cannot carry. - Generate strict code. Pick the
jtdmode for a JSON Type Definition (RFC 8927) document thatjtd-codegenand ajv read. - Round-trip a JSON Schema item. An item imported from JSON Schema exports back lossless with the default options.
JSON Schema export at a glance
| Step | Where | Details |
|---|---|---|
Pick the JSON Schema card and its options (draft, packaging, $id base, mode) | Export dialog → JSON Schema (under Data schema & graph) | Options · Where to find the JSON Schema card |
| See how types, rules, enumerations and names are written | The fidelity report on the card | How the item is written |
| See what the draft you picked cannot carry | The fidelity report on the card, recomputed when you change Draft | What the fidelity report lists |
| Write a JSON Type Definition instead | Mode jtd | JSON Type Definition (JTD) mode |
Trust the schema: metaschema, $ref resolution, then re-import | Automatic before every download | How a JSON Schema export is checked |
| Export from the CLI | apiome export jsonschema <item> --out <file>.schema.json | Where to find the JSON Schema card |
How the item is written
Exporting to JSON Schema writes the item's data types as a standalone JSON Schema, whatever it
was imported from — for validation pipelines, schema registries and contract tests. By default you
get one draft 2020-12 document, <Name>.schema.json, with every type under $defs; the
document itself refers ($ref) to the type named after the item, when there is one.
- Types. Scalars become JSON types, keeping their width as a
format: a 32-bit integer is{"type": "integer", "format": "int32"}, a timestamp{"type": "string", "format": "date-time"}, bytes{"type": "string", "contentEncoding": "base64"}. A field that is not optional is listed inrequired; a list is anarray, a union aoneOf, a map an object withadditionalProperties. A type with no JSON form is written as{}(any value), and the fidelity report names it. - Rules.
minLength,maxLength,pattern,minimum,maximum, the exclusive bounds,multipleOfand the item counts are written as the same keywords. - Enumerations are written as their JSON values: names for an Avro or Protobuf enum (their JSON encodings carry the name), numbers only for an enum of numbers.
- Names. Each type is a
$defsentry named after it (Order); two types with the same name keep their full keys (v1.Pet,v2.Pet).
Options
- draft —
2020-12(default),draft-07ordraft-04. An older draft getsdefinitionsinstead of$defs, a$refwith other keywords beside it wrapped inallOf, and drops what it has no keyword for (deprecated; in draft-04 alsocontentEncodingandexamples). Draft-04 writes an exclusive bound asminimum/maximumwithexclusiveMinimum: trueand$idasid. - packaging —
bundle(default), orper-type: one<Type>.schema.jsonper type, which refer to each other by file name ({"$ref": "Line.schema.json"}), downloaded together as a.zipwith amanifest.json. - id_base — a base URI such as
https://example.com/schemas: each document's$idbecomeshttps://example.com/schemas/<file name>, so per-type files resolve each other wherever they are published. - mode —
json-schema(default), orjtdfor a JSON Type Definition document instead.
How a JSON Schema export is checked
Each export is checked before you download it:
- Every document validates against the metaschema of the draft it declares. A JTD document is checked against the RFC 8927 rules instead.
- Every
$refinto the export resolves: a#/$defs/…pointer must name a type in the document, and aper-typefile's reference must name another file of the export. A reference to a schema published elsewhere (an absolute URL outside the export) is not checked. - Every document imports again as a JSON Schema.
If a check fails, the export fails and names the file, the JSON pointer and the rule
(jsonschema.metaschema, jsonschema.unresolved-ref, jsonschema.reimport). An item imported from
JSON Schema is re-exported exactly as it was imported unless you pick another draft, per-type or
an id_base.
Operations and channels are left out: JSON Schema describes data only.
What the fidelity report lists
The fidelity report is computed for the options you pick, so changing draft in the export dialog updates it. It lists:
| In the source | In the JSON Schema export |
|---|---|
| Operations, services and channels | Dropped (critical). An item that has any also gets a types-only warning counting them — export it to OpenAPI or AsyncAPI as well to keep them |
| A document of another format | Approximated (note): written as JSON Schema, without what is specific to its format |
A type whose key has a namespace (com.example.Status) | Approximated (note): written as $defs/Status, and read back under that name |
A value with a format (date-time, int64, email …) | Approximated (note): format is an annotation — a validator checks it only when format assertion is switched on |
deprecated (draft-07 and draft-04) | Dropped |
prefixItems (draft-07 and draft-04) | Approximated: the tuple form of items, the other items as additionalItems |
unevaluatedProperties (draft-07 and draft-04) | Approximated as additionalProperties when nothing else applies beside it, else dropped |
$dynamicRef, $dynamicAnchor, $anchor, unevaluatedItems (draft-07 and draft-04) | Dropped |
An exclusive bound, const (draft-04) | Approximated (note): minimum with exclusiveMinimum: true, a one-value enum |
examples, contentEncoding, readOnly, if / then / else … (draft-04) | Dropped |
Each downgrade is listed on the type or field it happened in.
Where to find the JSON Schema card
In the Export dialog, the JSON Schema card is under Data schema &
graph on the Target step. Its badge is computed for the item: types-only for an item with
operations or channels (a REST API, a gRPC service), which the export leaves out, and lossless for
a JSON Schema item exported with the default options. Pick the card to set Draft, Packaging
and Mode. From the CLI, run apiome export jsonschema <item> --out <file> (json-schema works
too); add --option draft=draft-07, --option packaging=per-type --out <folder> (the files are
unpacked into the folder) or --option mode=jtd. A types-only export exits non-zero unless you add
--force, and --json prints the file written and its fidelity tier as JSON. A public item's
Export dialog on Browse offers the same target and downloads a per-type export as a .zip.
JSON Type Definition (JTD) mode
Set mode to jtd to get the same types as one JSON Type Definition
(RFC 8927) document, <Name>.jtd.json — the strict, code-generation-friendly sibling of JSON Schema
that ajv and the jtd-codegen tools read. draft, packaging and id_base do not apply: leave
them unset, or the export is refused.
- Types. Each type is a
definitionsentry, and the document refers (ref) to the type named after the item. A record lists its required fields underpropertiesand the others underoptionalProperties; a list iselements, a mapvalues, a string enumerationenum. - Scalars.
string,boolean,int32,float32andfloat64keep their JTD type; a timestamp istimestamp. A description is kept asmetadata.description. - Every exported document is checked against the schema rules of RFC 8927.
JTD states far less than JSON Schema, so the fidelity report lists every rule the document cannot carry, on the type or field it is in:
| In the source | In the JTD export |
|---|---|
pattern, minimum / maximum, the exclusive bounds, multipleOf, lengths, item counts, uniqueItems | Dropped |
A format other than date-time (uuid, email …), contentEncoding | Dropped: written as a plain string |
A 64-bit or unbounded integer (int64, integer) | Approximated: float64, which does not check that a value is whole or exact above 2^53 |
A union (oneOf), or a value of several types | Approximated: {} (any value) — JTD only unions records tagged with a discriminator |
| An enumeration of numbers | Approximated: only the values' type is checked |
title, deprecated, default, examples | Dropped (note) |
| Undeclared properties | Approximated (note): JTD rejects a property a record does not declare; the JSON Schema export allows it |
Kubernetes CRD from any source
Exporting to Kubernetes CRD writes a CustomResourceDefinition (apiextensions.k8s.io/v1) whose
openAPIV3Schema you can apply to a cluster. Platform teams use it to turn a JSON Schema (or any
other data schema) into a custom resource. Kubernetes only accepts a structural schema, so the
export does not paste the JSON Schema in as it is:
- No
$ref. Every named type is expanded where it is used. A type that refers back to itself (a cycle) cannot be expanded, so that member is written as a free-formtype: object. - One root. The type the kind option names (else the item's title, else its only type) is the
resource. If it is not shaped like a resource root, its fields are nested under
spec. - Structural rules. Every node declares a
type. A union (oneOf),uniqueItems, aformatKubernetes does not know,deprecated, and arequiredname with no property are not written. - Names. The group, kind, plural, scope and version options name the CRD
(
widgets.acme.io,Widget,v1alpha1). Without them, the export derives each one from the item and the fidelity report says so.
The fidelity report lists what the structural rules cost, on the type or field it concerns:
| In the source | In the report |
|---|---|
A reference cycle, a reference to a type the item does not declare, a null type, an enum mixing value types | Approximated: written as a free-form node |
| A root type that is not shaped like a resource | Approximated: nested under spec |
A union (oneOf / anyOf) | Dropped: a structural union may not declare a type |
uniqueItems, an unknown format, deprecated, a required name with no property | Dropped |
| Operations and channels | Dropped: the API server generates a CRD's endpoints |
Each export is checked before you download it:
- Apiome's structural-schema rules check every node the way the API server does.
- kubeconform checks the manifest against the
apiextensions.k8s.io/v1CustomResourceDefinitionschema, when the server has it. Each problem names its JSON path (/spec/names: missing property 'plural'). A kubeconform that is installed but cannot validate the manifest fails the export too. Without kubeconform, the structural rules decide.
To check the file yourself before you apply it, run kubeconform -strict -summary <file>.yaml, or
kubectl apply --dry-run=server -f <file>.yaml against a cluster.
XSD (XML Schema) on its own
Exporting to XSD writes just the data types as an XML Schema, without the WSDL around them — for
XML payloads, JAXB / JAXP code generation and standards that publish schemas (ISO 20022 — see the
ISO 20022 message profile — and UBL). The
types are written exactly as in a WSDL export (the section above; both exports share one mapping):
objects as complexType, a oneOf as xs:choice, a nullable field as nillable="true" minOccurs="0", a list as maxOccurs="unbounded", enums as xs:enumeration, and pattern,
minLength/maxLength and minimum/maximum as facets. Each object also gets a global element of
the same name, so a document can start with it.
When to export to XSD
- Give an XML pipeline its schema. Any REST, RPC, GraphQL, JSON Schema or WSDL item becomes a standalone XML Schema for validating XML payloads or generating JAXB / JAXP code. Operations and channels are left out (XSD describes data only), and the card says types-only.
- Round-trip an XSD. An item imported from XSD exports back lossless, with its own global elements, attributes, occurrences and enumerations.
- Serve an older XML toolchain. The same types as a RELAX NG grammar or a DTD, with mode.
- Publish a payments message. The types as an ISO 20022 message definition, with profile
iso20022. - Exchange business documents or e-invoices. The types as a UBL 2.1 document schema, with profile
ubl, or a Peppol BIS Billing 3.0 invoice or credit note, with profilepeppol.
Need the operations too? Export to WSDL: its schema is written by the same mapping, so the types come out the same in both.
XSD export at a glance
| Step | Where | Details |
|---|---|---|
| Pick the XSD card and its options (version, mode, profile) | Export dialog → Data schema & graph → XSD | Below, Where to find it |
| See how types, rules and names are written, and what XML Schema cannot say | The fidelity report on the card | The table below |
Write RELAX NG (.rng, .rnc) or a DTD (.dtd) instead | mode | RELAX NG and DTD output |
| Write an ISO 20022 message definition and its message catalog | profile iso20022 | ISO 20022 message profile |
| Write a UBL 2.1 document schema, or a Peppol BIS invoice or credit note | profile ubl or peppol | UBL and Peppol BIS profiles |
| Trust the export: XML, packaging, both XSD processors, re-import | Automatic before every download | The numbered checks below |
| Export from the CLI | apiome export xsd <item> --out <file>.xsd | Below, Where to find it |
| Download from a public item | Browse → Export | Below, Where to find it |
- Version. Set xsd_version to
1.0(the default) or1.1. An XSD 1.1 schema is markedvc:minVersion="1.1"and writesmultipleOf: 5as an assertion facet,<xsd:assertion test="$value mod 5 = 0"/>. XSD 1.0 has no facet formultipleOf, so the fidelity report lists it there. - Namespace. The schema's
targetNamespaceis the item's own namespace; an item without one gets a no-namespace schema, whose types are referenced by plain name. - Several namespaces. When the item's types live in different namespaces (URIs such as
http://example.com/common), you get one.xsdper namespace, downloaded together as a.zip:<Name>.xsdis the main schema,<Name>-common.xsdthe next, and each schemaxs:imports the others it uses. - Operations. XSD describes data only: operations and channels are left out. The fidelity report lists each one, and an item with operations carries a types-only advisory saying how many were left out — export it to WSDL, OpenAPI or AsyncAPI as well to keep them.
An item imported from XSD is written back with its own global elements, attributes, occurrences and enumeration values.
Each export is checked before you download it, the way it arrives once you unzip it:
- Every
.xsdis safe, well-formed XML, and everyxs:importandxs:includenames a file inside the export. A link to a web address or outside the folder fails. - The schema is built by an XML Schema processor. An XSD 1.0 export must build under both the 1.0 and the 1.1 processor; an XSD 1.1 export under the 1.1 processor. An unknown type, a broken facet or an XSD 1.1 construct in a 1.0 schema fails the export.
- The export imports again as an XSD.
A failed check names the file and the rule (xsd.bundle-reference, xsd.schema-1.0,
xsd.schema-1.1, xsd.reimport). An item imported from WSDL is also checked through the WSDL
import: its XSD export, put in place of the WSDL's own schema, imports back unchanged.
The fidelity report lists, construct by construct, what XML Schema cannot say the way the source does:
| In the source | In the XSD export |
|---|---|
| An operation or channel | Dropped (types-only), with the advisory above |
A free-form object (additionalProperties: {} or {type: object}, with no properties) | Approximated: xs:any — any child elements, named by their keys |
| A map with typed values | Approximated: a list of entry elements, each with a key and a value |
A oneOf (or another union) | Approximated: an xs:choice of child elements, so a document wraps the value in the element of its alternative |
| A union with no alternatives | Dropped: an empty complexType |
| A nullable value | Approximated (note): nillable="true" minOccurs="0" — XML tells an absent element from one marked xsi:nil, JSON tells null from absent, and either form is accepted |
| A property's examples | Approximated (note): kept as <xsd:documentation source="example">, which a validator ignores |
| Properties of a non-XSD item | Synthesized (note): each is written as a child element, not an attribute |
multipleOf (XSD 1.0), uniqueItems, a pattern XSD cannot express | Dropped: the rule is not written |
| A deprecated property | Dropped (note): XSD has no deprecation marker |
A name that is not an XML name (first name) | Approximated (note): firstName |
RELAX NG and DTD output
Some XML tool chains — DocBook-era publishing, configuration formats — read RELAX NG or a DTD rather than an XML Schema. Set mode to write the same types in one of them instead:
| mode | You get | Keeps |
|---|---|---|
xsd (default) | XML Schema, as above | Everything in the table above |
relaxng | One RELAX NG grammar in the XML syntax, <Name>.rng | Types, facets and namespaces |
relaxng-compact | The same grammar in the compact syntax, <Name>.rnc | The same as relaxng |
dtd | One DTD, <Name>.dtd | Element names and content models only |
Each mode writes one file, even for an item whose types live in several namespaces, and is written from
the same XML mapping as the XSD export, so element names, occurrences, choices and entry lists are the
same in every mode. xsd_version applies to xsd only; set with another mode, the export is refused.
- RELAX NG. Each type is a
define; each global element is adefine(Pet.element) thatstartchooses from. Occurrence isoptional,zeroOrMoreoroneOrMore. Facets are datatype parameters of the XML Schema datatype library —xsd:string { minLength = "1" maxLength = "40" }— and an enumeration is a choice of values. The main namespace is the grammar's; an element of another namespace names its own (namespace ns1 = "…"in the compact syntax). Descriptions area:documentation, or##comments in the compact syntax. - DTD. A record is a content model —
<!ELEMENT Pet (id?, name?, tags*, owner?)>— a choice is(email | phone), a value is(#PCDATA)and free-form content isANY. The first global element is named in aRoot elementcomment. An element of a namespace declares it as a fixed attribute (xmlns CDATA #FIXED "…"), so a document is valid with a default namespace and no prefixes. An XSD attribute stays an attribute (CDATA, or the list of its values when they are plain names).
The fidelity report is computed for the mode you pick, and lists, construct by construct:
| In the source | relaxng / relaxng-compact | dtd |
|---|---|---|
A value's type (int, date-time, decimal …) | Kept | Dropped: any text is valid |
Facets: pattern, lengths, bounds | Kept | Dropped |
| An enumeration | Kept | Dropped for element content; kept for an attribute of plain names |
A repeat count other than 0–1, 0 or more, 1 or more (minItems: 2, maxItems: 5) | Approximated: zero or more, or one or more | Approximated: the same |
| A default value on an element | Dropped | Dropped |
| A nullable value | Approximated (note): optional, so null and absent read the same | Approximated (note): the same |
| A property's examples | Dropped (note) | Dropped (note) |
| Two elements of one name with different content | Kept: each where it is | Approximated: declared once, as ANY |
| Namespaces | Kept | Approximated (note): a #FIXED xmlns attribute per element |
The other rows of the XSD table — operations and channels, unions, maps, renamed names — apply to these modes too.
Each RELAX NG or DTD export is checked before you download it:
- A RELAX NG grammar is checked with jing when the server has it (
jing, orjing -cfor the compact syntax): it must parse, everyrefmust have adefine, and every datatype and parameter must exist. Each error names its file, line and column (relaxng.schema). - The file is read by Apiome's RELAX NG or DTD reader (
relaxng.parse,dtd.parse); a.rngmust also be safe, well-formed XML (relaxng.xml). Without jing, this is the check. - The export imports again as RELAX NG or as a DTD (
relaxng.reimport,dtd.reimport). Its round trip is measured through that import.
ISO 20022 message profile
Banks and payment schemes exchange ISO 20022 messages (pain.001 credit transfers, pacs.008
interbank payments, camt.053 statements), and each message is published as an XML Schema with strict
conventions. Set profile to iso20022 to write the item's types as such a message definition
instead of a plain XSD:
| Convention | What the export writes |
|---|---|
| Message identifier | <business area>.<message number>.<variant>.<version>, for example pain.001.001.09, from message_identifier. An item imported from ISO 20022 keeps its own. |
| Namespace and file | One namespace, urn:iso:std:iso:20022:tech:xsd:pain.001.001.09, in pain.001.001.09.xsd. Types from other namespaces are written in it. |
| Root element | One global element, Document. Its type wraps the business element: the message type (message_type, otherwise the one object no other object uses) as an element named after it, for example CustomerCreditTransferInitiation for CustomerCreditTransferInitiationV09. |
| Names | Every type and element name is UpperCamelCase, ASCII letters and digits only: customer_id becomes CustomerId, debtor-name becomes DebtorName. An item imported from ISO 20022 keeps the standard's names (GrpHdr, MsgId). |
| Documentation | Each type's and property's description is its xs:documentation. Document is documented with the message it carries. |
| Message catalog | message-catalog.json, beside the schema, lists the message: its identifier, business area, message number, variant and version, namespace, schema file, root and business elements, and its message components and data types. |
The schema and the catalog download together as a .zip. An upload of the schema is recognized as an
ISO 20022 message definition, with its message id.
The profile has three options of its own, all optional:
- message_identifier — the message, for example
pain.001.001.09. It must have thexxxx.nnn.nnn.nnshape. - business_area — four letters, such as
pain,pacsorcamt. Used when there is no message_identifier; when both are set they must agree. - message_type — the object
Documentwraps, by name. An unknown name is refused.
The profile writes XML Schema only: with mode set to relaxng, relaxng-compact or dtd, the export
is refused. xsd_version 1.1 is allowed.
The fidelity report lists what the item could not meet of the conventions, at the top of the report or on the property concerned:
| When | The report says |
|---|---|
| The item names no message identifier | Synthesized: the export uses a placeholder, xxxx.001.001.01 (or pacs.001.001.01 with business_area pacs). Set message_identifier to name the message. |
The item has no Document of its own | Synthesized (note): the export adds the Document root around the business element |
A name has nothing an ISO 20022 name can keep (名前) | Synthesized: the export invents one (Field) |
A name has characters ISO 20022 names cannot hold (größe, 2xx) | Approximated: the closest name (Groe, X2xx) |
A name only needs a different case or no separators (customer_id) | Approximated (note): CustomerId |
| Several objects could be the message | Approximated: the first is used. Set message_type to choose another. |
| Types come from another namespace | Approximated: they are written in the message's namespace |
| The item has no object at all | Dropped: Document wraps nothing |
Each ISO 20022 export is checked like any XSD export (above), and also:
message-catalog.jsonis JSON with one message, naming the export's schema file and itstargetNamespace(xsd.iso20022-catalog).- The schema imports again as an ISO 20022 message definition, and its round trip is measured through that import.
To try it, export an item to XSD with profile iso20022 and message_identifier
pain.001.001.09, or export the sample apiome-ui/examples/iso20022/07-pain.001.001.09-message-definition.xsd
after importing it, with no options.
UBL and Peppol BIS profiles
Business documents — orders, invoices, despatch advice — are exchanged as OASIS UBL (Universal Business
Language), and EU e-invoicing runs on Peppol BIS Billing 3.0, whose invoices and credit notes are UBL 2.1
documents. Set profile to ubl to write the item's types as a UBL 2.1 document schema, or to peppol for
the same with the Peppol BIS conventions applied.
| Convention | What the export writes |
|---|---|
| UBL data types | Every value is typed by a UBL data type: udt:TextType, udt:CodeType (an enumeration), udt:IdentifierType (an ID or UUID), udt:NameType, udt:AmountType (a decimal named like an amount, price or total), udt:NumericType, udt:IndicatorType (a boolean), udt:DateType, udt:TimeType, udt:DateTimeType, udt:BinaryObjectType. |
| UBL components | A value whose name and data type match a UBL basic component is a reference to it — issueDate is cbc:IssueDate, totalAmount cbc:TotalAmount, note cbc:Note — so the schema reuses UBL's own definitions. |
| UBL names | UpperCamelCase, each value ending with its representation term: status (an enumeration) is StatusCode, paid PaidIndicator, orderId OrderID. An object is an aggregate type, <Name>Type. |
| The document | One global element, the document (ubl_document: Invoice, Order …), whose type is the document object headed by cbc:UBLVersionID, cbc:CustomizationID and cbc:ProfileID. |
| Namespace | The document's own namespace (ubl_namespace, by default urn:apiome:names:specification:ubl:schema:xsd:<Document>-2); the OASIS namespaces belong to the OASIS documents. |
| Rules | UBL data types carry no facets or code lists, so a maxLength, a pattern or an enumeration's codes are written as documentation. An optional value is left out when absent (UBL has no nil). |
The UBL schemas ship with it. The export is a .zip: <Document>.xsd, the OASIS UBL 2.1 schemas it
imports (common/UBL-CommonBasicComponents-2.1.xsd, UBL-UnqualifiedDataTypes-2.1.xsd,
UBL-QualifiedDataTypes-2.1.xsd and UN/CEFACT's CCTS_CCT_SchemaModule-2.1.xsd, unmodified), their
NOTICE.md, and a guide, <Document>.ubl-guide.md, listing the header and every value with its UBL type,
cardinality and source. Everything a receiver needs to validate documents is in the one download.
Peppol BIS Billing 3.0 (peppol) applies its conventions on top:
- The document is an
Invoice(the default) or aCreditNote. cbc:CustomizationIDandcbc:ProfileIDare mandatory, and documented with the BIS values (urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0andurn:fdc:peppol.eu:2017:poacc:billing:01:1.0).cbc:ID,cbc:IssueDate, the type code (cbc:InvoiceTypeCodeorcbc:CreditNoteTypeCode) andcbc:DocumentCurrencyCodeare mandatory, right after the header. The item's own values are used when it has them (a field namedissueDateof type date iscbc:IssueDate); any it lacks are added.
Peppol also publishes Schematron business rules (EN 16931 and the Peppol rules). The export does not run them: it applies the document, header and mandatory-component conventions above. Validate the invoices themselves with the Peppol validation artifacts too; the guide says so.
The profile options, all optional:
- ubl_document — the document element, in UpperCamelCase. By default an imported UBL item's own document,
else
Invoicefor Peppol, else the item's name. Peppol takesInvoiceorCreditNoteonly. - ubl_namespace — the schema's target namespace, a URI.
- document_record — the object the document is made from, by name. By default the one object no other object uses; an unknown name is refused.
Both profiles write XML Schema only: with mode set to relaxng, relaxng-compact or dtd, the export is
refused.
The fidelity report lists what the item could not meet of the conventions:
| When | The report says |
|---|---|
| Always | Synthesized (note): the document element and its UBL header |
| Peppol, and the item has no value for a mandatory component | Synthesized: the component the export adds, such as cbc:InvoiceTypeCode |
A maxLength, pattern or bounds; an enumeration's codes | Approximated: written as documentation, which nothing checks |
A name that needs a representation term or another case (status → StatusCode) | Approximated (note) |
| Several objects could be the document | Approximated: the first is used. Set document_record to choose another. |
| Types from another namespace | Approximated: written in the document's namespace |
Each UBL or Peppol export is checked like any XSD export (above): the document schema is built by an XML Schema processor against the shipped OASIS UBL 2.1 schemas, reading only the export's own files. Also:
- Every shipped
common/schema is the OASIS file, byte for byte (ubl.bundled-schemas), andNOTICE.mdis there (ubl.notice). - A Peppol export meets the conventions above (
ubl.peppol): anInvoiceorCreditNote, a mandatorycbc:CustomizationIDandcbc:ProfileIDwith the BIS values, and the four mandatory components. - The schema imports again as an XSD item.
To try it, export an item to XSD with profile peppol, or import the sample
apiome-ui/examples/xsd/07-ubl-2.1-invoice-set and export it with profile ubl.
Where to find it. In the Export dialog, the XSD card is under Data schema & graph on the
Target step. Its badge is lossless for an item imported from XSD and types-only for any
other source (XSD keeps the types and leaves out the operations). Pick the card to see its options:
Xsd Version (1.0 by default, or 1.1), Include Xml Declaration and Include Comments (both
on by default), Mode (xsd by default; relaxng, relaxng-compact or dtd), Profile
(generic by default, iso20022, ubl or peppol), the ISO 20022 profile's Message Identifier,
Business Area and Message Type, and the UBL profiles' Ubl Document, Ubl Namespace and
Document Record. From the CLI, run apiome export xsd <item> --out <file>.xsd, and add
--option xsd_version=1.1, --option include_xml_declaration=false, --option mode=dtd --out <file>.dtd
--option profile=iso20022 --option message_identifier=pain.001.001.09 --out <file>.zip or
--option profile=peppol --option ubl_document=CreditNote --out <file>.zip. A types-only
export exits non-zero unless you add --force, and --json prints the tier. A public item's Export
dialog on Browse offers XSD too: the .xsd file, or a .zip when the item spans several namespaces or
uses the ISO 20022, UBL or Peppol profile.
ASN.1 from any source
When to export to ASN.1
- Hand the data types to an ASN.1 tool chain. Any item — an OpenAPI or AsyncAPI API, a JSON Schema, a gRPC or Avro schema — becomes one X.680 module of its types for telecom (5G, NAS), LDAP, PKI and aviation protocols. Operations and channels are left out, and the card says so (types-only).
- Keep the rules enforceable. Lengths, bounds, item counts and simple patterns become ASN.1
subtype constraints, so
asn1toolschecks them when it encodes. What ASN.1 cannot carry is listed in the fidelity report before you download. - Round-trip an ASN.1 item. An item imported from ASN.1 exports lossless, back to an equivalent module.
ASN.1 export at a glance
| Step | Where | Details |
|---|---|---|
| Pick the ASN.1 card and its options (module name, OID, automatic tags, comments) | Export dialog → ASN.1 (under Data schema & graph) | Options · Where to find the ASN.1 card |
| See how types, scalars, optional fields and names are written | The fidelity report on the card | How the item is written |
| See how each rule becomes subtype notation | The fidelity report on the card | How constraints are written |
| See what ASN.1 cannot carry | The fidelity report on the card | What the fidelity report lists |
Trust the module: asn1tools parses and compiles it | Automatic before every download | How an ASN.1 export is checked |
| Export from the CLI | apiome export asn1 <item> --out <file>.asn1 | Where to find the ASN.1 card |
How the item is written
Exporting to ASN.1 writes the item's data types as one ITU-T X.680 module, <Module>.asn1,
for telecom, PKI and aviation tool chains. The module compiles with asn1tools. Operations and
channels are left out: an ASN.1 module describes data only.
- Types. Objects become
SEQUENCEs, unionsCHOICEs (one alternative per member type), enumsENUMERATED(numbered when every value is a distinct integer), and listsSEQUENCE OF. A map becomesSEQUENCE OF SEQUENCE { key …, value … }, because ASN.1 has no map type. - Scalars. Text is
UTF8String, bytesOCTET STRING, a timestampGeneralizedTime, a dateDATE, a timeTIME-OF-DAY, a realREAL. A sized integer keeps its width as a range:uint8isINTEGER (0..255),int32INTEGER (-2147483648..2147483647). - Optional fields. A field with a default is written
DEFAULT <value>(TRUE,3,"hi", or an enum item); any other field that may be left out isOPTIONAL. - Names. Type names start with a capital letter and field and enum names with a small one, using
hyphens between words:
order_idis writtenorder-id,OPENisopen, and a type named like a reserved word (END) gets-Type. Each rename is in the fidelity report, and a clash gets a number (line-no-2). - Descriptions are written as
--comments. An ASN.1 import does not read comments, so the report notes each one.
How constraints are written
Constraints are kept as ASN.1 subtype notation, so a validator such as asn1tools checks them when
encoding:
| In the source | In the ASN.1 export |
|---|---|
minLength / maxLength | UTF8String (SIZE (3..20)), also on OCTET STRING |
minItems / maxItems | SEQUENCE (SIZE (1..50)) OF … (other rules on a list apply to its items) |
minimum / maximum | A value range, INTEGER (1..100), within the integer's width |
| An exclusive bound on an integer | The same range, inclusive: > 0 is written 1.. |
| An exclusive bound on a real | Approximated: written inclusive, because asn1tools cannot read < |
An enum of integers | A value set, INTEGER (1 | 2 | 5) |
A pattern that only lists the allowed characters, anchored at both ends (^[A-Z0-9_]{3,8}$, ^\d{4}$) | A permitted alphabet with its length: UTF8String (SIZE (3..8)) (FROM ("A".."Z" | "0".."9" | "_")) |
Any other pattern (^[A-Z]{3}-\d+$) | A -- pattern: … comment above the field — asn1tools does not check it |
multipleOf, uniqueItems, an enum of strings, formats such as email | Dropped, and listed in the report |
Options
- module_name — the module name, such as
Shop-Orders. By default it is the imported module's name, else the item's namespace when that is already a valid module name, else the item's name. - oid — the module's object identifier, dotted (
1.3.6.1.4.1.99999.1) or as arcs in braces ({ iso(1) identified-organization(3) 6 }). It is written after the module name. - automatic_tags — on by default (
AUTOMATIC TAGS). Turn it off to keep an imported module's own tagging. - include_comments — on by default; turn it off to leave out the header, description and pattern comments.
An item imported from ASN.1 exports back to an equivalent module that reads back unchanged, built-in
types such as OBJECT IDENTIFIER and PrintableString included. A type the module imports from
another module has no definition to write, so it is written as UTF8String and listed in the report.
What the fidelity report lists
The fidelity report lists, on each type or field:
| In the source | In the report |
|---|---|
| Operations, services and channels | Dropped (critical). An item that has any also gets a types-only warning counting them — export it to OpenAPI or AsyncAPI as well to keep them |
| A rule written as subtype notation (lengths, bounds, item counts, a set of integers) | Carried, naming the notation used (minLength/maxLength → SIZE) |
| A pattern written as a permitted alphabet | Approximated (note) |
Any other pattern, multipleOf, uniqueItems, a set of strings, a default with no ASN.1 value | Dropped |
| An exclusive bound on a real, a map, a type with no ASN.1 form | Approximated |
A name respelled to the ASN.1 rules (order_id → order-id) | Synthesized (note) |
A type that refers to itself (Node.next: Node) | Carried |
| A description, a document of another format, types read back under the module name | Approximated (note) |
How an ASN.1 export is checked
Each export is checked with asn1tools before you download it:
- The module parses. A syntax error fails the export and names its line and column
(
asn1.parse). - The module compiles: every type it uses is defined, and every constraint is valid
(
asn1.compile). - It is one module (
asn1.module-count), and it defines exactly the types Apiome planned to write for the item: a planned type that is missing (asn1.missing-type) or an extra one (asn1.unexpected-type) fails the export.
A failed check fails the export job and lists each problem with its rule.
Where to find the ASN.1 card
In the Export dialog, the ASN.1 card is under Data schema & graph on
the Target step, as one file. Its badge is lossless for an item imported from ASN.1 and
types-only for any other source (ASN.1 keeps the types and leaves out the operations). Pick the
card to see its four options: Module Name, Oid, Automatic Tags and Include Comments.
For example, an OpenAPI string with minLength: 8, maxLength: 16 is written
UTF8String (SIZE (8..16)), a pattern such as ^[A-Z]+$ adds (FROM ("A".."Z")), an integer
with minimum: 1, maximum: 65535 is INTEGER (1..65535), and a oneOf is a CHOICE. From the
CLI, run apiome export asn1 <item> --out <file>.asn1, and add --option module_name=Acme-Pets or
--option oid=1.3.6.1.4.1.99999.1. A types-only export exits non-zero unless you add --force, and
--json prints the tier. A public item's Export dialog on Browse offers ASN.1 too, as the .asn1
file.
Legacy REST descriptors
Before OpenAPI, two formats described REST APIs, and older toolchains still read them: WADL, the XML description Java (JAX-RS) stacks and some API gateways import, and Google API Discovery, the JSON document Google's API client libraries build a client from. Apiome writes both from any item, and an item imported from either exports back lossless. In Export studio, both cards sit under REST & HTTP on the Target step.
When to use which
- A JAX-RS stack, a gateway or a tool that imports WADL: WADL. Export WADL
for the resource tree, methods, parameters and status codes, with the types in an XSD grammar — the
same XSD a WSDL export writes. It downloads as a
.wadland its.xsdin a.zip, or as one file. - A client built by Google's API client libraries: Google API Discovery. Export
Google API Discovery for one JSON document of resources,
methods, path and query parameters and schemas, with method ids such as
petstore.pets.listPets. - Anything new: OpenAPI. Neither format is developed any more; prefer OpenAPI unless the consumer reads only WADL or Discovery.
Both describe HTTP resources and nothing else. A GraphQL, gRPC, event or data-schema item exports at most its types, and its fidelity report starts with WADL captures REST only or Google API Discovery captures REST only.
Legacy REST descriptors at a glance
| WADL | Google API Discovery | |
|---|---|---|
| From | Any source | Any source with an HTTP operation or a type |
| You get | <Name>.wadl and <Name>.xsd in a .zip, or one .wadl | <name>.discovery.json |
| Options | layout (bundle, single) | name, version |
| Types become | An XSD grammar, with facets for constraints | Discovery's JSON Schema subset (64-bit integers as strings) |
| Parameters | Path, query and header | Path and query |
| Responses | Every response, by status code | The success body only |
| Checked by | The W3C WADL schema, an XML Schema processor, and re-import | The Discovery metaschema, Discovery's rules, and re-import |
| CLI | apiome export wadl | apiome export discovery |
Every parameter, response, server and keyword an export cannot carry is listed in its fidelity report before you download.
WADL from any source
Exporting to WADL writes a description that validates against the W3C WADL schema, with its
types in an XSD grammar. By default you get two files, downloaded together as a .zip:
<Name>.wadlholds the resources and methods, and<Name>.xsdholds the grammar. The WADL links it with<grammars><include href="…"/>.
To get one file with the grammar inline, set the layout option to single. A model with no types
and no request or response bodies has no grammar, so you get the .wadl alone.
- Resources. Each path segment becomes a
resource, nested the way the paths are (/pets/{petId}ispetsholding{petId}); an operation on/gets<resource path="/">. - Methods. Each operation is a
methodwith its HTTP verb, its description asdoc, and its operation name asidwhen the source names it. - Parameters. Path parameters are
templateparams on the resource that names them; query and header parameters are request params, with their XSD type (xsd:longfor a 64-bit integer),required,defaultand documentation. An array is arepeatingparam. - Bodies. The request body and every response carry a
representationwith the body's media type and the grammar element of its type. A list or scalar body gets an element of its own in the grammar (getPetsResponse200). Each response keeps its status code. - Types. The grammar is the same XSD a WSDL export writes (see the section above): types keep
their precision, optional fields are
minOccurs="0", and constraints become facets.
WADL describes HTTP resources and nothing else, so the fidelity report lists what it cannot carry:
- operations with no HTTP method and path (from gRPC, GraphQL or WSDL sources), and event operations;
- cookie parameters, and status ranges such as
4XX; - every server but the first;
- the grouping into services, the version and the description;
- gateway details such as routes, backends and hosts.
When the source has no server, the base URI https://api.example.com/ is used, and the report says so.
An item imported from WADL is written back as it was read. Import now also reads a WADL root written
as <wadl:application>, the query and header params a method's request declares, and — when you
upload the WADL together with its .xsd in a .zip — the grammar it includes.
WADL captures REST only. A GraphQL, gRPC, event or data-schema item gets a warning at the top of its fidelity report: WADL captures REST only. The warning counts the operations and channels that are not written, and it is critical when no operation can be written, so only the item's types are exported.
Checked before you download it. Every WADL export is checked as it will be unpacked, and the job fails, listing every problem with its file and rule, when:
- A file is not safe, well-formed XML (
wadl.xml) — a DTD or entity is refused. - The description does not validate against the W3C WADL schema (
wadl.schema): an element or attribute WADL does not have, or a type that is not a declared QName. - The grammar is missing or does not build:
<grammars><include>names a file that is not in the export (wadl.bundle-reference), or an XML Schema processor rejects the grammar, included or inline (wadl.grammar). - A representation names an element the grammar does not declare (
wadl.representation). - Apiome's WADL importer cannot read the export back (
wadl.reimport).
Where to find it. In the Export dialog, pick the WADL card on the Target step (in Export
studio it is under REST & HTTP), marked multi-file. A REST item is badged lossy, and an item
imported from WADL exports back lossless. Pick the Layout: bundle (the default) downloads the
.wadl and its .xsd grammar as a .zip, and single writes one .wadl with the grammar inline. From
the CLI, run apiome export wadl <item> --out <folder>, and add --option layout=single for one file. A
public item's Export dialog on Browse offers WADL too.
Google API Discovery from any source
Google's API client libraries and generated clients are built from Discovery documents: one JSON
description of an API's resources, methods, parameters and schemas. Exporting to Google API
Discovery writes the item as one, <name>.discovery.json. It follows the Discovery format's own
metaschema, and Google's API client library for Python builds a working client from it, with a call for
every method.
- Document.
kinddiscovery#restDescription, the API'sname(lower-case letters and digits, made from the item's name: Pet Store ispetstore), itsversion(the item's, elsev1),id<name>:<version>, the title and description. The first server givesrootUrl(scheme and host) andservicePath(its path,api/v1/); server variables take their defaults. Set the name and version options to choose others. - Resources and methods. An operation is filed under the resource its path starts with
(
/pets/{petId}is inpets) and named after its operation name (listPets); an operation whose path starts with a parameter is a top-level method. Each method has anid(petstore.pets.listPets), apathrelative toservicePath, its HTTP verb and description. - Parameters. Path and query parameters, with their type,
required,default,enum,pattern,minimumandmaximum. A list is arepeatedparameter. A path parameter is always required, and the required parameters are listed inparameterOrder, path ones first. - Bodies. The request and the success response are
$refs to schemas. A body that is not one named type (a list, a scalar, an inline schema) gets a schema of its own,ListPetsResponse. - Schemas. Each type, in Discovery's JSON Schema subset, through the same draft-04 mapping as a
JSON Schema export. A required field is marked
required: true, anddeprecatedis kept.
| In the source | In the Discovery document |
|---|---|
| A 32-bit or unsized integer | integer, format: int32 |
| A 64-bit integer | string, format: int64: Discovery sends 64-bit integers as strings |
| A float or a double (a decimal too) | number, format: float or double |
| Base64 bytes, a date, a date-time | string, format: byte, date or date-time |
| An enum | string with enum, and each value's description in enumDescriptions |
| A map | object with additionalProperties |
| A union, or a type that may be several | type: any, its alternatives named in the description |
An item imported from Discovery keeps its name, resource tree, method names and ids, and its parameters'
values, so it reads back unchanged. When its baseUrl leaves out its servicePath, the export writes the
full baseUrl, and the report says so.
The fidelity report lists what a Discovery document cannot carry:
- operations with no HTTP method and path (from gRPC, GraphQL or WSDL sources), event operations and channels;
- header and cookie parameters: Discovery parameters go in the path or the query;
- every response but the success body (a Discovery method has one response; errors are Google's standard error), and every server but the first;
- schema keywords Discovery has no place for: lengths, list sizes,
multipleOf, closed objects, non-string enums, object defaults and string formats other thanbyte,dateanddate-time; - what it changes: nullable types written as their type, exclusive bounds written inclusive, renamed path parameters, and 64-bit integers as strings;
- how it reads back: services become one API named after the title, an operation is named by its method
id and keyed by its full path (
servicePathincluded), andrequired: trueis a hint Discovery clients do not enforce, so a required field reads back optional.
A source with no HTTP operation and no type has nothing a Discovery document can hold, so the card is greyed out for it.
Google API Discovery captures REST only. A GraphQL, gRPC, event or data-schema item gets a warning at the top of its fidelity report: Google API Discovery captures REST only. The warning counts the operations and channels that are not written, and it is critical when only the item's types are exported.
Checked before you download it. Every Discovery export is checked, and the job fails, listing every problem with its JSON pointer and rule, when:
- The document does not validate against the Discovery metaschema (
discovery.schema): a missingkind,name,version,rootUrlorservicePath, a parameter with notypeorlocation, alocationother thanpathorquery, or a lower-case HTTP method. - The URLs disagree (
discovery.urls):rootUrlis not an absolute URL ending in/,servicePathstarts with/, orbaseUrlis notrootUrl+servicePath. - A schema is wrong: its
idis not its key (discovery.schema-id), a$refnames no schema of the document (discovery.ref), or atype/formatpair is not one of Discovery's (discovery.type-format). - A method is wrong: its id is used twice (
discovery.method-id), its path names a variable that is not a required path parameter, or a path parameter is not in its path (discovery.path-parameter), orparameterOrderlists an undeclared parameter (discovery.parameter-order). - Apiome's Discovery importer cannot read the document back (
discovery.reimport).
When the source has no server, https://api.example.com/ is used, and the report says so.
Where to find it. In the Export dialog, pick the Google API Discovery card on the Target
step (in Export studio it is under REST & HTTP). A REST item is badged lossy, and an item
imported from Discovery exports back lossless. Leave Name and Version empty for the item's own
(else a name made from the item's name, and v1), or type others (pets, v2). From the CLI, run
apiome export discovery <item> --out petstore.discovery.json, and add --option name=pets or
--option version=v2. A public item's Export dialog on Browse offers the document too.
RAML from any source
When to export to RAML
- Supply a tool that still reads RAML. A REST item is written as one RAML 1.0 document with its resources, methods, types and facets. RAML is no longer actively developed, so prefer OpenAPI for new work; the fidelity report lists what RAML cannot carry before you download.
- Round-trip a RAML item. An item imported from RAML exports back lossless, with its resource types and traits already applied to each method.
RAML describes REST APIs only. A GraphQL, gRPC, event or data-schema item exports at most its types, and its report starts with RAML captures REST only.
RAML export at a glance
| Step | Where | Details |
|---|---|---|
| Pick the RAML card and its options | Export dialog → REST & HTTP → RAML | Where to find the RAML card |
| See how the document, types and resources are written | The fidelity report on the card | How the item is written |
| See what RAML cannot carry | The fidelity report on the card | What the fidelity report lists |
| Trust the file: AMF validation and re-import | Automatic before every download | How a RAML export is checked |
| Export from the CLI | apiome export raml <item> --out <file>.raml | Where to find the RAML card |
Exporting to RAML writes one <Name>.raml file in RAML 1.0, starting with the #%RAML 1.0 header
line that RAML tools require.
How the item is written
- Document. The item's title, description and version, its first server as
baseUri(server variables becomebaseUriParameters), and amediaType: a RAML item keeps its own; otherwise it is the media type the bodies use most, orapplication/json. Set the media_type option to choose another default. - Types. Objects keep their fields in order, and an optional field is written
name?. Enums arestringtypes withenum, unions areCat | Dog, and maps are objects with a//property. Numbers keep their width (integerwithformat: int64) and dates their type (datetime,date-only). Lengths, ranges, patterns, list sizes, enums and defaults become RAML facets. - Resources. Each path is one resource (
/pets/{petId}), with its path parameters asuriParameters. Each operation is a method with its operation name asdisplayName(when the source names it), its description, query parameters, headers and body, and its responses by status code with their description, headers and body.
What the fidelity report lists
RAML describes REST APIs only. An item from GraphQL, gRPC, an event or data-schema format, or an agent descriptor gets a warning at the top of its fidelity report: RAML captures REST only. The warning counts the operations and channels that are not written. It is critical when no operation can be written and only the item's types are exported.
The fidelity report lists what RAML cannot carry:
- operations with no HTTP method and path (from gRPC, GraphQL or WSDL sources), a
TRACEorCONNECTmethod, event operations and channels, and a second operation on the same method and path; - cookie parameters, and status ranges such as
4XX; - every server but the first, and the grouping into services;
- exclusive bounds, string formats RAML has no type for (
email,uuid), and a facet the type does not allow; - deprecation flags, tags, and source details such as gateway routes — on the document, an operation, a parameter or a type;
- renamed types: RAML type names cannot contain dots or spaces, so
com.acme.Orderis writtenOrder(orOrder2when the name is taken). The report drops the type under its old key and adds it under the new name, which is how it reads back; - services: a RAML document is one API, so the item's services are dropped and it reads back as one service named after the title;
- field numbers: RAML keeps the order of an object's properties but not their numbers, so the properties read back numbered by position.
An item imported from RAML is written back as it was read. Its resource types and traits are already
applied to each method when it is imported, so the export writes the methods in full, without type:
or is:, and the report says so.
How a RAML export is checked
Each export is checked before you download it:
- AMF validates it against RAML 1.0 when the server has the AMF toolchain. A violation fails the
export and names its rule, line and column (
example-validation-error); warnings do not. Without AMF, the RAML importer reads the document instead, and a parse error fails the export. - The document is then imported again. If it does not import, the export fails (
raml.reimport).
An item imported from RAML exports and re-imports unchanged. From any other source, the re-import
shows what RAML could not keep, and the fidelity report names each of those changes. One change is not
in the report: Apiome's RAML reader does not read displayName, so an operation's name reads back as
its method and path (DELETE /reindex).
Where to find the RAML card
In the Export dialog, the RAML card is under REST & HTTP on the
Target step, as one file. Its badge is lossless for an item imported from RAML and lossy
for any other source. A GraphQL, RPC or data-schema item's fidelity report, on the Fidelity step,
starts with RAML captures REST only. Pick the card to see its two options: Include Comments (on
by default) writes the generated-file comment under the #%RAML 1.0 line, and Media Type
(application/json by default) is the document mediaType when the item names none. From the CLI,
run apiome export raml <item> --out <file>.raml, and add --option include_comments=false or
--option media_type=application/xml. The CLI prints the report's warnings, the REST-only one
included. A lossy export exits non-zero unless you add --force, and --json prints the tier. A
public item's Export dialog on Browse offers RAML too, as the .raml file.
Arazzo from any source
Arazzo describes workflows: sequences of API calls. It is not a description of the API itself, so exporting a plain REST, RPC or event API to Arazzo gives you only the sequencing Apiome can make of it. The fidelity report warns about this first: this target captures workflows, not the full API surface.
When to export to Arazzo
- Round-trip an Arazzo document. An item imported from Arazzo 1.0 or 1.1 exports back lossless, with its workflows, steps, inputs and outputs as you wrote them.
- Start workflows for an API you already have. A REST, RPC or GraphQL item exports to a starting point: one workflow per service, one step per operation, ready for you to edit into the real sequences.
A published project version also serves an Arazzo document of its own, generated per class
(/v1/arazzo, apiome schema arazzo). That is a different document; see
Download Arazzo or JSON Schema by slug.
Arazzo export at a glance
| Step | Where | Details |
|---|---|---|
| See what the export keeps, approximates and synthesizes | The fidelity report on the Arazzo card | What is written |
| Choose the Arazzo version and YAML style | Export dialog → REST & HTTP → Arazzo | Where to find it |
| Export from the CLI | apiome export arazzo <item> --out <file>.arazzo.yaml | Where to find it |
| Trust the file: schema check and re-import | Automatic before every download | Arazzo export checks |
| Replace the placeholder source description | In the downloaded file, before you run the workflow | What is written |
What is written to Arazzo
- An item imported from Arazzo is written back as it was read, with its own workflows, steps,
inputs, outputs and workflow-level
parameters. Arazzo 1.1's$selfand its event-step fields (channelPath,action,correlationId,timeout) are written back too.$selfexists only from 1.1, so an Arazzo Version of1.0.1leaves it out and the report says so. - Any other item gets one workflow per service. The workflow's steps call that service's
operations by id, in the order they are declared. The source declares no such workflow, so the
report marks it synthesized. When an operation has no id of its own, the step uses the
operation's key (
POST /orders), and the report marks that synthesized too. - Each operation becomes a step and is marked approximated. Its parameters, request and
response schemas stay in the source description and are not written. When the file is read back,
the step is named
<workflow>#<step>(orders#POST /orders). The report marks the operation's own key dropped and the step's key synthesized. If two operations of one service would get the same step id, only the second is written, and the report marks the first dropped. - Types, servers, event channels, agents and skills are not written. All but servers are marked dropped. A service with no operation to sequence gets no workflow and is marked dropped.
- A source description is required by Arazzo. When the item names none, the document gets one
entry named after the API, pointing at a placeholder such as
./shop-orders.openapi.yaml. Replace that URL with the address of the real API description before you run the workflow. The report marks the entry synthesized. - A version is required too. An item without one is written as version
1.0.0, marked synthesized. - An item with nothing to sequence, such as a set of types or an event API, cannot be exported to Arazzo: a valid Arazzo document needs at least one workflow. Arazzo is not offered for it, and the export is refused with the reason.
Every export from a non-Arazzo item shows the fidelity warning before you download.
Where to find the Arazzo card
In the Export dialog, the Arazzo card is under REST & HTTP on the
Target step, as one <name>.arazzo.yaml file. Its badge is lossless for an item imported from
Arazzo (1.0 or 1.1) and lossy for an item of any other paradigm with operations: REST (OpenAPI,
WSDL, RAML), RPC (Thrift, Smithy) or GraphQL. For an item with nothing to sequence, such as a JSON
Schema set of types, the card is greyed out. Pick the card to set its options:
| Option | Default | What it does |
|---|---|---|
| Pretty Print | On | Writes block-style YAML, one key per line. Turn it off for compact flow-style YAML. |
| Arazzo Version | Empty | The Arazzo version to write, 1.0.1 or 1.1.0. Empty keeps the version the item was imported from; otherwise 1.1.0 when the item has an AsyncAPI source description and 1.0.1 when it does not. |
From the CLI, run apiome export arazzo <item> --out <file>.arazzo.yaml, and add
--option pretty_print=false or --option arazzo_version=1.1.0. The CLI prints the fidelity report:
the tier and preserved share, the counts, and the losses worst first, with the workflows, not the
full API surface warning among them. A lossy export exits non-zero unless you add --force, and
--json prints the tier. For an item with nothing to sequence, the CLI stops with the reason before
it starts an export. A public item's Export dialog on Browse offers Arazzo too, as the
.arazzo.yaml file.
Arazzo export checks
Before you download, Apiome checks the document:
- Schema (
arazzo.schema). A document Apiome built from a non-Arazzo item must pass the official Arazzo JSON Schema for the version it declares (1.0 or 1.1). Each problem names its location, such as/sourceDescriptions. A document that fails is not delivered. - Re-import (
arazzo.reimport). Every document is read back through the Arazzo importer, the same way an upload is, and compared with the item.
An item imported from Arazzo is your own document, written back as it was read, so it is checked by
re-import only. Apiome reads some spellings the schema does not allow, such as name instead of
workflowId; those are listed in the round-trip report but do not block the export.
API Blueprint from any source
When to export to API Blueprint
- Publish human-readable docs. A REST item becomes one Markdown
.apibfile people can read, with its resources, actions and MSON data structures. It is documentation, not a contract: validation rules MSON cannot express are left out, and the fidelity report lists each one. API Blueprint is no longer actively developed, so prefer OpenAPI for a machine-readable contract. - Round-trip an API Blueprint item. An item imported from API Blueprint exports back lossless.
API Blueprint export at a glance
| Step | Where | Details |
|---|---|---|
| Pick the API Blueprint card and its options | Export dialog → REST & HTTP → API Blueprint | Where to find the API Blueprint card |
| See how the document, resources and data structures are written | The fidelity report on the card | How the item is written |
| See what API Blueprint cannot carry | The fidelity report on the card | What the fidelity report lists |
| Trust the file: drafter, then re-import | Automatic before every download | How an API Blueprint export is checked |
| Export from the CLI | apiome export apiblueprint <item> --out <file>.apib | Where to find the API Blueprint card |
Exporting to API Blueprint writes one <Name>.apib file in API Blueprint 1A: Markdown, with
its data structures in MSON. It is meant to be read by people, as documentation of the API, so it
writes what a reader needs and leaves out validation rules MSON cannot express.
How the item is written
- Document. The
FORMAT: 1Aline and the first server asHOSTcome first, then the item's title and description. - Resources. Each path is one resource (
## Pets [/pets/{petId}]) with its path parameters. Each operation is an action with its name, method and description. Its query parameters go in the action's URI ([GET /pets{?limit}]) and are listed under Parameters. Its request and its responses, one per status code, name their media type and body (+ Attributes (Pet)). A body given as an inline JSON Schema is written as a+ Schemasection. - Data structures. Objects list their fields in order as MSON properties, such as
+ id (string, required) - Pet id.. A default is a nested+ Default:line. Enums list their members, and an alias is a named type based on what it wraps. - Types. MSON has three value types:
string,numberandboolean. A 64-bit integer becomes anumber, and a date becomes astring.
What the fidelity report lists
The fidelity report lists what API Blueprint cannot carry:
- validation rules: lengths, ranges, patterns and formats are marked dropped wherever they sit (a field, a parameter, a named scalar, an alias or an object), next to anything else about how that part is written;
- operations with no HTTP method and path (from gRPC, GraphQL or WSDL sources), event operations and channels, and a second operation on the same method and path;
- header and cookie parameters, status ranges such as
4XX, and response headers and descriptions; - every server but the first, server variables, the version, and the grouping into services;
- types MSON writes differently: wider numbers and dates as
numberandstring, aliases, named scalars and maps as named types (marked approximated), and unions, which MSON lacks (marked dropped); - deprecation flags, tags, and source details such as gateway routes;
- renamed types: MSON type names here are letters, digits and
_, socom.acme.Orderis writtencom_acme_Order.
An item imported from API Blueprint is written back as it was read. Import now also reads an
action's description, query parameters from the URI ({?limit}), a data structure's description,
+ Default: values, and property names in backticks.
How an API Blueprint export is checked
Each export is checked before you download it:
- drafter, the API Blueprint parser, reads it when the server has it. A good blueprint has no warnings, so any drafter error or warning fails the export and names its code, line and column. Without drafter, the API Blueprint importer reads the document instead, and a parse error fails the export.
- The document is then imported again. If it does not import, the export fails
(
apiblueprint.reimport).
An item imported from API Blueprint exports and re-imports unchanged. From any other source, the re-import shows what API Blueprint could not keep; the fidelity report names those losses.
Where to find the API Blueprint card
In the Export dialog, the API Blueprint card is under REST & HTTP on
the Target step, as one file. Its badge is lossless for an item imported from API Blueprint and
lossy for any other source. On the Fidelity step, the export is described as one for
human-readable docs, and the report lists each constraint MSON cannot express (format, minimum,
maximum, exclusive bounds) as dropped. Pick the card to see its three options: Format Version
(1A, the FORMAT line), Include Comments (on by default), which writes the generated-file comment
under the title, and Media Type (application/json by default), for a request body whose item
names none. From the CLI, run apiome export apiblueprint <item> --out <file>.apib, and add
--option include_comments=false or --option media_type=application/xml. The CLI prints the
dropped constraints. A lossy export exits non-zero unless you add --force, and --json prints the
tier. A public item's Export dialog on Browse offers API Blueprint too, as the .apib file.
| Format | Kind | Exports from |
|---|---|---|
| A2A Agent Card | Agent tools | An agent, or a source with an operation that is not an event |
| Apache Arrow / Parquet | Data schema | Any source with a record type |
| Apache Avro | Data schema | Any source |
| Apache Iceberg | Data schema | Any source with a record type |
| Apache Thrift | RPC | Any source |
| API Blueprint | REST | Any source |
| Apigee API proxy | REST | Any source |
| Arazzo | REST | A source with an operation to sequence |
| ASN.1 | Data schema | Any source |
| AsyncAPI 3.1 | Events | Any source |
| AWS API Gateway | REST | Any source |
| Azure API Management | REST | Any source |
| Bruno | REST | Any source |
| Cap'n Proto | RPC | Any source |
| CDDL | Data schema | Any source |
| CloudEvents | Events | Any source |
| COBOL Copybook | Data schema | Any source |
| Connect RPC | RPC | Any source |
| CORBA IDL | RPC | Any source |
| EDI X12 | Data schema | A source imported as EDI X12 |
| Envoy xDS RouteConfiguration | REST | Any source |
| FHIR | REST | Any source |
| FIX | Data schema | A source imported as FIX |
| FIX Orchestra | Data schema | Any source with a record type |
| FlatBuffers | Data schema | Any source |
| Gateway API HTTPRoute | REST | Any source |
| Google API Discovery | REST | Any source |
| GraphQL SDL | Graph | Any source |
| HL7 v2 | Data schema | A source imported as HL7 v2 |
| HL7 v2 segment guide | Data schema | Any source with a record type |
| Hoppscotch | REST | Any source |
| HTTP Request File | REST | Any source |
| Insomnia | REST | Any source |
| ISO 20022 | Data schema | A source imported as ISO 20022 |
| ISO 8583 | Data schema | A source imported as ISO 8583 |
| Istio VirtualService | REST | Any source |
| JSON Schema | Data schema | Any source |
| JSON Type Definition | Data schema | Any source |
| Kafka Connect Schema | Data schema | Any source |
| Kong Declarative Config | REST | Any source |
| Kubernetes CRD | Data schema | Any source |
| LLM Tool Definitions | Agent tools | Any source |
| MCP Tool Definitions | Agent tools | A source with an operation an agent can call |
| OData | REST | Any source |
| ODCS Data Contract | Data schema | Any source |
| ONC RPC | RPC | Any source |
| OpenAPI 3.1 | REST | Any source |
| OpenRPC | RPC | Any source |
| Postman | REST | Any source |
| Protocol Buffers (proto3) | RPC | Any source |
| RAML | REST | Any source |
| SAP IDoc | Data schema | A source imported as SAP IDoc |
| Smithy | RPC | Any source |
| SQL DDL | Data schema | Any source with a record type |
| Thunder Client | REST | Any source |
| Traefik dynamic configuration | REST | Any source |
| TypeSpec | REST | Any source |
| UN/EDIFACT message guide | Data schema | Any source with a record type |
| WADL | REST | Any source |
| WIT (WebAssembly) | RPC | Any source |
| WSDL | REST | Any source |
| X12 implementation guide | Data schema | Any source with a record type |
| XML-RPC | RPC | A source with an RPC operation |
| xRegistry | Events | A source with a type or an event (publish / subscribe) operation |
| XSD | Data schema | Any source |
| z/OS Connect | REST | A source imported as z/OS Connect |
With the CLI
Export from the CLI walks through apiome export end to end: every format,
the fidelity report, and gating a CI job on it.
# OpenAPI (default), JSON, to a file
apiome spec export --project <id-or-slug> --version <id-or-label> --output petstore.json
# YAML
apiome spec export --project <id-or-slug> --version <id-or-label> --yaml -o petstore.yaml
# Exporting to another format (AsyncAPI, GraphQL, Proto3, Avro, …)? Check what will be
# preserved — and why anything changes — before you generate:
apiome export targets --project <id-or-slug> --version <id-or-label>
apiome export evidence --project <id-or-slug> --version <id-or-label> --target avro
# Arazzo workflow document instead of OpenAPI
apiome spec export --project <id-or-slug> --version <id-or-label> --format arazzo -o flows.json
Use -o - to stream to stdout. --format accepts openapi (default) or arazzo.
Download Arazzo or JSON Schema by slug
apiome schema arazzo and apiome schema json take the published version as one
tenant/project/version argument (slugs, as in the REST route) and write to stdout by default,
so they suit a redirect, a pipe or a build step. They share the same flags; only the default
--format differs — yaml for Arazzo, json for JSON Schema.
# JSON Schema (2020-12) bundle, every class
apiome schema json acme-corp/payments-api/2.1.0 > schema.json
# One class's schema, straight into a code generator
apiome schema json acme-corp/payments-api/2.1.0 --class Charge \
| npx quicktype --src-lang schema --lang go > charge.go
The JSON Schema is streamed exactly as the server emits it ($schema: https://json-schema.org/draft/2020-12/schema); the CLI does not transform it.
# Full Arazzo bundle
apiome schema arazzo acme-corp/payments-api/2.1.0 > workflows.arazzo.yaml
# One class's workflow (the per-class route)
apiome schema arazzo acme-corp/payments-api/2.1.0 --class Charge > charge.arazzo.yaml
# JSON instead of YAML, written to a file
apiome schema arazzo acme-corp/payments-api/2.1.0 --format json --output workflows.arazzo.json
# Pin the exact bytes in CI: exit 6, and nothing written, if the document changed
apiome schema arazzo acme-corp/payments-api/2.1.0 -o workflows.arazzo.yaml \
--expect-sha256 <sha256-from-a-first-run>
| Flag | What it does |
|---|---|
--class NAME | Download only that class's workflow or schema. An unknown class exits 2. |
--format json|yaml | Serialization. Default yaml for schema arazzo (the usual form for Arazzo), json for schema json. |
--output FILE, -o | Write to a file. Default -, stdout. |
--expect-sha256 HEX | Compare the document's SHA-256 first; on a mismatch print both digests, write nothing and exit 6. A sha256: prefix is accepted. |
The document is written byte for byte as the server sent it. A summary — bytes written, format and
Checksum: sha256:… — goes to stderr, so copy the checksum from a first run into
--expect-sha256. With the global --json, the summary is one JSON object: on stdout when the
document goes to a file, on stderr when the document goes to stdout.
The version must be published. An unknown or unpublished version, or a private one without an API
key, exits 2; set APIOME_API_KEY for private versions. No tenant configuration is needed — the
tenant is in the argument.
The generated Arazzo document declares arazzo: 1.0.1, because its only source description is the
version's OpenAPI schema. To get Arazzo 1.1 instead, call the REST route with
?arazzo_version=1.1.0 (any 1.0.x or 1.1.x version is accepted; see the next section).
With the REST API
GET /v1/schema/{tenant_slug}/{project_slug}/{version_slug}
Accept: application/json # default; use application/yaml for YAML
Other representations of the same version:
| Format | Route |
|---|---|
| OpenAPI | GET /v1/schema/{tenant}/{project}/{version} |
| Arazzo | GET /v1/arazzo/{tenant}/{project}/{version} (one class: append /{class}). Writes arazzo: 1.0.1; add ?arazzo_version=1.1.0 (or any 1.0.x / 1.1.x version) to choose. Any other version returns 400. |
| JSON Schema | GET /v1/json/{tenant}/{project}/{version} (one class: append /{class}) |
For private versions, pass an in-scope API key via the X-API-Key header (or the api_key query
parameter).
Every export runs as a job: How an export runs covers the pipeline, the job states, the transcoding guard and the failure codes.
Export to several formats in one job
To publish a version in several formats at once, send one export job with a targets list instead
of a single target. Apiome emits the version to every listed format and hands back one zip.
POST /v1/export/{tenant_slug}/jobs
{
"artifact": "<project-id>",
"version": "1.0.0",
"targets": [
{ "target": "openapi" },
{ "target": "graphql" },
{ "target": "protobuf", "options": { "package": "acme.payments.v1" } }
]
}
- The
202response carries astatus_path. Poll it untilstateiscompletedorfailed. - Download the zip from
result.download_path. Each format sits in its own folder, named after the resolved format key (openapi-3.1/,graphql/, …), and a rootmanifest.jsonlists every folder, its files, its fidelity tier and the version that produced it. - Read the fidelity on the job result:
result.targets[]has one entry per format, in the order you sent them: its full fidelity report, transcoding guard, validation report, delivery decision and the files it added to the zip.result.fidelity_rollupsums them up: the worst tier, the lowest and average preserved share, how many formats landed in each tier, and which formats are lossy or need confirmation.
| Rule | Behavior |
|---|---|
target vs targets | Send one or the other. Mixing them, or putting options / acknowledged_snapshot at the top level next to targets, is rejected with 422. |
| Per-format settings | options and acknowledged_snapshot go on each targets entry. |
| How many | Up to 16 entries in targets. Two entries that resolve to the same format (openapi and openapi-3.1) are rejected with 400. |
dry_run: true | Every format's fidelity report and the rollup, no zip. |
| Severe conversions | If any format needs confirmation, the job fails with TRANSCODE_CONFIRMATION_REQUIRED before anything is generated. Resubmit with "confirm": true. |
| Failures | All or nothing: the first format that fails fails the job, and error.context.target names it. No zip is kept. |
| Attestation | Each format is attested separately against the zip. Fetch one with GET …/jobs/{job_id}/attestation?target=<format key>. |
The same rules for snapshots and acknowledgements apply to each format; see Understand export fidelity.
Export a whole project or several versions in one job
To export more than one version of a project, send one export job with a versions list (version
labels or revision ids) or "all_versions": true instead of version. Every version is exported
to every target you name, and you get back one zip.
POST /v1/export/{tenant_slug}/jobs
{
"artifact": "<project-id>",
"versions": ["1.0.0", "1.1.0", "2.0.0"],
"targets": [
{ "target": "openapi" },
{ "target": "graphql" }
]
}
Each version × format pair is an item. An item that fails does not stop the others.
- The
202response carries astatus_path. Poll it untilstateiscompletedorfailed. - Read
result.batchon the completed job:completed_countandfailed_countsay how many items made it into the zip.items[]has one entry per item: its version, format,state, folder in the zip, fidelity tier and preserved share, delivery decision, files, and, for a failed item, anerrorwith the samecode,messageandremediationa failed single export carries.result.fidelity_rollupsums up the fidelity of the completed items.
- Download the zip from
result.download_path. Each completed item sits in a<version>/<format>/folder (1.0.0/openapi-3.1/,1.0.0/graphql/, …). The rootmanifest.jsonlists every item, including the failed ones and why they failed.
| Rule | Behavior |
|---|---|
| Choosing versions | Send versions (up to 50 distinct entries) or "all_versions": true, never together and never with version. all_versions takes every version of the project, newest first. |
| Formats | Use target (with options) for one format, or a targets list for several. |
| How many | Up to 100 items (versions × formats). A longer versions list is rejected with 422; an all_versions job over a bigger project fails with EXPORT_BATCH_TOO_LARGE. |
| Snapshots | acknowledged_snapshot is not accepted: a snapshot describes one version. Preview a version on its own to acknowledge it. |
| Failures | Per item. A version that does not exist, a format that fails, a severe conversion without "confirm": true or a blocked delivery fails only that item, and the job still completes. The job fails with EXPORT_BATCH_FAILED only when every item failed; error.context.items lists each one. |
| Same version twice | A label and its own revision id count as one version; the second is skipped with a BATCH_VERSION_DUPLICATE warning. |
dry_run: true | Every item's fidelity tier and the rollup, no zip. |
| Attestation | Each completed item is attested against the zip. Fetch one with GET …/jobs/{job_id}/attestation?version=<version>&target=<format key>. |
Export several items in one job
To export several catalog items or projects at once, send items instead of artifact. Each entry
names an artifact and, optionally, a version; without one the item's latest version is exported.
POST /v1/export/{tenant_slug}/jobs
{
"items": [
{ "artifact": "<orders-item-id>" },
{ "artifact": "<pets-item-id>", "version": "1.0.0" }
],
"targets": [{ "target": "openapi" }]
}
It runs as a batch, so everything above applies: each item × format pair succeeds or fails on its
own, result.batch.items[] reports each one (now with its artifact), and you get back one zip.
- Each item's files sit in a folder named after the item's slug:
orders-api/openapi-3.1/. An item that names a version adds the version:pets-api-1.0.0/openapi-3.1/. - The root
manifest.jsongives each item'sartifact, andartifact_countsays how many distinct items the job covered. itemscannot be combined withartifact,version,versionsorall_versions. Entries must be distinct, and the job runs at most 100 item × format pairs. A request that breaks a rule is rejected with422.
The Catalog's bulk Export… and apiome export <format> --items send this request for you.
From the CLI: several formats or several items
apiome export <format> exports through the same job pipeline. Two flags turn it into one job that
writes one archive. They work for every format with no dedicated command; openapi, which has one,
can still be one of the --targets.
# One version to three formats: a folder per format
apiome export graphql payments-api --targets openapi,avro --out exports/
# Three catalog items, each at its latest version (or ITEM@VERSION), to one format
apiome export graphql --items orders-api,pets-api@1.0.0,events-bus --out exports.zip
| Flag | Behavior |
|---|---|
--targets FORMAT,… | More formats after <format>, in one all-or-nothing job. --option applies to <format> only; the other formats use their defaults. |
--items ITEM[@VERSION],… | Ids or slugs, instead of ARTIFACT. Runs a batch job; --version does not apply (use @VERSION). |
--out | A directory to unpack into, or a .zip path. - (stdout) is refused. |
The command prints one row per item × format, with its state, fidelity tier and folder (or error).
It exits 0 when every item completed, 7 when the archive was written but some items failed,
and 1 when every item failed. --min-grade and --fail-on gate a single export, so they are
refused with these flags.
Apply overlays when you export
An OpenAPI Overlay changes the exported document without changing the
version: a partner's servers, public descriptions, x- extensions. Send the overlays with the job,
in the order they should apply:
POST /v1/export/{tenant_slug}/jobs
{
"artifact": "<project-id>",
"version": "1.0.0",
"target": "openapi",
"overlays": [
{ "name": "partner.yaml", "document": { "overlay": "1.0.0", "info": { "title": "Partner", "version": "1" },
"actions": [{ "target": "$.servers", "update": [{ "url": "https://partner.example.com" }] }] } }
]
}
- The overlays apply to the version's OpenAPI document before anything else runs. Fidelity, the emitter, validation and the export quality policy all judge the overlaid document, and the delivery grade recorded for the export is the overlaid document's.
result.overlaylists what changed:applied(the overlays, in order),ledger(one row per changed value —pointer,kind, theoverlaythat changed it; at most 500 rows, then one row saying how many more changed),changesandfindings. An action whose target matches nothing is anoverlay.unmatched-targetfinding, and the document is left as it was. The job also logs anOVERLAYS_APPLIEDevent and oneOVERLAY_FINDINGwarning per finding.- Send the same
overlaystoPOST /v1/export/{tenant_slug}/verify, so the verify snapshot you acknowledge matches the job's. - At most 10 overlays, each at most 1 MiB. They work with one
targetor atargetslist, but not with a batch (versions,all_versionsoritems), because an overlay is written for one document. - A version imported from another format fails with
OVERLAY_SOURCE_UNSUPPORTED. An overlay with an unsupported revision or noactionsfails withOVERLAY_INVALID.
From the CLI, add --overlay FILE (JSON or YAML), once per overlay:
# OpenAPI with a partner's servers and descriptions (runs as a job; writes JSON)
apiome export openapi --project payments-api --version 1.0.0 -o partner.json \
--overlay base-public.yaml --overlay partner.yaml
# Any other format, or several formats at once
apiome export openapi-3.1 payments-api --out exports/ --targets avro --overlay partner.yaml
The command prints Overlays: applied … — N value(s) changed and one line per finding. --overlay
cannot be combined with --items, or with --yaml on export openapi.
Limits
Every export job runs inside these limits. A request that hits one is refused with a message naming
the limit, so you know what to change. An administrator can change each one with the setting shown;
0 turns a limit off.
| Limit | Default | When it is hit | Setting |
|---|---|---|---|
| Jobs running at once, per workspace | 5 queued or running | A new job is refused with 429 until one finishes or is cancelled | APIOME_EXPORT_MAX_CONCURRENT_JOBS_PER_TENANT |
| How long one job may run | 30 minutes | The job stops and fails with EXPORT_JOB_TIMED_OUT | APIOME_EXPORT_JOB_TIMEOUT_SECONDS |
| Size of the download | 32 MiB | The job fails with EXPORT_ARTIFACT_TOO_LARGE | APIOME_EXPORT_ARTIFACT_MAX_BYTES |
| Items in one batch | 100 items × formats; 50 versions; 16 entries in targets | The request is refused with 422, or an all_versions job fails with EXPORT_BATCH_TOO_LARGE | Fixed |
| How long a download is kept | 24 hours | The download answers 410 Gone; run the export again | APIOME_EXPORT_ARTIFACT_RETENTION_HOURS |
Every member's jobs count toward the workspace's five. A download past its retention time is
deleted, not just hidden. The job itself stays in the job list (GET /v1/export/{tenant_slug}/jobs)
until it is cleared: 7 days after it finished or was cancelled, 30 days after it failed.
File names in a download
File and folder names in a download come from your source: the API's title, a type's name, an Avro
namespace. Apiome keeps every name inside the download. A name that would leave the folder you
unpack into (one starting with / or a drive letter, or containing .. or \) is rewritten to
stay inside it: an Avro namespace com.acme becomes the folders com/acme, and parts that are not
legal Avro names become _. A file name in any script, such as 注文-api.jtd.json, keeps its
characters when you download it. Every download is sent as an attachment, and browsers are told not to guess its type.
Verify
The exported document is valid OpenAPI and contains the classes and paths you edited. The
Golden Path does exactly this — it exports via the real CLI and re-validates the
downloaded document with openapi-spec-validator.
Test-drive it
For OpenAPI targets, the Export studio's Review step can turn the artifact you just generated into
a live mock for a few minutes — a base URL you can curl, responses generated from
the document's own response schemas, and a log of everything it served. It is the strongest check
available: a document that cannot answer its own operations is a finding no static validation would
surface.
POST /v1/export/{tenant_slug}/mock
{ "artifact": "<project-id>", "version": "1.0.0", "target": "openapi" }
The mock expires by itself, and servers without the Mock Server deployed report the capability as
unavailable rather than offering a button that cannot work. See
export_mock_test_drive.md (apiome-rest/docs/export_mock_test_drive.md) for the endpoints,
the lifetime rules and the configuration, and Mock try-out for the panel.
Related
- Supported formats — every format Apiome imports and exports, generated from the registries
- Export studio — the same export step by step, with verify and a job
- Export catalog items — one item or many, every target's fidelity tier
- Understand export fidelity — cross-format exports: what is preserved, what is lost and why, and the risk acknowledgement
- Export to an API gateway — Kong, Gateway API, Envoy, Istio, Traefik, AWS API Gateway, Azure API Management and Apigee configuration
- Export to an API client — Hoppscotch and Thunder Client collections, with their environments
- Browse published specs — view the same spec rendered
- Compare published versions — diff two published versions
with
apiome schema diff - CLI quick-start — full CLI reference