Importing an OpenAPI specification to create API documentation in CornerSpot

If your product has an API, Cornerspot can write the documentation for you. The Import OpenAPI Specification wizard turns an OpenAPI 3.x definition into a complete, publishable API reference — one category for the reference, one polished article per resource group, each with endpoint details, parameter tables, and code samples. This guide walks through the whole flow, including the Use AI to select icons helper and editing code samples afterwards.

What the importer creates

  • One top-level category named after your API, holding the whole reference.
  • One section (sub-category) and one article per resource group — your spec's tags.
  • Per-endpoint documentation in every article: the method and path, a description, parameter and response tables, and an optional code samples block.
  • Drafts, not live pages — nothing is published until you publish your knowledge base, so you can review everything first.

How to import your OpenAPI specification

1. Open the Import menu

Go to Knowledge Base → Articles (at /dashboard/settings/help-center/articles) and click Import in the header. Choose OpenAPI Specification.

The Import menu on the Cornerspot Articles page with the OpenAPI Specification option
The Import menu on the Articles page, with the OpenAPI Specification source.

2. Choose your source

You can provide your definition two ways:

  • Upload a file — drag and drop a .yaml, .yml, or .json definition (up to 10 MB).
  • Fetch from a URL — paste a direct link to the definition. You can even paste a documentation page (Swagger UI, Redoc, and similar): Cornerspot reads the page and discovers the spec URL for you.
The Source step of the Cornerspot OpenAPI import wizard with a docs page URL entered
The Source step: upload a file, or fetch from a URL — even a docs page works.

3. Review the syntax check

Your spec is parsed and validated in seconds (no AI is involved in analysis). The Syntax Review groups anything it found by kind. Warnings — like a resource group or endpoint without a description — never block the import; they just mean the generated docs are a little thinner in those spots. Only true blockers (an unsupported version, an unreadable file) stop you, with clear instructions to fix and re-upload.

The Syntax Review step of the Cornerspot OpenAPI import wizard grouping warnings by kind
The Syntax Review: warnings are grouped by kind and never block the import.

4. Name the reference and its sections

Next you shape the structure: the top-level category and one section per resource group, each with an editable name and icon. Rename anything — slugs update as you type.

The Categories step of the Cornerspot OpenAPI import wizard showing the reference and its sections
The Categories step: one reference, one section per resource group.

Rather than picking icons for dozens of sections by hand, click Use AI to select icons. Cornerspot's AI reads each section's name and picks the most fitting icon from the icon library, applying them all at once — people for Accounts, a clock for Activities, a message bubble for Chat. It runs in the background and uses your team's included AI credits.

Sections in the Cornerspot import wizard with icons chosen by AI to match each category name
Every section gets an icon matched to its name, applied in one click.

These icons aren't just decoration: they carry through to your knowledge base's navigation menus and category views, helping readers see what each section covers at a glance. And if a pick isn't quite right, just click the icon to open the picker and choose your own (or click Reset names to undo everything, names and icons alike).

The icon picker open on a section in the Cornerspot import wizard to choose a different icon by hand
Click any icon to choose a different one by hand.

5. Choose a code samples strategy

Every endpoint section can include a tabbed code samples block. You have three options:

  • Use samples from the specification — if your spec ships code samples as x-codeSamples (or x-code-samples) vendor extensions, Cornerspot uses your curated examples exactly as written. The step shows how many endpoints include them; endpoints without samples get none (you can add them later in the editor).
  • Generate samples automatically — runnable request examples built from each endpoint's definition, in your choice of twelve languages (cURL, JavaScript, Node.js, Python, Ruby, PHP, Go, Java, C#, Kotlin, Swift, and Rust). Generation is deterministic — built from the spec, not written by AI — and uses each language's standard capabilities with no vendor SDKs.
  • No code samples — skip them for now and add samples later from the article editor.
The Code samples step of the Cornerspot OpenAPI import wizard with the spec samples strategy selected
Three code sample strategies: from the spec, auto-generated in up to 12 languages, or none.

6. Generate the documentation

Click Generate and Cornerspot writes an article for every resource group, one at a time, with live progress. This runs in the background — it's safe to leave the page and come back; the run picks up right where it was.

The Cornerspot OpenAPI import wizard writing an article for each resource group with live progress
Generation in progress: one article per resource group, with live progress.

7. Review the result

When it finishes you'll see a summary of what was created. View articles takes you to the Articles list already filtered to your new reference, and Publish your knowledge base is one click away when you're ready to go live.

The finished Cornerspot OpenAPI import with the reference summary and View articles button
The finished import: your API reference, ready to review as drafts.
The Cornerspot Articles list pre-filtered to the newly generated API reference
View articles opens the list pre-filtered to the new reference.

Working with code samples in the editor

Open any generated article and switch the editor to Split to see your content and a live reader preview side by side — including the code samples block, rendered exactly as readers will see it, with a tab per language.

The Contacts article open in the Cornerspot editor Split view with the code samples block in the live preview
Split view: the editor beside a live preview of the Contacts article, code samples included.

Click a code samples block to open the samples editor. From there you can:

  • Edit any sample — each language is a tab backed by a full code editor.
  • Add a language — pick from the twelve-language catalog, or choose Custom language… to add your own tab (say, for your SDK).
  • Remove a language — click the ✕ on its tab twice to confirm.
The Cornerspot code samples editor with a Ruby sample being added alongside cURL, JavaScript, and Python
The code samples editor: edit any tab, add catalog or custom languages.

Click Save in the samples editor, then Save the article. You can also insert a brand-new code samples block anywhere in any article from the editor toolbar.

Your reference, live on your docs site

Once you publish your knowledge base, the reference is part of your hosted documentation site — with reader-friendly navigation built from your sections and icons, interactive code sample tabs, and a visitor-facing dark mode. Here's the Contacts article we just edited, live and in context, Ruby tab included:

The generated Contacts article live on the published Cornerspot documentation site in dark mode, showing the Ruby code sample tab
The Contacts article live on the published docs site, in dark mode.

Shipping code samples inside your spec

To have the importer use your own curated examples, add an x-codeSamples (or x-code-samples) array to any operation in your OpenAPI definition. Each entry needs a lang and a source, with an optional label for the tab:

paths:
  /contacts:
    get:
      summary: List contacts
      x-codeSamples:
        - lang: curl
          source: |
            curl -s "https://api.example.com/contacts" \
              -H "Authorization: Bearer $API_KEY"
        - lang: python
          source: |
            import requests
            requests.get("https://api.example.com/contacts")

Languages that match the catalog (like curl, javascript, or python) get their standard tab labels automatically; anything else passes through as a custom tab.

Re-importing when your API changes

Run the import again any time your spec changes — it's safe by design. Articles you haven't touched are refreshed with newly generated content, while anything you've hand-edited is kept by default (you decide per article, and overwriting an edited article always asks for confirmation). Deleted articles are recreated, and your category names, icons, and ordering are preserved.

Tips for a polished API reference

  • Add descriptions to your spec's tags and operations — the Syntax Review shows exactly where they're missing, and richer specs make richer docs.
  • Ship x-codeSamples for your most important endpoints and let the generator cover the rest on a later import.
  • Generated articles are drafts — review them in Split view, then publish your knowledge base when you're happy.

Was this article helpful?