migrate examples to openApi part 7; affects [reuse sourceforge sourcegraph spack stackexchange testspace treeware twitch] (#9464)

* migrate some services from examples to openApi

* capitalize all words in sourceforge titles
This commit is contained in:
chris48s
2023-09-04 11:02:05 +01:00
committed by GitHub
parent d1798167cc
commit 0bc512707f
15 changed files with 189 additions and 138 deletions

View File

@@ -1,5 +1,5 @@
import Joi from 'joi'
import { BaseJsonService } from '../index.js'
import { BaseJsonService, pathParams } from '../index.js'
const projectsCountRegex = /^\s[0-9]*(\.[0-9]k)?\sprojects$/
const schema = Joi.object({
@@ -14,16 +14,17 @@ export default class Sourcegraph extends BaseJsonService {
pattern: ':repo(.*?)',
}
static examples = [
{
title: 'Sourcegraph for Repo Reference Count',
pattern: ':repo',
namedParams: {
repo: 'github.com/gorilla/mux',
static openApi = {
'/sourcegraph/rrc/{repo}': {
get: {
summary: 'Sourcegraph for Repo Reference Count',
parameters: pathParams({
name: 'repo',
example: 'github.com/gorilla/mux',
}),
},
staticPreview: this.render({ projectsCount: '9.9k projects' }),
},
]
}
static defaultBadgeData = { color: 'brightgreen', label: 'used by' }