migrate some services from examples to openApi part 45; affects [github coveralls visualstudiomarketplace] (#9930)

* migrate some services from examples to openApi

* update e2e test to use simpler example
This commit is contained in:
chris48s
2024-02-11 13:04:42 +00:00
committed by GitHub
parent 79bd5f3837
commit 095e4f889a
8 changed files with 185 additions and 373 deletions

View File

@@ -1,6 +1,6 @@
import Joi from 'joi'
import { coveragePercentage } from '../color-formatters.js'
import { BaseJsonService } from '../index.js'
import { BaseJsonService, pathParam, queryParam } from '../index.js'
const schema = Joi.object({
covered_percent: Joi.number().min(0).max(100).required(),
@@ -18,23 +18,23 @@ export default class Coveralls extends BaseJsonService {
queryParamSchema,
}
static examples = [
{
title: 'Coveralls',
namedParams: { vcsType: 'github', user: 'jekyll', repo: 'jekyll' },
staticPreview: this.render({ coverage: 86 }),
},
{
title: 'Coveralls branch',
namedParams: {
vcsType: 'bitbucket',
user: 'pyKLIP',
repo: 'pyklip',
static openApi = {
'/coverallsCoverage/{vcsType}/{user}/{repo}': {
get: {
summary: 'Coveralls',
parameters: [
pathParam({
name: 'vcsType',
example: 'github',
schema: { type: 'string', enum: this.getEnum('vcsType') },
}),
pathParam({ name: 'user', example: 'jekyll' }),
pathParam({ name: 'repo', example: 'jekyll' }),
queryParam({ name: 'branch', example: 'master' }),
],
},
queryParams: { branch: 'master' },
staticPreview: this.render({ coverage: 96 }),
},
]
}
static defaultBadgeData = { label: 'coverage' }