Skip to content

Commit 8158488

Browse files
refactor: Rename OpenAPI type to OpenAPICore and update related references
1 parent 38ee2b0 commit 8158488

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

mod.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export * from "./src/Core.types.ts";
22
export * from "./src/Licenses.types.ts";
3+
export * from "./src/Core.ts";

src/Core.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type {
2-
OpenAPI as OpenAPI_3_1,
2+
OpenAPICore,
33
OpenAPISecurityRequirement,
44
OpenAPITag,
55
} from './Core.types.ts';
@@ -8,7 +8,7 @@ import { createEndpointPath, type EndpointPath } from './EndpointPath.ts';
88
import type { AllowedLicenses } from './Licenses.types.ts';
99

1010
class OpenAPI {
11-
private raw: OpenAPI_3_1;
11+
private raw: OpenAPICore;
1212

1313
constructor() {
1414
this.raw = {
@@ -20,7 +20,7 @@ class OpenAPI {
2020
};
2121
}
2222

23-
getJSON() {
23+
getJSON(): OpenAPICore {
2424
return this.raw;
2525
}
2626

@@ -80,7 +80,7 @@ class OpenAPI {
8080
return this;
8181
}
8282

83-
addEndpointPath(endpointPath: EndpointPath) {
83+
addEndpointPath(endpointPath: EndpointPath): this {
8484
if (!this.raw.paths) {
8585
this.raw.paths = {};
8686
}

src/Core.types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type OpenAPIMethodsLowercase = Lowercase<OpenAPIMethods>;
2323
*
2424
* @see https://spec.openapis.org/oas/v3.1.0.html#openapi-object
2525
*/
26-
type OpenAPI = {
26+
type OpenAPICore = {
2727
openapi: string; // supported
2828
info: OpenAPIInfo; // supported
2929
jsonSchemaDialect?: string; // supported
@@ -771,7 +771,7 @@ type OpenAPITag = {
771771
};
772772

773773
export type {
774-
OpenAPI,
774+
OpenAPICore,
775775
OpenAPICallback,
776776
OpenAPIComponents,
777777
OpenAPIContact,

0 commit comments

Comments
 (0)