Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit 968f00f

Browse files
committed
Adjust samchon/openapi#40 update.
In the JSON schema definition, it is nonsensible to inserting null value to enum property array. However, Github OpenAPI document is actually doing the crazy thing. This PR supports it by allowing the null value to the enum proeprty array.
1 parent d3ef8ed commit 968f00f

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@wrtnio/openai-function-schema",
3-
"version": "0.2.4",
3+
"version": "0.2.5",
44
"description": "OpenAI LLM function schema from OpenAPI (Swagger) document",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",
@@ -37,11 +37,11 @@
3737
"author": "",
3838
"license": "ISC",
3939
"dependencies": {
40-
"@nestia/fetcher": "^3.10.0",
41-
"@samchon/openapi": "^0.4.3",
40+
"@nestia/fetcher": "^3.11.1",
41+
"@samchon/openapi": "^0.4.6",
4242
"commander": "^10.0.0",
4343
"inquirer": "^8.2.5",
44-
"typia": "^6.7.2"
44+
"typia": "^6.8.0"
4545
},
4646
"devDependencies": {
4747
"@nestia/core": "^3.10.0",

src/structures/IOpenAiFunction.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,33 @@ export interface IOpenAiFunction {
7777

7878
/**
7979
* List of parameter schemas.
80+
*
81+
* If you've configured {@link IOpenAiDocument.IOptions.keyword} (as `true`),
82+
* number of {@link IOpenAiFunction.parameters} are always 1 and the first parameter's
83+
* type is always {@link IOpenAiSchema.IObject}. The properties' rule is:
84+
*
85+
* - `pathParameters`: Path parameters of {@link IMigrateRoute.parameters}
86+
* - `query`: Query parameter of {@link IMigrateRoute.query}
87+
* - `body`: Body parameter of {@link IMigrateRoute.body}
88+
*
89+
* ```typescript
90+
* {
91+
* ...pathParameters,
92+
* query,
93+
* body,
94+
* }
95+
* ```
96+
*
97+
* Otherwise, the parameters would be multiple, and the sequence of the parameters
98+
* are following below rules:
99+
*
100+
* ```typescript
101+
* [
102+
* ...pathParameters,
103+
* ...(query ? [query] : []),
104+
* ...(body ? [body] : []),
105+
* ]
106+
* ```
80107
*/
81108
parameters: IOpenAiSchema[];
82109

0 commit comments

Comments
 (0)