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