Skip to content

OAOperation Component

The OAOperation component renders a specific API operation with all its details including parameters, request body, responses, and an interactive playground.

Props

PropTypeDefaultDescription
operationIdStringrequiredUnique identifier for the operation to render
specObject | StringundefinedOpenAPI specification object or JSON string
specUrlStringnullURL to fetch OpenAPI specification from
prefixHeadingsBooleanfalseAdd prefixes to component headings (useful for one-page views)
hideBrandingBooleanfalseHide the vitepress-openapi branding footer

Deprecated Props

PropTypeDefaultDescription
hideDefaultFooterBooleanundefinedDeprecated: Use hideBranding instead

Events

EventPayloadDescription
update:specObjectEmitted when the spec is loaded or updated

Slots

The OAOperation component supports the following slots for customization:

SlotDescription
headerCustom header content above the operation
tagsCustom tags display
pathCustom path and method display
descriptionCustom description content
securityCustom security requirements display
parametersCustom parameters section
request-bodyCustom request body section
responsesCustom responses section
playgroundCustom playground/try-it section
code-samplesCustom code samples section
brandingCustom branding footer
footerCustom footer content

Loading Indicator

When the specUrl prop is provided, the component will show a loading indicator while fetching the specification.