Skip to content

Commit e043bd3

Browse files
committed
Depend on external openapi types
1 parent a10a980 commit e043bd3

8 files changed

Lines changed: 12 additions & 1252 deletions

File tree

examples/simple/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { OpenAPIV3_1 } from '../../src/openapi/types';
1+
import type { OpenAPIV3_1 } from 'openapi-types';
22

33
/**
44
* We use an embedded elements

examples/valibot/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { OpenAPIV3_1 } from '../../src/openapi/types';
1+
import type { OpenAPIV3_1 } from 'openapi-types';
22

33
/**
44
* We use an embedded elements

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
"dependencies": {
8585
"@standard-community/standard-openapi": "^0.2.0",
8686
"@standard-schema/spec": "^1.0.0",
87-
"itty-router": "^5"
87+
"itty-router": "^5",
88+
"openapi-types": "=12.1.3"
8889
}
8990
}

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/openapi/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
RequestByContentType,
77
ResponseByContentType,
88
} from '../types';
9-
import type { OpenAPIV3_1 } from './types';
9+
import type { OpenAPIV3_1 } from 'openapi-types';
1010
import { extractSchemaAsync } from './vendors/index';
1111

1212
/**
@@ -254,7 +254,7 @@ export const createOpenApiSpecification = async (
254254
export const createOpenApiInfo = (options: OpenApiSpecificationOptions): OpenAPIV3_1.InfoObject => {
255255
return {
256256
title: options.title,
257-
version: options.version,
257+
version: options.version || '0.0.0',
258258
description: options.description,
259259
termsOfService: options.termsOfService,
260260
contact: options.contact,
@@ -541,7 +541,7 @@ export const createOpenApiPaths = async (
541541
paths[openApiPath] = {};
542542
}
543543
const pathItem = paths[openApiPath]!;
544-
const method = operation.method.toLowerCase() as HttpMethod;
544+
const method = operation.method.toLowerCase() as Lowercase<HttpMethod>;
545545
pathItem[method] = await createOpenApiOperation(operation, registry, operationId);
546546
}
547547
return paths;

0 commit comments

Comments
 (0)