migrate examples to openApi part 2; affects [archlinux bitcomponents bountysource cdnjs chrome clearlydefined clojars cocoapods coincap] (#9428)
* convert an example that doesn't matter * migrate some services from examples to openApi * improve and de-dupe service titles * revert changes to codefactor
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import Joi from 'joi'
|
||||
import { renderVersionBadge } from '../version.js'
|
||||
import { BaseJsonService } from '../index.js'
|
||||
import { BaseJsonService, pathParams } from '../index.js'
|
||||
|
||||
const schema = Joi.object({
|
||||
pkgver: Joi.string().required(),
|
||||
@@ -13,17 +13,27 @@ export default class ArchLinux extends BaseJsonService {
|
||||
pattern: ':repository/:architecture/:packageName',
|
||||
}
|
||||
|
||||
static examples = [
|
||||
{
|
||||
title: 'Arch Linux package',
|
||||
namedParams: {
|
||||
architecture: 'x86_64',
|
||||
repository: 'core',
|
||||
packageName: 'pacman',
|
||||
static openApi = {
|
||||
'/archlinux/v/{repository}/{architecture}/{packageName}': {
|
||||
get: {
|
||||
summary: 'Arch Linux package',
|
||||
parameters: pathParams(
|
||||
{
|
||||
name: 'repository',
|
||||
example: 'core',
|
||||
},
|
||||
{
|
||||
name: 'architecture',
|
||||
example: 'x86_64',
|
||||
},
|
||||
{
|
||||
name: 'packageName',
|
||||
example: 'pacman',
|
||||
},
|
||||
),
|
||||
},
|
||||
staticPreview: renderVersionBadge({ version: '5.1.3' }),
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
static defaultBadgeData = { label: 'arch linux' }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user