Operation Badges
Each operation can have different badges that indicate its state, for example if it is deprecated, the operation id, etc. The available badges are:
deprecated
operationId
By default, only the deprecated
badge is shown, as appropriate. You can customize the operation badges using the useTheme({ operation: { badges: string[] })
function. The order in which you set the badges is the order in which they will be displayed.
Example
---
aside: false
outline: false
title: vitepress-openapi
---
<script setup lang="ts">
import { onBeforeMount, onBeforeUnmount } from 'vue'
import { useTheme } from 'vitepress-openapi/client'
onBeforeMount(() => {
useTheme({
operation: {
badges: ['deprecated', 'operationId'],
},
})
})
</script>
<OASpec />
Preview
The Argentine Rock Legends is an example OpenAPI specification to test OpenAPI tools and libraries. Get all the data for all artists.
Inspired by Scalar Galaxy
Resources
- https://github.com/enzonotario/vitepress-openapi
- https://github.com/OAI/OpenAPI-Specification
Markdown Support
All descriptions can contain tons of text Markdown. If GitHub supports the syntax, chances are we’re supporting it, too. You can even create internal links to reference endpoints.
Examples
Blockquotes
I love Argentine Rock. <3
Tables
Feature | Availability |
---|---|
Markdown Support | ✓ |
Accordion
<details>
<summary>Using Details Tags</summary>
<p>HTML Example</p>
</details>
Images
Yes, there’s support for images, too!
Contact
Servers
Artists
Everything about Argentine Rock artists
and their contributions to music history.
Note: You will need to authenticate yourself to access some of these endpoints using the POSTAuthenticate a user endpoint.
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.
Add a new artist
Add a new legendary Argentine Rock artist. Make sure they truly deserve the title! You can view it later using the GETGet an artist endpoint.
Authorizations
Request Body
Responses
Artist Created Successfully
The artist has been successfully added to our database.
Response Details
The response includes the complete artist object with:
- A newly assigned unique
id
- All the information you provided in the request
Get an artist
Learn more about a specific Argentine Rock artist and their legacy. You can update it using the PUTUpdate an artist endpoint.
Parameters
Path Parameters
1
"int64"
Responses
Artist Found
The requested artist was found and returned successfully.
Response Format
The response includes the complete artist object with all available details:
id
: Unique identifier for the artistname
: Full name of the artistdescription
: Biographical informationimage
: URL to the artist's photoband
: Primary band association
Update an artist
Update the information of a legendary Argentine Rock artist. Make sure to provide accurate data. You can get the current data using the GETGet an artist endpoint.
Authorizations
Parameters
Path Parameters
1
"int64"
Request Body
Responses
Artist Updated Successfully
The artist information has been successfully updated in our database.
Response Details
The response includes the complete updated artist object with all the changes you made.
Note: All fields are returned in the response, even if you only updated some of them.
Delete an artist
This endpoint was used to delete artists. Unfortunately, that caused a lot of controversy. So, this endpoint is now deprecated and should not be used anymore. You can use the PUTUpdate an artist endpoint instead.
Authorizations
Parameters
Path Parameters
1
"int64"
Responses
Bad Request - Deprecated Endpoint
Get all albums
Get a list of all albums from a legendary Argentine Rock artist. You can add a new album using the POSTAdd a new album endpoint.
Parameters
Path Parameters
1
"int64"
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
Albums Found
The request was successful and returns a list of albums for the specified artist.
Response Format
The response includes:
- A
data
array containing album objects - Pagination information for navigating through large collections
Note: If the artist has no albums, the data array will be empty but the request will still return a 200 status code.
Add a new album
Add a new album to a legendary Argentine Rock artist. Make sure it's a masterpiece! You can view all albums using the GETGet all albums endpoint.
Authorizations
Parameters
Path Parameters
1
"int64"
Request Body
Responses
Album Created Successfully
The album has been successfully added to the artist's discography.
Response Details
The response includes the complete album object with:
- A newly assigned unique
id
- All the information you provided in the request
- The association with the artist
Authentication
Some endpoints are public, but some require authentication. We provide all the required endpoints to create an account and authorize yourself.
Create a user
Create a user account to access exclusive content about Argentine Rock legends. After signing up, you can access endpoints like GETGet all artists to explore the data.
Request Body
Responses
User Created Successfully
Your account has been created and you can now access the Argentine Rock Legends API.
Response Details
The response includes your user information (excluding the password) and your API key for authentication.
Important: Save your API key securely as it will be needed for authenticated requests.
Authenticate a user
Authenticate with your credentials to access protected endpoints in the Argentine Rock Legends API.
Request Body
Responses
Authentication Successful
You have been successfully authenticated.
Response Details
The response includes:
- Your user information
- Authentication tokens (JWT token and API key)
- Token expiration information
Important: Store these credentials securely and include them in subsequent API requests.
Custom Prefix
You can also customize the prefix of the badges by setting the operation.badgePrefix.{badgeName}
key in the i18n messages. For example, in your .vitepress/theme/index.ts
, before calling theme.enhanceApp({ app })
, you can set the following:
import { locales, theme, useTheme } from 'vitepress-openapi/client'
import DefaultTheme from 'vitepress/theme'
import 'vitepress-openapi/dist/style.css'
export default {
extends: DefaultTheme,
enhanceApp({ app }) {
useTheme({
i18n: {
messages: {
en: {
...locales.en,
'operation.badgePrefix.operationId': 'Operation ID: ',
},
es: {
...locales.es,
'operation.badgePrefix.operationId': 'ID de operación: ',
},
},
},
})
// Use the theme.
theme.enhanceApp({ app })
},
}