1
0
mirror of https://github.com/badges/shields.git synced 2025-07-07 07:01:09 +03:00

migrate examples to openApi part 12; affects [GitHub Gist] (#9500)

* migrate some services from examples to openApi

* improve and de-dupe service titles

* improve description
This commit is contained in:
chris48s
2023-11-13 14:30:26 +00:00
committed by GitHub
parent 8f921a4078
commit 3512c89054
13 changed files with 246 additions and 140 deletions

View File

@ -1,4 +1,5 @@
import Joi from 'joi'
import { pathParams } from '../../index.js'
import { formatDate } from '../../text-formatters.js'
import { age as ageColor } from '../../color-formatters.js'
import { GithubAuthV3Service } from '../github-auth-service.js'
@ -11,17 +12,18 @@ const schema = Joi.object({
export default class GistLastCommit extends GithubAuthV3Service {
static category = 'activity'
static route = { base: 'github/gist/last-commit', pattern: ':gistId' }
static examples = [
{
title: 'GitHub Gist last commit',
namedParams: {
gistId: '8710649',
static openApi = {
'/github/gist/last-commit/{gistId}': {
get: {
summary: 'GitHub Gist last commit',
description: `Shows the latest commit to a GitHub Gist.\n${documentation}`,
parameters: pathParams({
name: 'gistId',
example: '8710649',
}),
},
staticPreview: this.render({ commitDate: '2022-07-29T20:01:41Z' }),
keywords: ['latest'],
documentation,
},
]
}
static defaultBadgeData = { label: 'last commit' }