({ category, services, sort = false })
| 94 | } |
| 95 | |
| 96 | function category2openapi({ category, services, sort = false }) { |
| 97 | const spec = { |
| 98 | openapi: '3.0.0', |
| 99 | info: { |
| 100 | version: '1.0.0', |
| 101 | title: category.name, |
| 102 | license: { |
| 103 | name: 'CC0', |
| 104 | }, |
| 105 | }, |
| 106 | servers: baseUrl ? [{ url: baseUrl }] : undefined, |
| 107 | components: { |
| 108 | parameters: { |
| 109 | style: { |
| 110 | name: 'style', |
| 111 | in: 'query', |
| 112 | required: false, |
| 113 | description: `If not specified, the default style for this badge is "${ |
| 114 | category.name.toLowerCase() === 'social' ? 'social' : 'flat' |
| 115 | }".`, |
| 116 | schema: { |
| 117 | type: 'string', |
| 118 | enum: ['flat', 'flat-square', 'plastic', 'for-the-badge', 'social'], |
| 119 | }, |
| 120 | example: 'flat', |
| 121 | }, |
| 122 | logo: { |
| 123 | name: 'logo', |
| 124 | in: 'query', |
| 125 | required: false, |
| 126 | description: |
| 127 | 'Icon slug from simple-icons. You can click the icon title on <a href="https://simpleicons.org/" rel="noopener noreferrer" target="_blank">simple-icons</a> to copy the slug or they can be found in the <a href="https://github.com/simple-icons/simple-icons/blob/master/slugs.md">slugs.md file</a> in the simple-icons repository. <a href="/docs/logos">Further info</a>.', |
| 128 | schema: { |
| 129 | type: 'string', |
| 130 | }, |
| 131 | example: 'appveyor', |
| 132 | }, |
| 133 | logoColor: { |
| 134 | name: 'logoColor', |
| 135 | in: 'query', |
| 136 | required: false, |
| 137 | description: |
| 138 | 'The color of the logo (hex, rgb, rgba, hsl, hsla and css named colors supported). Supported for simple-icons logos but not for custom logos.', |
| 139 | schema: { |
| 140 | type: 'string', |
| 141 | }, |
| 142 | example: 'violet', |
| 143 | }, |
| 144 | logoSize: { |
| 145 | name: 'logoSize', |
| 146 | in: 'query', |
| 147 | required: false, |
| 148 | description: |
| 149 | 'Make icons adaptively resize by setting `auto`. Useful for some wider logos like `amd` and `amg`. Supported for simple-icons logos but not for custom logos.', |
| 150 | schema: { |
| 151 | type: 'string', |
| 152 | }, |
| 153 | example: 'auto', |
no test coverage detected