Skip to content

Turn an OpenAPI Schema into a Working UI

panel-openapi reads an OpenAPI document and builds a Panel form for any operation in it: a widget per parameter, a request on submit, the response rendered.

Point it at a spec, a path and a method. It works out the inputs from the schema, so there is no form to write, no request to assemble, and nothing to keep in sync when the API changes.

The quickstart form, with a live response beside it

Two minutes to a working form

New here? Start with the quickstart →

Why panel-openapi

  • No form code: every path, query, header and body field becomes a widget.
  • Any spec source: a URL, a dict, or a FastAPI app's api.openapi().
  • Real requests: submit issues the call and renders the response.
  • Reactive targeting: set path or method and the form rebuilds itself.
  • Record editing: OpenAPIRecordEditor loads a record from a GET and sends the changes to the matching PATCH/PUT/POST.
  • Yours to rearrange: form and response are plain Panel containers, and the introspection helpers are public if you would rather build it yourself.

Quickstart

import panel as pn

from panel_openapi import OpenAPIForm

pn.extension()

form = OpenAPIForm(
    "https://petstore3.swagger.io/api/v3/openapi.json",
    base_url="https://petstore3.swagger.io/api/v3",
    path="/pet/{petId}",
    method="get",
)

form.servable()
panel serve app.py --show

How-to guides

Examples

Reference