diff --git a/debug/src/llm.ts b/debug/src/llm.ts new file mode 100644 index 0000000000..c11ae0280d --- /dev/null +++ b/debug/src/llm.ts @@ -0,0 +1,19 @@ +import { ILlmApplication } from "@samchon/openapi"; +import typia from "typia"; + +interface ICalculator { + /** + * @deprecated + */ + plus(x: number, y: number): number; + + /** + * @tag arithmetic + * @tag mathmatics + * @tag something for nothing + */ + minus(x: number, y: number): number; +} + +const app: ILlmApplication = typia.llm.application(); +console.log(app.functions[1]?.tags); diff --git a/package.json b/package.json index 76115d7230..528c4db0ab 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ }, "homepage": "https://typia.io", "dependencies": { - "@samchon/openapi": "^1.0.2", + "@samchon/openapi": "^1.0.6", "commander": "^10.0.0", "comment-json": "^4.2.3", "inquirer": "^8.2.5", diff --git a/src/programmers/llm/LlmApplicationProgrammer.ts b/src/programmers/llm/LlmApplicationProgrammer.ts index 908df475f3..6e5801892b 100644 --- a/src/programmers/llm/LlmApplicationProgrammer.ts +++ b/src/programmers/llm/LlmApplicationProgrammer.ts @@ -104,38 +104,57 @@ export namespace LlmApplicationProgrammer { function: MetadataFunction; description: string | null; jsDocTags: IJsDocTagInfo[]; - }): ILlmFunction => ({ - name: props.name, - parameters: props.function.parameters.map((p) => { - const jsDocTagDescription = writeDescriptionFromJsDocTag({ - jsDocTags: p.jsDocTags, - tag: "param", - parameter: p.name, - }); - return writeSchema({ - metadata: p.type, - description: jsDocTagDescription ?? p.description, - jsDocTags: jsDocTagDescription ? [] : p.jsDocTags, - }); - }), - output: - props.function.output.size() || props.function.output.nullable - ? writeSchema({ - metadata: props.function.output, - description: - writeDescriptionFromJsDocTag({ - jsDocTags: props.jsDocTags, - tag: "return", - }) ?? - writeDescriptionFromJsDocTag({ - jsDocTags: props.jsDocTags, - tag: "returns", - }), - jsDocTags: [], - }) - : undefined, - description: props.description ?? undefined, - }); + }): ILlmFunction => { + const deprecated: boolean = props.jsDocTags.some( + (tag) => tag.name === "deprecated", + ); + const tags: string[] = props.jsDocTags + .map((tag) => + tag.name === "tag" + ? (tag.text?.filter((elem) => elem.kind === "text") ?? []) + : [], + ) + .flat() + .map((elem) => elem.text) + .map((str) => str.trim().split(" ")[0] ?? "") + .filter((str) => !!str.length); + return { + name: props.name, + parameters: props.function.parameters.map((p) => { + const jsDocTagDescription: string | null = writeDescriptionFromJsDocTag( + { + jsDocTags: p.jsDocTags, + tag: "param", + parameter: p.name, + }, + ); + return writeSchema({ + metadata: p.type, + description: jsDocTagDescription ?? p.description, + jsDocTags: jsDocTagDescription ? [] : p.jsDocTags, + }); + }), + output: + props.function.output.size() || props.function.output.nullable + ? writeSchema({ + metadata: props.function.output, + description: + writeDescriptionFromJsDocTag({ + jsDocTags: props.jsDocTags, + tag: "return", + }) ?? + writeDescriptionFromJsDocTag({ + jsDocTags: props.jsDocTags, + tag: "returns", + }), + jsDocTags: [], + }) + : undefined, + description: props.description ?? undefined, + deprecated: deprecated || undefined, + tags: tags.length ? tags : undefined, + }; + }; const writeSchema = (props: { metadata: Metadata; diff --git a/src/tags/Example.ts b/src/tags/Example.ts new file mode 100644 index 0000000000..927d3c4795 --- /dev/null +++ b/src/tags/Example.ts @@ -0,0 +1,17 @@ +import { TagBase } from "./TagBase"; + +export type Example< + Value extends boolean | bigint | number | string | Array | null, +> = TagBase<{ + target: "boolean" | "bigint" | "number" | "string" | "array"; + kind: "example"; + value: Value; + exclusive: true; + schema: Value extends bigint + ? { example: Numeric } + : { example: Value }; +}>; + +type Numeric = `${T}` extends `${infer N extends number}` + ? N + : never; diff --git a/src/tags/Examples.ts b/src/tags/Examples.ts new file mode 100644 index 0000000000..72f1971f0c --- /dev/null +++ b/src/tags/Examples.ts @@ -0,0 +1,16 @@ +import { TagBase } from "./TagBase"; + +export type Examples< + Dict extends Record< + string, + boolean | bigint | number | string | Array | null + >, +> = TagBase<{ + target: "boolean" | "bigint" | "number" | "string" | "array"; + kind: "examples"; + value: Dict; + exclusive: true; + schema: { + examples: Dict; + }; +}>; diff --git a/src/tags/index.ts b/src/tags/index.ts index ad175df225..e4f84ff1f0 100644 --- a/src/tags/index.ts +++ b/src/tags/index.ts @@ -1,6 +1,8 @@ export * from "./Constant"; export * from "./ContentMediaType"; export * from "./Default"; +export * from "./Example"; +export * from "./Examples"; export * from "./ExclusiveMaximum"; export * from "./ExclusiveMinimum"; export * from "./Format"; diff --git a/test/schemas/json/v3_0/UltimateUnion.json b/test/schemas/json/v3_0/UltimateUnion.json index 537a04bcda..33f8047036 100644 --- a/test/schemas/json/v3_0/UltimateUnion.json +++ b/test/schemas/json/v3_0/UltimateUnion.json @@ -137,6 +137,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "nullable": false, @@ -145,6 +154,13 @@ ], "description": "Constant value type." }, + "Recordstringany": { + "type": "object", + "properties": {}, + "nullable": false, + "description": "Construct a type with a set of properties K of type T", + "additionalProperties": {} + }, "OpenApi.IJsonSchema.IBoolean": { "type": "object", "properties": { @@ -175,6 +191,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "nullable": false, @@ -240,6 +265,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "nullable": false, @@ -305,6 +339,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "nullable": false, @@ -368,6 +411,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "nullable": false, @@ -421,6 +473,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "nullable": false, @@ -523,6 +584,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "nullable": false, @@ -615,6 +685,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "nullable": false, @@ -645,6 +724,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "nullable": false, @@ -717,6 +805,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "nullable": false, @@ -755,6 +852,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "nullable": false, @@ -780,6 +886,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "nullable": false, diff --git a/test/schemas/json/v3_1/UltimateUnion.json b/test/schemas/json/v3_1/UltimateUnion.json index 81e3ab7f40..852f99cef9 100644 --- a/test/schemas/json/v3_1/UltimateUnion.json +++ b/test/schemas/json/v3_1/UltimateUnion.json @@ -132,6 +132,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "required": [ @@ -139,6 +148,12 @@ ], "description": "Constant value type." }, + "Recordstringany": { + "type": "object", + "properties": {}, + "description": "Construct a type with a set of properties K of type T", + "additionalProperties": {} + }, "OpenApi.IJsonSchema.IBoolean": { "type": "object", "properties": { @@ -166,6 +181,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "required": [ @@ -227,6 +251,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "required": [ @@ -288,6 +321,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "required": [ @@ -347,6 +389,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "required": [ @@ -396,6 +447,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "required": [ @@ -494,6 +554,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "required": [ @@ -582,6 +651,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "required": [ @@ -611,6 +689,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "required": [ @@ -682,6 +769,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "required": [ @@ -716,6 +812,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "required": [ @@ -740,6 +845,15 @@ "type": "boolean", "title": "Whether the type is deprecated or not", "description": "Whether the type is deprecated or not." + }, + "example": { + "title": "Example value", + "description": "Example value." + }, + "examples": { + "$ref": "#/components/schemas/Recordstringany", + "title": "List of example values as key-value pairs", + "description": "List of example values as key-value pairs." } }, "description": "Unknown, `any` type." diff --git a/test/schemas/reflect/metadata/UltimateUnion.json b/test/schemas/reflect/metadata/UltimateUnion.json index b54fb20ade..7e4f35dbb5 100644 --- a/test/schemas/reflect/metadata/UltimateUnion.json +++ b/test/schemas/reflect/metadata/UltimateUnion.json @@ -688,6 +688,110 @@ }, "description": "Whether the type is deprecated or not.", "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "example" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": true, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "Example value.", + "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "examples" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": false, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [ + "Record" + ], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "List of example values as key-value pairs.", + "jsDocTags": [] } ], "description": "Constant value type.", @@ -698,6 +802,65 @@ false ] }, + { + "name": "Record", + "properties": [ + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [ + { + "type": "string", + "tags": [] + } + ], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": true, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": null, + "jsDocTags": [] + } + ], + "description": "Construct a type with a set of properties K of type T", + "jsDocTags": [], + "index": 4, + "recursive": false, + "nullables": [ + false + ] + }, { "name": "OpenApi.IJsonSchema.IBoolean", "properties": [ @@ -985,11 +1148,115 @@ }, "description": "Whether the type is deprecated or not.", "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "example" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": true, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "Example value.", + "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "examples" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": false, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [ + "Record" + ], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "List of example values as key-value pairs.", + "jsDocTags": [] } ], "description": "Boolean type info.", "jsDocTags": [], - "index": 4, + "index": 5, "recursive": false, "nullables": [ false @@ -1682,11 +1949,115 @@ }, "description": "Whether the type is deprecated or not.", "jsDocTags": [] - } + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "example" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": true, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "Example value.", + "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "examples" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": false, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [ + "Record" + ], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "List of example values as key-value pairs.", + "jsDocTags": [] + } ], "description": "Integer type info.", "jsDocTags": [], - "index": 5, + "index": 6, "recursive": false, "nullables": [ false @@ -2287,11 +2658,115 @@ }, "description": "Whether the type is deprecated or not.", "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "example" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": true, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "Example value.", + "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "examples" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": false, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [ + "Record" + ], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "List of example values as key-value pairs.", + "jsDocTags": [] } ], "description": "Number (double) type info.", "jsDocTags": [], - "index": 6, + "index": 7, "recursive": false, "nullables": [ false @@ -2912,19 +3387,7 @@ }, "description": "Whether the type is deprecated or not.", "jsDocTags": [] - } - ], - "description": "String type info.", - "jsDocTags": [], - "index": 7, - "recursive": false, - "nullables": [ - false - ] - }, - { - "name": "OpenApi.IJsonSchema.IArray", - "properties": [ + }, { "key": { "any": false, @@ -2938,7 +3401,7 @@ "type": "string", "values": [ { - "value": "items" + "value": "example" } ] } @@ -2955,9 +3418,9 @@ "maps": [] }, "value": { - "any": false, + "any": true, "required": true, - "optional": false, + "optional": true, "nullable": false, "functions": [], "atomics": [], @@ -2967,26 +3430,13 @@ "rest": null, "arrays": [], "tuples": [], - "objects": [ - "OpenApi.IJsonSchema.IConstant", - "OpenApi.IJsonSchema.IBoolean", - "OpenApi.IJsonSchema.INumber", - "OpenApi.IJsonSchema.IInteger", - "OpenApi.IJsonSchema.IString", - "OpenApi.IJsonSchema.IArray", - "OpenApi.IJsonSchema.ITuple", - "OpenApi.IJsonSchema.IObject", - "OpenApi.IJsonSchema.IReference", - "OpenApi.IJsonSchema.IOneOf", - "OpenApi.IJsonSchema.INull", - "OpenApi.IJsonSchema.IUnknown" - ], + "objects": [], "aliases": [], "natives": [], "sets": [], "maps": [] }, - "description": "Items type info.\n\nThe `items` means the type of the array elements. In other words, it is\nthe type schema info of the `T` in the TypeScript array type `Array`.", + "description": "Example value.", "jsDocTags": [] }, { @@ -3002,7 +3452,7 @@ "type": "string", "values": [ { - "value": "uniqueItems" + "value": "examples" } ] } @@ -3024,35 +3474,164 @@ "optional": true, "nullable": false, "functions": [], - "atomics": [ - { - "type": "boolean", - "tags": [] - } - ], + "atomics": [], "constants": [], "templates": [], "escaped": null, "rest": null, "arrays": [], "tuples": [], - "objects": [], + "objects": [ + "Record" + ], "aliases": [], "natives": [], "sets": [], "maps": [] }, - "description": "Unique items restriction.\n\nIf this property value is `true`, target array must have unique items.", + "description": "List of example values as key-value pairs.", "jsDocTags": [] - }, - { - "key": { - "any": false, - "required": true, - "optional": false, - "nullable": false, - "functions": [], - "atomics": [], + } + ], + "description": "String type info.", + "jsDocTags": [], + "index": 8, + "recursive": false, + "nullables": [ + false + ] + }, + { + "name": "OpenApi.IJsonSchema.IArray", + "properties": [ + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "items" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [ + "OpenApi.IJsonSchema.IConstant", + "OpenApi.IJsonSchema.IBoolean", + "OpenApi.IJsonSchema.INumber", + "OpenApi.IJsonSchema.IInteger", + "OpenApi.IJsonSchema.IString", + "OpenApi.IJsonSchema.IArray", + "OpenApi.IJsonSchema.ITuple", + "OpenApi.IJsonSchema.IObject", + "OpenApi.IJsonSchema.IReference", + "OpenApi.IJsonSchema.IOneOf", + "OpenApi.IJsonSchema.INull", + "OpenApi.IJsonSchema.IUnknown" + ], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "Items type info.\n\nThe `items` means the type of the array elements. In other words, it is\nthe type schema info of the `T` in the TypeScript array type `Array`.", + "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "uniqueItems" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": false, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [ + { + "type": "boolean", + "tags": [] + } + ], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "Unique items restriction.\n\nIf this property value is `true`, target array must have unique items.", + "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], "constants": [ { "type": "string", @@ -3433,11 +4012,115 @@ }, "description": "Whether the type is deprecated or not.", "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "example" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": true, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "Example value.", + "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "examples" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": false, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [ + "Record" + ], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "List of example values as key-value pairs.", + "jsDocTags": [] } ], "description": "Array type info.", "jsDocTags": [], - "index": 8, + "index": 9, "recursive": true, "nullables": [ false @@ -4015,19 +4698,7 @@ }, "description": "Whether the type is deprecated or not.", "jsDocTags": [] - } - ], - "description": "Tuple type info.", - "jsDocTags": [], - "index": 9, - "recursive": true, - "nullables": [ - false - ] - }, - { - "name": "OpenApi.IJsonSchema.IObject", - "properties": [ + }, { "key": { "any": false, @@ -4041,7 +4712,123 @@ "type": "string", "values": [ { - "value": "properties" + "value": "example" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": true, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "Example value.", + "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "examples" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": false, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [ + "Record" + ], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "List of example values as key-value pairs.", + "jsDocTags": [] + } + ], + "description": "Tuple type info.", + "jsDocTags": [], + "index": 10, + "recursive": true, + "nullables": [ + false + ] + }, + { + "name": "OpenApi.IJsonSchema.IObject", + "properties": [ + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "properties" } ] } @@ -4434,11 +5221,115 @@ }, "description": "Whether the type is deprecated or not.", "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "example" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": true, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "Example value.", + "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "examples" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": false, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [ + "Record" + ], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "List of example values as key-value pairs.", + "jsDocTags": [] } ], "description": "Object type info.", "jsDocTags": [], - "index": 10, + "index": 11, "recursive": true, "nullables": [ false @@ -4594,12 +5485,512 @@ "optional": true, "nullable": false, "functions": [], - "atomics": [ - { - "type": "string", - "tags": [] - } - ], + "atomics": [ + { + "type": "string", + "tags": [] + } + ], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "Detailed description of the schema.", + "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "deprecated" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": false, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [ + { + "type": "boolean", + "tags": [] + } + ], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "Whether the type is deprecated or not.", + "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "example" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": true, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "Example value.", + "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "examples" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": false, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [ + "Record" + ], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "List of example values as key-value pairs.", + "jsDocTags": [] + } + ], + "description": "Reference type directing named schema.", + "jsDocTags": [], + "index": 12, + "recursive": false, + "nullables": [ + false + ] + }, + { + "name": "OpenApi.IJsonSchema.IOneOf", + "properties": [ + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "oneOf" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [ + { + "name": "Array | ITuple | IObject<...> | IReference<...> | INull | IUnknown>", + "tags": [] + } + ], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "List of the union types.", + "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "discriminator" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": false, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [ + "OpenApi.IJsonSchema.IOneOf.IDiscriminator" + ], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "Discriminator info of the union type.", + "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "title" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": false, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [ + { + "type": "string", + "tags": [] + } + ], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "Title of the schema.", + "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "description" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": false, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [ + { + "type": "string", + "tags": [] + } + ], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "Detailed description of the schema.", + "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "deprecated" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": false, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [ + { + "type": "boolean", + "tags": [] + } + ], + "constants": [], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "description": "Whether the type is deprecated or not.", + "jsDocTags": [] + }, + { + "key": { + "any": false, + "required": true, + "optional": false, + "nullable": false, + "functions": [], + "atomics": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "example" + } + ] + } + ], + "templates": [], + "escaped": null, + "rest": null, + "arrays": [], + "tuples": [], + "objects": [], + "aliases": [], + "natives": [], + "sets": [], + "maps": [] + }, + "value": { + "any": true, + "required": true, + "optional": true, + "nullable": false, + "functions": [], + "atomics": [], "constants": [], "templates": [], "escaped": null, @@ -4612,7 +6003,7 @@ "sets": [], "maps": [] }, - "description": "Detailed description of the schema.", + "description": "Example value.", "jsDocTags": [] }, { @@ -4628,7 +6019,7 @@ "type": "string", "values": [ { - "value": "deprecated" + "value": "examples" } ] } @@ -4650,38 +6041,35 @@ "optional": true, "nullable": false, "functions": [], - "atomics": [ - { - "type": "boolean", - "tags": [] - } - ], + "atomics": [], "constants": [], "templates": [], "escaped": null, "rest": null, "arrays": [], "tuples": [], - "objects": [], + "objects": [ + "Record" + ], "aliases": [], "natives": [], "sets": [], "maps": [] }, - "description": "Whether the type is deprecated or not.", + "description": "List of example values as key-value pairs.", "jsDocTags": [] } ], - "description": "Reference type directing named schema.", + "description": "Union type.\n\nIOneOf` represents an union type of the TypeScript (`A | B | C`).\n\nFor reference, even though your Swagger (or OpenAPI) document has\ndefined `anyOf` instead of the `oneOf`, {@link OpenApi} forcibly\nconverts it to `oneOf` type.", "jsDocTags": [], - "index": 11, - "recursive": false, + "index": 13, + "recursive": true, "nullables": [ false ] }, { - "name": "OpenApi.IJsonSchema.IOneOf", + "name": "OpenApi.IJsonSchema.INull", "properties": [ { "key": { @@ -4696,7 +6084,7 @@ "type": "string", "values": [ { - "value": "oneOf" + "value": "default" } ] } @@ -4715,20 +6103,15 @@ "value": { "any": false, "required": true, - "optional": false, - "nullable": false, + "optional": true, + "nullable": true, "functions": [], "atomics": [], "constants": [], "templates": [], "escaped": null, "rest": null, - "arrays": [ - { - "name": "Array | ITuple | IObject<...> | IReference<...> | INull | IUnknown>", - "tags": [] - } - ], + "arrays": [], "tuples": [], "objects": [], "aliases": [], @@ -4736,7 +6119,7 @@ "sets": [], "maps": [] }, - "description": "List of the union types.", + "description": "Default value.", "jsDocTags": [] }, { @@ -4752,7 +6135,7 @@ "type": "string", "values": [ { - "value": "discriminator" + "value": "type" } ] } @@ -4771,25 +6154,33 @@ "value": { "any": false, "required": true, - "optional": true, + "optional": false, "nullable": false, "functions": [], "atomics": [], - "constants": [], + "constants": [ + { + "type": "string", + "values": [ + { + "value": "null", + "tags": [] + } + ] + } + ], "templates": [], "escaped": null, "rest": null, "arrays": [], "tuples": [], - "objects": [ - "OpenApi.IJsonSchema.IOneOf.IDiscriminator" - ], + "objects": [], "aliases": [], "natives": [], "sets": [], "maps": [] }, - "description": "Discriminator info of the union type.", + "description": "Discriminator value of the type.", "jsDocTags": [] }, { @@ -4959,19 +6350,7 @@ }, "description": "Whether the type is deprecated or not.", "jsDocTags": [] - } - ], - "description": "Union type.\n\nIOneOf` represents an union type of the TypeScript (`A | B | C`).\n\nFor reference, even though your Swagger (or OpenAPI) document has\ndefined `anyOf` instead of the `oneOf`, {@link OpenApi} forcibly\nconverts it to `oneOf` type.", - "jsDocTags": [], - "index": 12, - "recursive": true, - "nullables": [ - false - ] - }, - { - "name": "OpenApi.IJsonSchema.INull", - "properties": [ + }, { "key": { "any": false, @@ -4985,7 +6364,7 @@ "type": "string", "values": [ { - "value": "default" + "value": "example" } ] } @@ -5002,10 +6381,10 @@ "maps": [] }, "value": { - "any": false, + "any": true, "required": true, "optional": true, - "nullable": true, + "nullable": false, "functions": [], "atomics": [], "constants": [], @@ -5020,7 +6399,7 @@ "sets": [], "maps": [] }, - "description": "Default value.", + "description": "Example value.", "jsDocTags": [] }, { @@ -5036,7 +6415,7 @@ "type": "string", "values": [ { - "value": "type" + "value": "examples" } ] } @@ -5055,35 +6434,39 @@ "value": { "any": false, "required": true, - "optional": false, + "optional": true, "nullable": false, "functions": [], "atomics": [], - "constants": [ - { - "type": "string", - "values": [ - { - "value": "null", - "tags": [] - } - ] - } - ], + "constants": [], "templates": [], "escaped": null, "rest": null, "arrays": [], "tuples": [], - "objects": [], + "objects": [ + "Record" + ], "aliases": [], "natives": [], "sets": [], "maps": [] }, - "description": "Discriminator value of the type.", + "description": "List of example values as key-value pairs.", "jsDocTags": [] - }, + } + ], + "description": "Null type.", + "jsDocTags": [], + "index": 14, + "recursive": false, + "nullables": [ + false + ] + }, + { + "name": "OpenApi.IJsonSchema.IUnknown", + "properties": [ { "key": { "any": false, @@ -5097,7 +6480,7 @@ "type": "string", "values": [ { - "value": "title" + "value": "type" } ] } @@ -5115,16 +6498,11 @@ }, "value": { "any": false, - "required": true, + "required": false, "optional": true, "nullable": false, "functions": [], - "atomics": [ - { - "type": "string", - "tags": [] - } - ], + "atomics": [], "constants": [], "templates": [], "escaped": null, @@ -5137,7 +6515,7 @@ "sets": [], "maps": [] }, - "description": "Title of the schema.", + "description": "Type is never be defined.", "jsDocTags": [] }, { @@ -5153,7 +6531,7 @@ "type": "string", "values": [ { - "value": "description" + "value": "title" } ] } @@ -5193,7 +6571,7 @@ "sets": [], "maps": [] }, - "description": "Detailed description of the schema.", + "description": "Title of the schema.", "jsDocTags": [] }, { @@ -5209,7 +6587,7 @@ "type": "string", "values": [ { - "value": "deprecated" + "value": "description" } ] } @@ -5232,74 +6610,11 @@ "nullable": false, "functions": [], "atomics": [ - { - "type": "boolean", - "tags": [] - } - ], - "constants": [], - "templates": [], - "escaped": null, - "rest": null, - "arrays": [], - "tuples": [], - "objects": [], - "aliases": [], - "natives": [], - "sets": [], - "maps": [] - }, - "description": "Whether the type is deprecated or not.", - "jsDocTags": [] - } - ], - "description": "Null type.", - "jsDocTags": [], - "index": 13, - "recursive": false, - "nullables": [ - false - ] - }, - { - "name": "OpenApi.IJsonSchema.IUnknown", - "properties": [ - { - "key": { - "any": false, - "required": true, - "optional": false, - "nullable": false, - "functions": [], - "atomics": [], - "constants": [ { "type": "string", - "values": [ - { - "value": "type" - } - ] + "tags": [] } ], - "templates": [], - "escaped": null, - "rest": null, - "arrays": [], - "tuples": [], - "objects": [], - "aliases": [], - "natives": [], - "sets": [], - "maps": [] - }, - "value": { - "any": false, - "required": false, - "optional": true, - "nullable": false, - "functions": [], - "atomics": [], "constants": [], "templates": [], "escaped": null, @@ -5312,7 +6627,7 @@ "sets": [], "maps": [] }, - "description": "Type is never be defined.", + "description": "Detailed description of the schema.", "jsDocTags": [] }, { @@ -5328,7 +6643,7 @@ "type": "string", "values": [ { - "value": "title" + "value": "deprecated" } ] } @@ -5352,7 +6667,7 @@ "functions": [], "atomics": [ { - "type": "string", + "type": "boolean", "tags": [] } ], @@ -5368,7 +6683,7 @@ "sets": [], "maps": [] }, - "description": "Title of the schema.", + "description": "Whether the type is deprecated or not.", "jsDocTags": [] }, { @@ -5384,7 +6699,7 @@ "type": "string", "values": [ { - "value": "description" + "value": "example" } ] } @@ -5401,17 +6716,12 @@ "maps": [] }, "value": { - "any": false, + "any": true, "required": true, "optional": true, "nullable": false, "functions": [], - "atomics": [ - { - "type": "string", - "tags": [] - } - ], + "atomics": [], "constants": [], "templates": [], "escaped": null, @@ -5424,7 +6734,7 @@ "sets": [], "maps": [] }, - "description": "Detailed description of the schema.", + "description": "Example value.", "jsDocTags": [] }, { @@ -5440,7 +6750,7 @@ "type": "string", "values": [ { - "value": "deprecated" + "value": "examples" } ] } @@ -5462,31 +6772,28 @@ "optional": true, "nullable": false, "functions": [], - "atomics": [ - { - "type": "boolean", - "tags": [] - } - ], + "atomics": [], "constants": [], "templates": [], "escaped": null, "rest": null, "arrays": [], "tuples": [], - "objects": [], + "objects": [ + "Record" + ], "aliases": [], "natives": [], "sets": [], "maps": [] }, - "description": "Whether the type is deprecated or not.", + "description": "List of example values as key-value pairs.", "jsDocTags": [] } ], "description": "Unknown, `any` type.", "jsDocTags": [], - "index": 14, + "index": 15, "recursive": false, "nullables": [ false @@ -5607,7 +6914,7 @@ ], "description": "Discriminator info of the union type.", "jsDocTags": [], - "index": 15, + "index": 16, "recursive": false, "nullables": [ false @@ -5671,7 +6978,7 @@ ], "description": "Construct a type with a set of properties K of type T", "jsDocTags": [], - "index": 16, + "index": 17, "recursive": false, "nullables": [ false @@ -5736,7 +7043,7 @@ ], "description": "Construct a type with a set of properties K of type T", "jsDocTags": [], - "index": 17, + "index": 18, "recursive": false, "nullables": [ false @@ -5990,7 +7297,7 @@ ], "description": "Normal API key type.", "jsDocTags": [], - "index": 18, + "index": 19, "recursive": false, "nullables": [ false @@ -6180,7 +7487,7 @@ ], "description": "HTTP basic authentication type.", "jsDocTags": [], - "index": 19, + "index": 20, "recursive": false, "nullables": [ false @@ -6426,7 +7733,7 @@ ], "description": "HTTP bearer authentication type.", "jsDocTags": [], - "index": 20, + "index": 21, "recursive": false, "nullables": [ false @@ -6608,7 +7915,7 @@ ], "description": "OAuth2 authentication type.", "jsDocTags": [], - "index": 21, + "index": 22, "recursive": false, "nullables": [ false @@ -6831,7 +8138,7 @@ } ], "jsDocTags": [], - "index": 22, + "index": 23, "recursive": false, "nullables": [ false @@ -7063,7 +8370,7 @@ } ], "jsDocTags": [], - "index": 23, + "index": 24, "recursive": false, "nullables": [ false @@ -7240,7 +8547,7 @@ ], "description": "Construct a type with the properties of T except for those in type K.", "jsDocTags": [], - "index": 24, + "index": 25, "recursive": false, "nullables": [ false @@ -7417,7 +8724,7 @@ ], "description": "Construct a type with the properties of T except for those in type K.", "jsDocTags": [], - "index": 25, + "index": 26, "recursive": false, "nullables": [ false @@ -7601,7 +8908,7 @@ } ], "jsDocTags": [], - "index": 26, + "index": 27, "recursive": false, "nullables": [ false diff --git a/test/src/features/llm.application/test_llm_application.ts b/test/src/features/llm.application/test_llm_application.ts index 3ec15f0050..fabc105634 100644 --- a/test/src/features/llm.application/test_llm_application.ts +++ b/test/src/features/llm.application/test_llm_application.ts @@ -14,6 +14,7 @@ export const test_llm_application = (): void => { type: "string", }, description: "Get ID.", + deprecated: true, }, { name: "getValue", @@ -35,6 +36,7 @@ export const test_llm_application = (): void => { }, description: "Get value.\n\nGet value with plus operation of member value, x and y.", + tags: ["mathmatics", "arithmetic"], }, { name: "getPerformance", @@ -53,6 +55,7 @@ export const test_llm_application = (): void => { description: "The performance interface.", }, description: "Get performance.", + tags: ["monitor"], }, { name: "synchronize", @@ -81,6 +84,8 @@ class SomeClass { /** * Get ID. + * + * @deprecated */ getId = (): string => { return this.id; @@ -98,6 +103,8 @@ class SomeClass { * @returns Sum of them. * * `this.value + x + y` + * @tag mathmatics + * @tag arithmetic */ getValue(x: number, y: number): number { return this.value + x + y; @@ -105,6 +112,8 @@ class SomeClass { /** * Get performance. + * + * @tag monitor tool */ async getPerformance(): Promise { return { level: 3 }; diff --git a/website/package-lock.json b/website/package-lock.json index 4c67d67c06..f01372da34 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -15,7 +15,7 @@ "@mui/icons-material": "^5.15.4", "@mui/material": "^5.12.0", "@rollup/browser": "^4.13.0", - "@samchon/openapi": "^1.0.2", + "@samchon/openapi": "latest", "lz-string": "^1.5.0", "monaco-editor": "^0.50.0", "next": "^14.2.3", @@ -28,7 +28,7 @@ "tgrid": "^1.0.3", "tstl": "^3.0.0", "typescript": "^5.6.2", - "typia": "^6.10.1" + "typia": "*" }, "devDependencies": { "@rspack/cli": "^1.0.0", @@ -1670,9 +1670,9 @@ } }, "node_modules/@samchon/openapi": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@samchon/openapi/-/openapi-1.0.2.tgz", - "integrity": "sha512-+PFmOo3fZ0RejmhMnX+yKZCC2CCSxO6NhdQLnNStcX0JFdyNZk9Z5rrcOu+SDfWOlaMdRqfYzbmfUjpknJCMfA==" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@samchon/openapi/-/openapi-1.0.5.tgz", + "integrity": "sha512-jlM9Q47/ZJ+G0+0Mx/D0w95Rv1NP7V+y4od00gt+0zopCvIdeec/EdfK8JzMNg6NnLljEXcO8kwBjqmRdq5NsA==" }, "node_modules/@shikijs/core": { "version": "1.17.7", @@ -11263,9 +11263,9 @@ } }, "node_modules/typia": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/typia/-/typia-6.10.1.tgz", - "integrity": "sha512-QCQFokNGSNbG8UCnLRky6d78wdl29tI+zjaTAj2Tlx4zzpq9+1fZyeizjQPV7WonzGt4KRyAr3lmMNJZ8riCdA==", + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/typia/-/typia-6.10.2.tgz", + "integrity": "sha512-osSOovyx9T4WrF7jPIVvmWj3YzNX7Fzen1e+NUz9/ori3xx+Z5KkNN7idSVN+fndPfQqmzVe5Jmua1oaUGvV6A==", "dependencies": { "@samchon/openapi": "^1.0.2", "commander": "^10.0.0", diff --git a/website/pages/docs/llm/application.mdx b/website/pages/docs/llm/application.mdx index 85bacbcf2e..dfaf3e6fd7 100644 --- a/website/pages/docs/llm/application.mdx +++ b/website/pages/docs/llm/application.mdx @@ -642,7 +642,7 @@ import typia, { tags } from "typia"; const app: ILlmApplication = typia.llm.application(); -console.log(JSON.stringify(app, null, 2)); +console.log(app); interface BbsArticleController { /** @@ -752,7 +752,7 @@ namespace IBbsArticle { "title": { "type": "string", "title": "Title of the article", - "description": "Title of the article.\n\nRepresentative title of the article." + "description": "Title of the article.\n\nRepresentative title of the article." }, "body": { "type": "string", @@ -778,9 +778,57 @@ namespace IBbsArticle { } ], "output": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "title": "Primary Key", + "description": "Primary Key." + }, + "created_at": { + "type": "string", + "format": "date-time", + "title": "Creation time of the article", + "description": "Creation time of the article." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "title": "Last updated time of the article", + "description": "Last updated time of the article." + }, + "title": { + "type": "string", + "title": "Title of the article", + "description": "Title of the article.\n\nRepresentative title of the article." + }, + "body": { + "type": "string", + "title": "Content body", + "description": "Content body.\n\nContent body of the article writtn in the markdown format." + }, + "thumbnail": { + "type": "string", + "format": "uri", + "contentMediaType": "image/*", + "nullable": true, + "title": "Thumbnail image URI", + "description": "Thumbnail image URI.\n\nThumbnail image URI which can represent the article.\n\nIf configured as `null`, it means that no thumbnail image in the article." + } + }, + "nullable": false, + "required": [ + "id", + "created_at", + "updated_at", + "title", + "body", + "thumbnail" + ], "description": "Newly created article" }, - "description": "Create a new article.\n\nWrites a new article and archives it into the DB." + "description": "Create a new article.\n\nWrites a new article and archives it into the DB." }, { "name": "update", @@ -796,7 +844,7 @@ namespace IBbsArticle { "title": { "type": "string", "title": "Title of the article", - "description": "Title of the article.\n\nRepresentative title of the article." + "description": "Title of the article.\n\nRepresentative title of the article." }, "body": { "type": "string", @@ -816,7 +864,6 @@ namespace IBbsArticle { "description": "New content to update" } ], - "output": {}, "description": "Update an article.\n\nUpdates an article with new content." }, { @@ -828,7 +875,6 @@ namespace IBbsArticle { "description": "Target article's " } ], - "output": {}, "description": "Erase an article.\n\nErases an article from the DB." } ], @@ -872,7 +918,7 @@ const app: ILlmApplication = typia.llm.application({ LlmTypeChecker.isString(schema) && schema.contentMediaType !== undefined, }); -console.log(JSON.stringify(app, null, 2)); +console.log(app); interface BbsArticleController { /** @@ -922,7 +968,7 @@ interface BbsArticleController { "title": { "type": "string", "title": "Title of the article", - "description": "Title of the article.\n\nRepresentative title of the article." + "description": "Title of the article.\n\nRepresentative title of the article." }, "body": { "type": "string", @@ -948,6 +994,54 @@ interface BbsArticleController { } ], "output": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "title": "Primary Key", + "description": "Primary Key." + }, + "created_at": { + "type": "string", + "format": "date-time", + "title": "Creation time of the article", + "description": "Creation time of the article." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "title": "Last updated time of the article", + "description": "Last updated time of the article." + }, + "title": { + "type": "string", + "title": "Title of the article", + "description": "Title of the article.\n\nRepresentative title of the article." + }, + "body": { + "type": "string", + "title": "Content body", + "description": "Content body.\n\nContent body of the article writtn in the markdown format." + }, + "thumbnail": { + "type": "string", + "format": "uri", + "contentMediaType": "image/*", + "nullable": true, + "title": "Thumbnail image URI", + "description": "Thumbnail image URI.\n\nThumbnail image URI which can represent the article.\n\nIf configured as `null`, it means that no thumbnail image in the article." + } + }, + "nullable": false, + "required": [ + "id", + "created_at", + "updated_at", + "title", + "body", + "thumbnail" + ], "description": "Newly created article" }, "description": "Create a new article.\n\nWrites a new article and archives it into the DB.", @@ -961,7 +1055,7 @@ interface BbsArticleController { "title": { "type": "string", "title": "Title of the article", - "description": "Title of the article.\n\nRepresentative title of the article." + "description": "Title of the article.\n\nRepresentative title of the article." }, "body": { "type": "string", @@ -990,7 +1084,7 @@ interface BbsArticleController { "contentMediaType": "image/*", "nullable": true, "title": "Thumbnail image URI", - "description": "Thumbnail image URI.\n\nThumbnail image URI which can represent the article.\n\nIf configured as `null`, it means that no thumbnail image in the article." + "description": "Thumbnail image URI.\n\nThumbnail image URI which can represent the article.\n\nIf configured as `null`, it means that no thumbnail image in the article." } }, "nullable": false, @@ -1017,7 +1111,7 @@ interface BbsArticleController { "title": { "type": "string", "title": "Title of the article", - "description": "Title of the article.\n\nRepresentative title of the article." + "description": "Title of the article.\n\nRepresentative title of the article." }, "body": { "type": "string", @@ -1037,7 +1131,6 @@ interface BbsArticleController { "description": "New content to update" } ], - "output": {}, "description": "Update an article.\n\nUpdates an article with new content.", "separated": { "llm": [ @@ -1057,7 +1150,7 @@ interface BbsArticleController { "title": { "type": "string", "title": "Title of the article", - "description": "Title of the article.\n\nRepresentative title of the article." + "description": "Title of the article.\n\nRepresentative title of the article." }, "body": { "type": "string", @@ -1082,7 +1175,7 @@ interface BbsArticleController { "contentMediaType": "image/*", "nullable": true, "title": "Thumbnail image URI", - "description": "Thumbnail image URI.\n\nThumbnail image URI which can represent the article.\n\nIf configured as `null`, it means that no thumbnail image in the article." + "description": "Thumbnail image URI.\n\nThumbnail image URI which can represent the article.\n\nIf configured as `null`, it means that no thumbnail image in the article." } }, "nullable": false, @@ -1101,7 +1194,6 @@ interface BbsArticleController { "description": "Target article's " } ], - "output": {}, "description": "Erase an article.\n\nErases an article from the DB.", "separated": { "llm": [ @@ -1145,7 +1237,7 @@ import typia, { tags } from "typia"; const app: ILlmApplication = typia.llm.application(); -console.log(JSON.stringify(app, null, 2)); +console.log(app); interface BbsArticleController { /** @@ -1330,7 +1422,7 @@ import typia from "typia"; const app: ILlmApplication = typia.llm.application(); -console.log(JSON.stringify(app, null, 2)); +console.log(app); interface Controller { now(): Date;