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 prettyBytes from 'pretty-bytes'
import { pathParams } from '../index.js'
import { BaseGithubLanguage } from './github-languages-base.js'
import { documentation } from './github-helpers.js'
@@ -9,17 +10,24 @@ export default class GithubCodeSize extends BaseGithubLanguage {
pattern: ':user/:repo',
}
static examples = [
{
title: 'GitHub code size in bytes',
namedParams: {
user: 'badges',
repo: 'shields',
static openApi = {
'/github/languages/code-size/{user}/{repo}': {
get: {
summary: 'GitHub code size in bytes',
description: documentation,
parameters: pathParams(
{
name: 'user',
example: 'badges',
},
{
name: 'repo',
example: 'shields',
},
),
},
staticPreview: this.render({ size: 1625000 }),
documentation,
},
]
}
static defaultBadgeData = { label: 'code size' }