Skip to content

OASpec Component

The OASpec component renders a complete OpenAPI specification, including all operations, schemas, and documentation.

Props

PropTypeDefaultDescription
specObject | StringnullOpenAPI specification object or JSON string
specUrlStringnullURL to fetch OpenAPI specification from
hideInfoBooleanfalseHide the info section (title, description, version)
hideServersBooleanfalseHide the servers section
groupByTagsBooleannullGroup operations by tags
tagsArrayundefinedFilter operations to only show specific tags
hideBrandingBooleanfalseHide the vitepress-openapi branding footer
hidePathsSummaryBooleanundefinedHide the paths summary when grouping by tags

Events

EventPayloadDescription
update:specObjectEmitted when the spec is loaded or updated

Slots

The OASpec component supports all operation slots for customizing the display of individual operations:

SlotDescription
headerCustom header content for operations
tagsCustom tags display
pathCustom path 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.