From c3cc7746f33558c8f2d498675ebf4ac059a828f6 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Mon, 8 Jul 2024 16:15:01 +0900 Subject: [PATCH] Fix `ISwaggerSchema.IOneOf` type. Due to infinite bug from TypeScript compiler, made `ISwaggerSchema` type lighter by chaning `ISwaggerSchema.IOneOf` type manually, instead of utilizing its `OpenApi.IJsonSchema.IOneOf` argument. --- package.json | 2 +- src/structures/ISwaggerSchema.ts | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 29ab2e0..ba6128d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@wrtnio/openai-function-schema", - "version": "0.1.2", + "version": "0.1.3", "description": "OpenAI LLM function schema from OpenAPI (Swagger) document", "main": "lib/index.js", "typings": "lib/index.d.ts", diff --git a/src/structures/ISwaggerSchema.ts b/src/structures/ISwaggerSchema.ts index 5647b45..3b69660 100644 --- a/src/structures/ISwaggerSchema.ts +++ b/src/structures/ISwaggerSchema.ts @@ -120,9 +120,12 @@ export namespace ISwaggerSchema { * defined `anyOf` instead of the `oneOf`, {@link OpenApi} forcibly * converts it to `oneOf` type. */ - export interface IOneOf - extends OpenApi.IJsonSchema.IOneOf, - __IPlugin {} + export interface IOneOf extends OpenApi.IJsonSchema.__IAttribute, __IPlugin { + /** + * List of the union types. + */ + oneOf: Exclude[]; + } /** * Null type.