Skip to content

Commit f345f6e

Browse files
committed
feat: add bearer schema to generator
1 parent d7ef06b commit f345f6e

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

packages/generators-v2/src/transformer.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@ import * as codeSamples from './code-samples/index.js';
22

33
export function transformSchema(schema, options) {
44
const updatedSchema = { ...schema };
5+
if (!updatedSchema.components) {
6+
updatedSchema.components = {};
7+
}
8+
updatedSchema.components = {
9+
securitySchemes: {
10+
'access-token': {
11+
scheme: 'bearer',
12+
bearerFormat: '<YOUR_AIMLAPI_KEY>',
13+
type: 'http',
14+
description: 'Bearer key',
15+
},
16+
},
17+
};
518
if (!options.hideTryItPanel || options.hideTryItPanel === true) {
619
Object.entries(updatedSchema.paths).map(([path, operation]) => {
720
for (const method of ['get', 'post']) {

0 commit comments

Comments
 (0)