-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from samchon/feat/multipart-formdata
Ban `multipart/form-data` type in the LLM
- Loading branch information
Showing
6 changed files
with
257 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { TestValidator } from "@nestia/e2e"; | ||
import { HttpLlm, IHttpLlmApplication, OpenApi } from "@samchon/openapi"; | ||
|
||
import swagger from "../../swagger.json"; | ||
|
||
export const test_http_llm_function_multipart = (): void => { | ||
const document: OpenApi.IDocument = OpenApi.convert(swagger as any); | ||
const application: IHttpLlmApplication = HttpLlm.application(document, { | ||
keyword: true, | ||
}); | ||
TestValidator.equals("multipart not suppported")( | ||
!!application.errors.find( | ||
(e) => | ||
e.method === "post" && | ||
e.path === "/{index}/{level}/{optimal}/multipart", | ||
), | ||
)(true); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import { TestValidator } from "@nestia/e2e"; | ||
import { HttpLlmConverter } from "@samchon/openapi/lib/converters/HttpLlmConverter"; | ||
|
||
export const test_llm_schema_recursive_array = (): void => { | ||
const schema = HttpLlmConverter.schema({ | ||
components: { | ||
schemas: { | ||
Department: { | ||
type: "object", | ||
properties: { | ||
id: { | ||
type: "string", | ||
format: "uuid", | ||
}, | ||
name: { | ||
type: "string", | ||
}, | ||
children: { | ||
type: "array", | ||
items: { | ||
$ref: "#/components/schemas/Department", | ||
}, | ||
}, | ||
}, | ||
required: ["id", "name", "children"], | ||
}, | ||
}, | ||
}, | ||
schema: { | ||
$ref: "#/components/schemas/Department", | ||
}, | ||
recursive: 3, | ||
}); | ||
TestValidator.equals("recursive")(schema)({ | ||
type: "object", | ||
properties: { | ||
id: { | ||
type: "string", | ||
format: "uuid", | ||
}, | ||
name: { | ||
type: "string", | ||
}, | ||
children: { | ||
type: "array", | ||
items: { | ||
type: "object", | ||
properties: { | ||
id: { | ||
type: "string", | ||
format: "uuid", | ||
}, | ||
name: { | ||
type: "string", | ||
}, | ||
children: { | ||
type: "array", | ||
items: { | ||
type: "object", | ||
properties: { | ||
id: { | ||
type: "string", | ||
format: "uuid", | ||
}, | ||
name: { | ||
type: "string", | ||
}, | ||
children: { | ||
type: "array", | ||
items: { | ||
type: "object", | ||
properties: { | ||
id: { | ||
type: "string", | ||
format: "uuid", | ||
}, | ||
name: { | ||
type: "string", | ||
}, | ||
children: { | ||
type: "array", | ||
items: {}, | ||
maxItems: 0, | ||
}, | ||
}, | ||
required: ["id", "name", "children"], | ||
additionalProperties: false, | ||
}, | ||
}, | ||
}, | ||
required: ["id", "name", "children"], | ||
additionalProperties: false, | ||
}, | ||
}, | ||
}, | ||
required: ["id", "name", "children"], | ||
additionalProperties: false, | ||
}, | ||
}, | ||
}, | ||
required: ["id", "name", "children"], | ||
additionalProperties: false, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters