migrate examples to openApi part 13; affects [curseforge date fedora hsts modrinth ore] (#9499)
* migrate some services from examples to openApi * improve and de-dupe service titles * improve ore description
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { formatRelativeDate } from '../text-formatters.js'
|
||||
import { BaseService } from '../index.js'
|
||||
import { BaseService, pathParams } from '../index.js'
|
||||
|
||||
const documentation = `
|
||||
const description = `
|
||||
<p>
|
||||
Supply a unix timestamp in seconds to display the relative time from/to now
|
||||
</p>
|
||||
@@ -11,16 +11,18 @@ export default class Date extends BaseService {
|
||||
static category = 'other'
|
||||
static route = { base: 'date', pattern: ':timestamp(-?[0-9]+)' }
|
||||
|
||||
static examples = [
|
||||
{
|
||||
title: 'Relative date',
|
||||
pattern: ':timestamp',
|
||||
namedParams: { timestamp: '1540814400' },
|
||||
staticPreview: this.render({ relativeDateString: '2 days ago' }),
|
||||
keywords: ['time', 'countdown', 'countup', 'moment'],
|
||||
documentation,
|
||||
static openApi = {
|
||||
'/date/{timestamp}': {
|
||||
get: {
|
||||
summary: 'Relative date',
|
||||
description,
|
||||
parameters: pathParams({
|
||||
name: 'timestamp',
|
||||
example: '1540814400',
|
||||
}),
|
||||
},
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
static defaultBadgeData = { label: 'date' }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user