Multiple specs
You can use multiple OpenAPI specs on the same page by importing them and passing them as spec
prop to the OAOperation
component.
Example
In this example, we are using two different specs to render the same operation.
---
aside: false
outline: false
title: vitepress-openapi
---
<script setup lang="ts">
import defaultSpec from './openapi.json'
import schemasSpec from './openapi-schemas.json'
</script>
::: info
Using [default spec](../public/openapi.json)
:::
<OAOperation operationId="getAllArtists" />
---
::: info
Using [schemas spec](../public/openapi-schemas.json)
:::
<OAOperation operationId="getCircularReference" :spec="schemasSpec" />
INFO
Using default spec
Get all artists
Get a list of all legendary Argentine Rock artists and explore their contributions to the music scene. You can get one using the GETGet an artist endpoint.
Parameters
Query Parameters
The number of items to return
10
20
50
"int64"
10
The number of items to skip before starting to collect the result set
1
23
456
"int64"
0
Responses
Success Response
The request was successful and returns a list of artists.
Response Format
The response includes:
- A
data
array containing artist objects - Pagination information
Note: You can use the pagination parameters to navigate through large result sets.
INFO
Using schemas spec
Get a parent
Example of a JSON object with a circular reference.
Responses
A parent with a child