migrate examples to openApi part 38; affects [github] (#9889)

* migrate some services from examples to openApi

* Update services/github/github-size.service.js

Co-authored-by: Pierre-Yves Bigourdan <10694593+PyvesB@users.noreply.github.com>

---------

Co-authored-by: Pierre-Yves Bigourdan <10694593+PyvesB@users.noreply.github.com>
This commit is contained in:
chris48s
2024-01-13 18:31:59 +00:00
committed by GitHub
parent 5fa3435841
commit 5fb78c50ef
6 changed files with 150 additions and 257 deletions

View File

@@ -1,4 +1,5 @@
import Joi from 'joi'
import { pathParams } from '../index.js'
import { metric } from '../text-formatters.js'
import { nonNegativeInteger } from '../validators.js'
import { GithubAuthV3Service } from './github-auth-service.js'
@@ -11,18 +12,15 @@ const schema = Joi.object({
export default class GithubFollowers extends GithubAuthV3Service {
static category = 'social'
static route = { base: 'github/followers', pattern: ':user' }
static examples = [
{
title: 'GitHub followers',
namedParams: { user: 'espadrine' },
staticPreview: Object.assign(this.render({ followers: 150 }), {
label: 'Follow',
style: 'social',
}),
queryParams: { label: 'Follow' },
documentation,
static openApi = {
'/github/followers/{user}': {
get: {
summary: 'GitHub followers',
description: documentation,
parameters: pathParams({ name: 'user', example: 'espadrine' }),
},
},
]
}
static defaultBadgeData = { label: 'followers', namedLogo: 'github' }