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:
@@ -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' }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user