Code and exports
/code
PlanDesigner plandesigner
Code renders the selected version as a document you can read, copy, download and — for OpenAPI
— edit in place. The classic header's Canvas | Code toggle opens it; at the workspace rollout's
only stage the workspace top bar's Code & exports link is its entry point, and it is the one
classic surface that is never retired.
Formats
| Group | Formats |
|---|---|
| Primary | OpenAPI Specification, AsyncAPI Specification, Arazzo Specification, JSON Schema |
| Secondary | GraphQL SDL; SQL DDL for PostgreSQL, MySQL, SQL Server, Oracle or SQLite |
A JSON / YAML toggle applies to the structured formats. The document shows in a Monaco viewer; Copy puts it on the clipboard ("Copied!").
Download
Download — "Validate OpenAPI 3.2 and download as JSON/YAML" — runs an export gate first ("Validating…"): a safe parse, the OpenAPI 3.2 schema, then Apiome's semantic checks.
- Errors open Export blocked — "Fix the issues below before downloading." — with Close.
- Warnings only open Validation warnings with Cancel and Download anyway.
Contract readiness
For OpenAPI, the Readiness toggle opens the Contract Readiness panel: the source, the contract digest, when it was evaluated and how fresh that is, and Evaluate readiness / Re-evaluate readiness. Each finding has a Go to link to the pointer in the document. The workspace inspector's Version readiness → Compute is the same evaluation.
Edit the source
For OpenAPI, Edit turns the viewer into an editor with Save draft, Discard, Apply and Done, and a status of Validating…, Valid or Unsaved. The shortcuts: Ctrl+S saves the draft to local recovery, Shift+Alt+F formats, F8 and Shift+F8 jump to the next and previous problem.
Drafts live on your device until applied: leaving asks Leave with unsaved edits? (Leave Edit mode), returning offers Recovered draft found (Restore draft / Discard draft), and switching between YAML and JSON with unsaved edits warns before it converts (Convert anyway).
Apply opens Review source changes, which classifies every change as Added, Changed, Removed or Preserved:
- If the document moved on the server since you started — "Your review was based on an older revision of this document." — rebase, then review again.
- Breaking or unclassified changes require the checkbox "I understand this apply includes breaking or unclassified changes for consumers of this contract."
- Keep editing, Discard draft, or apply (Applying…).
The review step only parses, validates and classifies; nothing is written until the apply, which
runs once, in a transaction, and refuses with a structured conflict when the base is stale
(STALE_BASE), the apply is blocked (SOURCE_APPLY_BLOCKED), someone else holds the draft lock
(DRAFT_LOCK_CONFLICT) or the version is published (PUBLISHED_IMMUTABLE).
The workspace's Open as code layer uses this same pipeline inside the workspace.
Other exports
The classic canvas exports the diagram rather than the contract — PNG, SVG, JPG, PDF, Mermaid,
PlantUML, GraphViz DOT, GraphML and Canvas JSON — through its layout menu's Export Canvas wizard
(Classic canvas). The workspace tree's
Export workspace exports the working set. Spec exports to gateways and clients, SDK generation
and the CLI's apiome export are in the main app — see
Ship in the Apiome documentation.