@mittwald/api-code-generator 4.129.2 → 4.136.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,16 +6,17 @@ export class SecurityScheme {
6
6
  jsonSchema;
7
7
  constructor(schemes, name, doc) {
8
8
  this.name = new Name(name, schemes.name);
9
- this.in = doc.in;
9
+ this.in = doc.type === "http" ? "header" : doc.in;
10
+ const propName = doc.type === "http" ? "Authorization" : doc.name;
10
11
  this.jsonSchema = new JSONSchema(this.name, {
11
12
  type: "object",
12
13
  description: doc.description,
13
14
  properties: {
14
- [doc.name]: {
15
+ [propName]: {
15
16
  type: "string",
16
17
  },
17
18
  },
18
- required: [doc.name],
19
+ required: [propName],
19
20
  });
20
21
  }
21
22
  }
@@ -13,7 +13,7 @@ export class SecuritySchemes {
13
13
  this.name = new Name(SecuritySchemes.ns, components.name);
14
14
  Object.values(doc).forEach((scheme) => {
15
15
  assertNoRefs(scheme);
16
- invariant(scheme.type === "apiKey", `Security scheme type '${scheme.type}' is not supported (allowed types: 'apiKey')`);
16
+ invariant(scheme.type === "apiKey" || scheme.type === "http", `Security scheme type '${scheme.type}' is not supported (allowed types: 'apiKey', 'http')`);
17
17
  });
18
18
  this.schemes = Object.entries(doc).map(([name, scheme]) => new SecurityScheme(this, name, scheme));
19
19
  }
@@ -2,9 +2,10 @@ import { OpenAPIV3 } from "openapi-types";
2
2
  import { Name } from "../global/Name.js";
3
3
  import { SecuritySchemes } from "./SecuritySchemes.js";
4
4
  import { JSONSchema } from "../global/JSONSchema.js";
5
+ export type SecuritySchemeType = OpenAPIV3.ApiKeySecurityScheme | OpenAPIV3.HttpSecurityScheme;
5
6
  export declare class SecurityScheme {
6
7
  readonly in: string;
7
8
  readonly name: Name;
8
9
  readonly jsonSchema: JSONSchema;
9
- constructor(schemes: SecuritySchemes, name: string, doc: OpenAPIV3.ApiKeySecurityScheme);
10
+ constructor(schemes: SecuritySchemes, name: string, doc: SecuritySchemeType);
10
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/api-code-generator",
3
- "version": "4.129.2",
3
+ "version": "4.136.2",
4
4
  "type": "module",
5
5
  "repository": "https://github.com/mittwald/api-client-js.git",
6
6
  "license": "MIT",
@@ -84,5 +84,5 @@
84
84
  "@oclif/plugin-plugins"
85
85
  ]
86
86
  },
87
- "gitHead": "0a9a164a8d1538b916ef817470cbfd1bd87e8dcd"
87
+ "gitHead": "f45d5d8214395589994156260e493b542c9c8b7f"
88
88
  }