diff --git a/benchmark/package.json b/benchmark/package.json index fb88f05244..7b9a3235f7 100644 --- a/benchmark/package.json +++ b/benchmark/package.json @@ -72,6 +72,6 @@ "suppress-warnings": "^1.0.2", "tstl": "^3.0.0", "uuid": "^9.0.1", - "typia": "../typia-6.10.0-dev.20240823.tgz" + "typia": "../typia-6.10.0-dev.20240906.tgz" } } \ No newline at end of file diff --git a/debug/package.json b/debug/package.json index 000fba0654..2233e6d8ee 100644 --- a/debug/package.json +++ b/debug/package.json @@ -17,7 +17,7 @@ }, "dependencies": { "tstl": "^3.0.0", - "typia": "../typia-6.8.0.tgz", + "typia": "../typia-6.10.0-dev.20240823.tgz", "uuid": "^10.0.0" } } \ No newline at end of file diff --git a/debug/src/llm-schema.ts b/debug/src/llm-schema.ts new file mode 100644 index 0000000000..5b755fc56e --- /dev/null +++ b/debug/src/llm-schema.ts @@ -0,0 +1,26 @@ +import { ILlmSchema } from "@samchon/openapi"; +import typia from "typia"; + +class Parent { + public toJSON(): Child { + return new Child(); + } +} +class Child { + public readonly id: number = 1; + public readonly flag: boolean = true; + + public toJSON(): IBrand { + return { + code: "code", + name: "name", + }; + } +} +interface IBrand { + code: string; + name: string; +} + +const schema: ILlmSchema = typia.llm.schema(); +console.log(schema); diff --git a/debug/src/pattern.ts b/debug/src/pattern.ts deleted file mode 100644 index bf41f3ef86..0000000000 --- a/debug/src/pattern.ts +++ /dev/null @@ -1,6 +0,0 @@ -import typia, { tags } from "typia"; - -typia.createIs< - string & - tags.Pattern<"^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$"> ->(); diff --git a/errors/package.json b/errors/package.json index 0b7760fbba..264bf2948d 100644 --- a/errors/package.json +++ b/errors/package.json @@ -32,6 +32,6 @@ "typescript": "^5.3.2" }, "dependencies": { - "typia": "../typia-6.10.0-dev.20240823.tgz" + "typia": "../typia-6.10.0-dev.20240906.tgz" } } \ No newline at end of file diff --git a/package.json b/package.json index 0adc5a2ec7..3dcd5040cb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "typia", - "version": "6.10.0-dev.20240823", + "version": "6.10.0-dev.20240906", "description": "Superfast runtime validators with only one line", "main": "lib/index.js", "typings": "lib/index.d.ts", @@ -67,7 +67,7 @@ }, "homepage": "https://typia.io", "dependencies": { - "@samchon/openapi": "^0.4.9", + "@samchon/openapi": "^0.5.0-dev.20240906-2", "commander": "^10.0.0", "comment-json": "^4.2.3", "inquirer": "^8.2.5", diff --git a/packages/typescript-json/package.json b/packages/typescript-json/package.json index 7c1a74f16c..ec296c5ed3 100644 --- a/packages/typescript-json/package.json +++ b/packages/typescript-json/package.json @@ -1,6 +1,6 @@ { "name": "typescript-json", - "version": "6.10.0-dev.20240823", + "version": "6.10.0-dev.20240906", "description": "Superfast runtime validators with only one line", "main": "lib/index.js", "typings": "lib/index.d.ts", @@ -63,7 +63,7 @@ }, "homepage": "https://typia.io", "dependencies": { - "typia": "6.10.0-dev.20240823" + "typia": "6.10.0-dev.20240906" }, "peerDependencies": { "typescript": ">=4.8.0 <5.6.0" diff --git a/src/factories/internal/metadata/emplace_metadata_object.ts b/src/factories/internal/metadata/emplace_metadata_object.ts index 887a32ce43..b322f70c43 100644 --- a/src/factories/internal/metadata/emplace_metadata_object.ts +++ b/src/factories/internal/metadata/emplace_metadata_object.ts @@ -51,14 +51,14 @@ export const emplace_metadata_object = ): MetadataProperty => { // COMMENTS AND TAGS const description: string | null = symbol - ? CommentFactory.description(symbol) ?? null + ? (CommentFactory.description(symbol) ?? null) : null; const jsDocTags: ts.JSDocTagInfo[] = ( symbol?.getJsDocTags() ?? [] ).filter(filter ?? (() => true)); // THE PROPERTY - const property = MetadataProperty.create({ + const property: MetadataProperty = MetadataProperty.create({ key, value, description, diff --git a/src/llm.ts b/src/llm.ts new file mode 100644 index 0000000000..8c1ebb0f9d --- /dev/null +++ b/src/llm.ts @@ -0,0 +1,20 @@ +import { ILlmSchema } from "@samchon/openapi"; + +export function schema(): never; +export function schema(): ILlmSchema; + +/** + * @internal + */ +export function schema(): never { + halt("schema"); +} + +/** + * @internal + */ +function halt(name: string): never { + throw new Error( + `Error on typia.llm.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`, + ); +} diff --git a/src/module.ts b/src/module.ts index 6dc3d6427c..478196f1e6 100644 --- a/src/module.ts +++ b/src/module.ts @@ -8,6 +8,7 @@ import { TypeGuardError } from "./TypeGuardError"; export * as functional from "./functional"; export * as http from "./http"; +export * as llm from "./llm"; export * as json from "./json"; export * as misc from "./misc"; export * as notations from "./notations"; diff --git a/src/programmers/internal/application_escaped.ts b/src/programmers/internal/application_escaped.ts index 0e2a070156..8005840cfb 100644 --- a/src/programmers/internal/application_escaped.ts +++ b/src/programmers/internal/application_escaped.ts @@ -10,11 +10,11 @@ export const application_escaped = ( generator: (meta: Metadata) => Schema, ) => - (resolved: MetadataEscaped): Schema[] => { - const output: Schema | null = generator(resolved.returns); + (escaped: MetadataEscaped): Schema[] => { + const output: Schema | null = generator(escaped.returns); if (output === null) return []; - if (is_date(new Set())(resolved.original)) { + if (is_date(new Set())(escaped.original)) { const string: StringSchema | undefined = is_string(output) ? output : is_one_of(output) @@ -27,9 +27,7 @@ export const application_escaped = ) string.format = "date-time"; } - return is_one_of(output) - ? (output.oneOf as OneOfSchema[]) - : [output]; + return is_one_of(output) ? (output.oneOf as Schema[]) : [output]; }; /** diff --git a/src/programmers/internal/llm_schema_array.ts b/src/programmers/internal/llm_schema_array.ts new file mode 100644 index 0000000000..3aaa571fad --- /dev/null +++ b/src/programmers/internal/llm_schema_array.ts @@ -0,0 +1,22 @@ +import { ILlmSchema } from "@samchon/openapi"; + +import { MetadataArray } from "../../schemas/metadata/MetadataArray"; + +import { application_plugin } from "./application_plugin"; +import { llm_schema_station } from "./llm_schema_station"; + +/** + * @internal + */ +export const llm_schema_array = (array: MetadataArray): ILlmSchema.IArray[] => + application_plugin( + { + type: "array", + items: llm_schema_station({ + metadata: array.type.value, + blockNever: false, + attribute: {}, + }), + }, + array.tags, + ); diff --git a/src/programmers/internal/llm_schema_escaped.ts b/src/programmers/internal/llm_schema_escaped.ts new file mode 100644 index 0000000000..3869471291 --- /dev/null +++ b/src/programmers/internal/llm_schema_escaped.ts @@ -0,0 +1,61 @@ +import { ILlmSchema } from "@samchon/openapi"; + +import { Metadata } from "../../schemas/metadata/Metadata"; +import { MetadataEscaped } from "../../schemas/metadata/MetadataEscaped"; + +import { llm_schema_station } from "./llm_schema_station"; + +/** + * @internal + */ +export const llm_schema_escaped = (escaped: MetadataEscaped): ILlmSchema[] => { + const output: ILlmSchema | null = llm_schema_station({ + metadata: escaped.returns, + blockNever: false, + attribute: {}, + }); + if (output === null) return []; + else if (is_date(new Set())(escaped.original)) { + const string: ILlmSchema.IString | undefined = is_string(output) + ? output + : is_one_of(output) + ? (output.oneOf.find(is_string) as ILlmSchema.IString) + : undefined; + if ( + string !== undefined && + string.format !== "date" && + string.format !== "date-time" + ) + string.format = "date-time"; + } + return is_one_of(output) ? (output.oneOf as ILlmSchema[]) : [output]; +}; + +/** + * @internal + */ +const is_string = (elem: ILlmSchema): elem is ILlmSchema.IString => + (elem as ILlmSchema.IString).type === "string"; + +/** + * @internal + */ +const is_one_of = (elem: ILlmSchema): elem is ILlmSchema.IOneOf => + Array.isArray((elem as ILlmSchema.IOneOf).oneOf); + +/** + * @internal + */ +const is_date = + (visited: Set) => + (meta: Metadata): boolean => { + if (visited.has(meta)) return false; + visited.add(meta); + + return ( + meta.natives.some((name) => name === "Date") || + meta.arrays.some((array) => is_date(visited)(array.type.value)) || + meta.tuples.some((tuple) => tuple.type.elements.some(is_date(visited))) || + meta.aliases.some((alias) => is_date(visited)(alias.value)) + ); + }; diff --git a/src/programmers/internal/llm_schema_native.ts b/src/programmers/internal/llm_schema_native.ts new file mode 100644 index 0000000000..0278602681 --- /dev/null +++ b/src/programmers/internal/llm_schema_native.ts @@ -0,0 +1,17 @@ +import { ILlmSchema } from "@samchon/openapi"; + +/** + * @internal + */ +export const llm_schema_native = ( + name: string, +): ILlmSchema.IString | ILlmSchema.IObject => + name === "Blob" || name === "File" + ? { + type: "string", + format: "binary", + } + : { + type: "object", + properties: {}, + }; diff --git a/src/programmers/internal/llm_schema_object.ts b/src/programmers/internal/llm_schema_object.ts new file mode 100644 index 0000000000..55d17f2898 --- /dev/null +++ b/src/programmers/internal/llm_schema_object.ts @@ -0,0 +1,129 @@ +import { ILlmSchema } from "@samchon/openapi"; + +import { CommentFactory } from "../../factories/CommentFactory"; + +import { IJsDocTagInfo } from "../../schemas/metadata/IJsDocTagInfo"; +import { Metadata } from "../../schemas/metadata/Metadata"; +import { MetadataObject } from "../../schemas/metadata/MetadataObject"; + +import { PatternUtil } from "../../utils/PatternUtil"; + +import { application_description } from "./application_description"; +import { llm_schema_station } from "./llm_schema_station"; +import { metadata_to_pattern } from "./metadata_to_pattern"; + +/** + * @internal + */ +export const llm_schema_object = (props: { + object: MetadataObject; + nullable: boolean; +}): ILlmSchema.IObject => { + // ITERATE PROPERTIES + const properties: Record = {}; + const extraMeta: ISuperfluous = { + patternProperties: {}, + additionalProperties: undefined, + }; + const required: string[] = []; + + for (const property of props.object.properties) { + if ( + // FUNCTIONAL TYPE + property.value.functional === true && + property.value.nullable === false && + property.value.isRequired() === true && + property.value.size() === 0 + ) + continue; + else if (property.jsDocTags.find((tag) => tag.name === "hidden")) continue; // THE HIDDEN TAG + + const key: string | null = property.key.getSoleLiteral(); + const schema: ILlmSchema | null = llm_schema_station({ + blockNever: true, + attribute: { + deprecated: + property.jsDocTags.some((tag) => tag.name === "deprecated") || + undefined, + title: (() => { + const info: IJsDocTagInfo | undefined = property.jsDocTags.find( + (tag) => tag.name === "title", + ); + if (info?.text?.length) return CommentFactory.merge(info.text); + else if (!property.description?.length) return undefined; + + const index: number = property.description.indexOf("\n"); + const top: string = ( + index === -1 + ? property.description + : property.description.substring(0, index) + ).trim(); + return top.endsWith(".") + ? top.substring(0, top.length - 1) + : undefined; + })(), + description: application_description(property), + }, + metadata: property.value, + }); + + if (schema === null) continue; + if (key !== null) { + properties[key] = schema; + if (property.value.isRequired() === true) required.push(key); + } else { + const pattern: string = metadata_to_pattern(true)(property.key); + if (pattern === PatternUtil.STRING) + extraMeta.additionalProperties = [property.value, schema]; + else extraMeta.patternProperties[pattern] = [property.value, schema]; + } + } + + return { + type: "object", + properties, + nullable: props.nullable, + required: required.length ? required : undefined, + title: (() => { + const info: IJsDocTagInfo | undefined = props.object.jsDocTags.find( + (tag) => tag.name === "title", + ); + return info?.text?.length ? CommentFactory.merge(info.text) : undefined; + })(), + description: application_description(props.object), + additionalProperties: join(extraMeta), + }; +}; + +/** + * @internal + */ +const join = (extra: ISuperfluous): ILlmSchema | undefined => { + // LIST UP METADATA + const elements: [Metadata, ILlmSchema][] = Object.values( + extra.patternProperties || {}, + ); + if (extra.additionalProperties) elements.push(extra.additionalProperties); + + // SHORT RETURN + if (elements.length === 0) return undefined; + else if (elements.length === 1) return elements[0]![1]!; + + // MERGE METADATA AND GENERATE VULNERABLE SCHEMA + const meta: Metadata = elements + .map((tuple) => tuple[0]) + .reduce((x, y) => Metadata.merge(x, y)); + return llm_schema_station({ + blockNever: true, + attribute: {}, + metadata: meta, + }); +}; + +/** + * @internal + */ +interface ISuperfluous { + additionalProperties?: undefined | [Metadata, ILlmSchema]; + patternProperties: Record; +} diff --git a/src/programmers/internal/llm_schema_station.ts b/src/programmers/internal/llm_schema_station.ts new file mode 100644 index 0000000000..529f244975 --- /dev/null +++ b/src/programmers/internal/llm_schema_station.ts @@ -0,0 +1,185 @@ +import { ILlmSchema } from "@samchon/openapi"; + +import { Metadata } from "../../schemas/metadata/Metadata"; +import { MetadataAtomic } from "../../schemas/metadata/MetadataAtomic"; + +import { AtomicPredicator } from "../helpers/AtomicPredicator"; +import { application_bigint } from "./application_bigint"; +import { application_boolean } from "./application_boolean"; +import { application_number } from "./application_number"; +import { application_string } from "./application_string"; +import { application_templates } from "./application_templates"; +import { application_v30_constant } from "./application_v30_constant"; +import { llm_schema_array } from "./llm_schema_array"; +import { llm_schema_escaped } from "./llm_schema_escaped"; +import { llm_schema_native } from "./llm_schema_native"; +import { llm_schema_object } from "./llm_schema_object"; +import { llm_schema_tuple } from "./llm_schema_tuple"; + +/** + * @internal + */ +export const llm_schema_station = (props: { + metadata: Metadata; + blockNever: boolean; + attribute: ILlmSchema.__IAttribute; +}): ILlmSchema => { + // VULNERABLE CASE + if (props.metadata.any === true) + return { + ...props.attribute, + type: undefined, + }; + else if (props.metadata.nullable === true && props.metadata.empty() === true) + return { + ...props.attribute, + type: "null", + }; + + //---- + // GATHER UNION SCHEMAS + //---- + const union: ILlmSchema[] = []; + const insert = props.metadata.nullable + ? (schema: ILlmSchema) => + union.push({ + ...schema, + nullable: (schema as ILlmSchema.__ISignificant).type + ? true + : undefined, + } as ILlmSchema) + : (schema: ILlmSchema) => union.push(schema); + + // toJSON() METHOD + if (props.metadata.escaped !== null) + llm_schema_escaped(props.metadata.escaped).forEach(insert); + + // ATOMIC TYPES + if ( + props.metadata.templates.length && + AtomicPredicator.template(props.metadata) + ) + application_templates<"3.0">(props.metadata).map(insert); + for (const constant of props.metadata.constants) + if (AtomicPredicator.constant(props.metadata)(constant.type) === false) + continue; + else insert(application_v30_constant(constant)); + for (const a of props.metadata.atomics) + if (a.type === "boolean") application_boolean<"3.0">(a).forEach(insert); + else if (a.type === "bigint") application_bigint<"3.0">(a).forEach(insert); + else if (a.type === "number") application_number<"3.0">(a).forEach(insert); + else if (a.type === "string") application_string<"3.0">(a).forEach(insert); + + // ARRAY + for (const array of props.metadata.arrays) + if (array.type.recursive) + throw new Error( + "Error on LlmSchemaProgrammer.write(): LLM schema does not allow recursive array type.", + ); + else llm_schema_array(array).forEach(insert); + + // TUPLE + for (const tuple of props.metadata.tuples) + if (tuple.type.recursive) + throw new Error( + "Error on LlmSchemaProgrammer.write(): LLM schema does not allow recursive tuple type.", + ); + else + insert( + llm_schema_tuple({ + tuple, + attribute: props.attribute, + }), + ); + + // NATIVES + for (const native of props.metadata.natives) + if (AtomicPredicator.native(native)) { + const type: string = native.toLowerCase(); + if (props.metadata.atomics.some((a) => a.type === type)) continue; + else if (type === "boolean") + insert( + application_boolean<"3.0">( + MetadataAtomic.create({ + type: "boolean", + tags: [], + }), + )[0]!, + ); + else if (type === "bigint") + insert( + application_bigint( + MetadataAtomic.create({ + type: "bigint", + tags: [], + }), + )[0]!, + ); + else if (type === "number") + insert( + application_number( + MetadataAtomic.create({ + type: "number", + tags: [], + }), + )[0]!, + ); + else if (type === "string") + insert( + application_string( + MetadataAtomic.create({ + type: "string", + tags: [], + }), + )[0]!, + ); + } else insert(llm_schema_native(native)); + if (props.metadata.sets.length) insert(llm_schema_native("Set")); + if (props.metadata.maps.length) insert(llm_schema_native("Map")); + + // OBJECT + for (const object of props.metadata.objects) + if (object.recursive) + throw new Error( + "Error on LlmSchemaProgrammer.write(): LLM schema does not allow recursive object type.", + ); + else + insert( + llm_schema_object({ + object, + nullable: props.metadata.nullable, + }), + ); + + // ALIASES + for (const alias of props.metadata.aliases) + if (alias.recursive) + throw new Error( + "Error on LlmSchemaProgrammer.write(): LLM schema does not allow recursive alias type.", + ); + else + insert( + llm_schema_station({ + ...props, + metadata: alias.value, + }), + ); + + //---- + // RETURNS + //---- + if (union.length === 0 && props.blockNever === true) return null!; + const schema: ILlmSchema = + union.length === 0 + ? { type: undefined } + : union.length === 1 + ? union[0]! + : { oneOf: union }; + return { + ...schema, + ...props.attribute, + title: props.attribute.title ?? schema.title, + description: props.attribute.description ?? schema.description, + deprecated: props.attribute.deprecated ?? schema.deprecated, + }; +}; diff --git a/src/programmers/internal/llm_schema_tuple.ts b/src/programmers/internal/llm_schema_tuple.ts new file mode 100644 index 0000000000..219920f0be --- /dev/null +++ b/src/programmers/internal/llm_schema_tuple.ts @@ -0,0 +1,31 @@ +import { ILlmSchema } from "@samchon/openapi"; + +import { Metadata } from "../../schemas/metadata/Metadata"; +import { MetadataTuple } from "../../schemas/metadata/MetadataTuple"; + +import { llm_schema_station } from "./llm_schema_station"; + +/** + * @internal + */ +export const llm_schema_tuple = (props: { + tuple: MetadataTuple; + attribute: ILlmSchema.__IAttribute; +}): ILlmSchema.IArray => ({ + ...props.attribute, + type: "array", + items: llm_schema_station({ + blockNever: false, + attribute: props.attribute, + metadata: props.tuple.type.elements.reduce( + (x, y) => Metadata.merge(x.rest ?? x, y.rest ?? y), + Metadata.initialize(), + ), + }), + minItems: !!props.tuple.type.elements.at(-1)?.rest + ? props.tuple.type.elements.length - 1 + : props.tuple.type.elements.filter((x) => !x.optional).length, + maxItems: !!props.tuple.type.elements.at(-1)?.rest + ? undefined! + : props.tuple.type.elements.length, +}); diff --git a/src/programmers/json/JsonApplicationProgrammer.ts b/src/programmers/json/JsonApplicationProgrammer.ts index 1f42c233ab..86af142dc5 100644 --- a/src/programmers/json/JsonApplicationProgrammer.ts +++ b/src/programmers/json/JsonApplicationProgrammer.ts @@ -10,7 +10,7 @@ import { application_v30_schema } from "../internal/application_v30_schema"; import { application_v31_schema } from "../internal/application_v31_schema"; export namespace JsonApplicationProgrammer { - export const validate = (meta: Metadata) => { + export const validate = (meta: Metadata): string[] => { const output: string[] = []; if ( meta.atomics.some((a) => a.type === "bigint") || diff --git a/src/programmers/llm/LlmSchemaProgrammer.ts b/src/programmers/llm/LlmSchemaProgrammer.ts new file mode 100644 index 0000000000..953dc876a7 --- /dev/null +++ b/src/programmers/llm/LlmSchemaProgrammer.ts @@ -0,0 +1,49 @@ +import { ILlmSchema } from "@samchon/openapi"; + +import { Metadata } from "../../schemas/metadata/Metadata"; + +import { AtomicPredicator } from "../helpers/AtomicPredicator"; +import { llm_schema_station } from "../internal/llm_schema_station"; + +export namespace LlmSchemaProgrammer { + export const validate = (meta: Metadata): string[] => { + const output: string[] = []; + if ( + meta.atomics.some((a) => a.type === "bigint") || + meta.constants.some((c) => c.type === "bigint") + ) + output.push("LLM schema does not support bigint type."); + if ( + meta.tuples.some((t) => + t.type.elements.some((e) => e.isRequired() === false), + ) || + meta.arrays.some((a) => a.type.value.isRequired() === false) + ) + output.push("LLM schema does not support undefined type in array."); + if (meta.maps.length) output.push("LLM schema does not support Map type."); + if (meta.sets.length) output.push("LLM schema does not support Set type."); + for (const native of meta.natives) + if ( + AtomicPredicator.native(native) === false && + native !== "Date" && + native !== "Blob" && + native !== "File" + ) + output.push(`LLM schema does not support ${native} type.`); + if ( + meta.aliases.some((a) => a.recursive) || + meta.arrays.some((a) => a.type.recursive) || + meta.objects.some((o) => o.recursive) || + meta.tuples.some((t) => t.type.recursive) + ) + output.push("LLM schema does not support recursive type."); + return output; + }; + + export const write = (metadata: Metadata): ILlmSchema => + llm_schema_station({ + metadata, + blockNever: true, + attribute: {}, + }); +} diff --git a/src/transformers/CallExpressionTransformer.ts b/src/transformers/CallExpressionTransformer.ts index 99a4604f1a..ada190e095 100644 --- a/src/transformers/CallExpressionTransformer.ts +++ b/src/transformers/CallExpressionTransformer.ts @@ -64,6 +64,7 @@ import { JsonIsStringifyTransformer } from "./features/json/JsonIsStringifyTrans import { JsonStringifyTransformer } from "./features/json/JsonStringifyTransformer"; import { JsonValidateParseTransformer } from "./features/json/JsonValidateParseTransformer"; import { JsonValidateStringifyTransformer } from "./features/json/JsonValidateStringifyTransformer"; +import { LlmSchemaTransformer } from "./features/llm/LlmSchemaTransformer"; import { MiscAssertCloneTransformer } from "./features/misc/MiscAssertCloneTransformer"; import { MiscAssertPruneTransformer } from "./features/misc/MiscAssertPruneTransformer"; import { MiscCloneTransformer } from "./features/misc/MiscCloneTransformer"; @@ -353,9 +354,13 @@ const FUNCTORS: Record Task>> = { createAssertQuery: () => CreateHttpAssertQueryTransformer.transform, createValidateQuery: () => CreateHttpValidateQueryTransformer.transform, }, + llm: { + schema: () => (project) => () => LlmSchemaTransformer.transform(project), + }, json: { // SCHEMA - application: () => (P) => () => JsonApplicationTransformer.transform(P), + application: () => (project) => () => + JsonApplicationTransformer.transform(project), // PARSER isParse: () => JsonIsParseTransformer.transform, diff --git a/src/transformers/features/llm/LlmSchemaTransformer.ts b/src/transformers/features/llm/LlmSchemaTransformer.ts new file mode 100644 index 0000000000..0861625646 --- /dev/null +++ b/src/transformers/features/llm/LlmSchemaTransformer.ts @@ -0,0 +1,52 @@ +import { ILlmSchema } from "@samchon/openapi"; +import ts from "typescript"; + +import { LiteralFactory } from "../../../factories/LiteralFactory"; +import { MetadataCollection } from "../../../factories/MetadataCollection"; +import { MetadataFactory } from "../../../factories/MetadataFactory"; + +import { Metadata } from "../../../schemas/metadata/Metadata"; + +import { LlmSchemaProgrammer } from "../../../programmers/llm/LlmSchemaProgrammer"; + +import { ValidationPipe } from "../../../typings/ValidationPipe"; + +import { IProject } from "../../IProject"; +import { TransformerError } from "../../TransformerError"; + +export namespace LlmSchemaTransformer { + export const transform = + (project: IProject) => + (expression: ts.CallExpression): ts.Expression => { + if (!expression.typeArguments?.length) + throw new TransformerError({ + code: "typia.llm.schema", + message: "no generic argument.", + }); + + // GET TYPE + const top: ts.Node = expression.typeArguments[0]!; + if (ts.isTypeNode(top) === false) return expression; + + const type: ts.Type = project.checker.getTypeFromTypeNode(top); + const collection: MetadataCollection = new MetadataCollection({ + replace: MetadataCollection.replace, + }); + const result: ValidationPipe = + MetadataFactory.analyze( + project.checker, + project.context, + )({ + escape: true, + constant: true, + absorb: false, + validate: LlmSchemaProgrammer.validate, + })(collection)(type); + if (result.success === false) + throw TransformerError.from("typia.llm.schema")(result.errors); + + // GENERATE LLM SCHEMA + const schema: ILlmSchema = LlmSchemaProgrammer.write(result.data); + return LiteralFactory.generate(schema); + }; +} diff --git a/test-esm/package.json b/test-esm/package.json index ca4d004fff..f7d1ac4840 100644 --- a/test-esm/package.json +++ b/test-esm/package.json @@ -36,6 +36,6 @@ "typescript": "^5.4.5" }, "dependencies": { - "typia": "../typia-6.10.0-dev.20240823.tgz" + "typia": "../typia-6.10.0-dev.20240906.tgz" } } \ No newline at end of file diff --git a/test/build/internal/TestJsonApplicationGenerator.ts b/test/build/internal/TestJsonSchemaGenerator.ts similarity index 98% rename from test/build/internal/TestJsonApplicationGenerator.ts rename to test/build/internal/TestJsonSchemaGenerator.ts index 06c453cc45..0c0e6a3b0b 100644 --- a/test/build/internal/TestJsonApplicationGenerator.ts +++ b/test/build/internal/TestJsonSchemaGenerator.ts @@ -3,7 +3,7 @@ import fs from "fs"; import { TestStructure } from "./TestStructure"; -export namespace TestJsonApplicationGenerator { +export namespace TestJsonSchemaGenerator { export async function generate( structures: TestStructure[], ): Promise { diff --git a/test/build/internal/TestLlmSchemaGenerator.ts b/test/build/internal/TestLlmSchemaGenerator.ts new file mode 100644 index 0000000000..0746d6a3a7 --- /dev/null +++ b/test/build/internal/TestLlmSchemaGenerator.ts @@ -0,0 +1,80 @@ +import cp from "child_process"; +import fs from "fs"; + +import { TestStructure } from "./TestStructure"; + +export namespace TestLlmSchemaGenerator { + export async function generate( + structures: TestStructure[], + ): Promise { + const location: string = `${__dirname}/../../src/features/llm.schema`; + if (fs.existsSync(location)) cp.execSync("npx rimraf " + location); + await fs.promises.mkdir(location); + await application(structures); + } + + async function application(structures: TestStructure[]): Promise { + for (const s of structures) { + if (s.JSONABLE === false) continue; + else if (s.RECURSIVE === true) continue; + + const content: string[] = [ + `import typia from "typia";`, + `import { ${s.name} } from "../../structures/${s.name}";`, + `import { _test_llm_schema } from "../../internal/_test_llm_schema";`, + "", + `export const test_llm_schema_${s.name} = `, + ` _test_llm_schema(`, + ` ${JSON.stringify(s.name)},`, + ` )(typia.llm.schema<${s.name}>());`, + ]; + await fs.promises.writeFile( + `${__dirname}/../../src/features/llm.schema/test_llm_schema_${s.name}.ts`, + content.join("\n"), + "utf8", + ); + } + } + + export async function schemas(): Promise { + const location: string = `${__dirname}/../../schemas/llm/type`; + if (fs.existsSync(location)) cp.execSync("npx rimraf " + location); + await mkdir(location); + await iterate(); + } + + function getSchema(content: string): object { + const first: number = content.lastIndexOf(`")({`) + 4; + const last: number = content.lastIndexOf("}"); + return new Function("return {" + content.substring(first, last) + "}")(); + } + + async function iterate() { + const path: string = `${__dirname}/../../src/features/llm.schema`; + const schemaPath: string = `${__dirname}/../../schemas/llm/type`; + for (const file of await fs.promises.readdir(path)) { + if (file.substring(file.length - 3) !== ".ts") continue; + + const name: string = file.substring( + `test_llm_schema_`.length, + file.length - 3, + ); + console.log(name); + const location: string = + __dirname + `/../../bin/features/llm.schema/${file.slice(0, -3)}.js`; + const schema: object = getSchema( + await fs.promises.readFile(location, "utf8"), + ); + await fs.promises.writeFile( + `${schemaPath}/${name}.json`, + JSON.stringify(schema, null, 2), + "utf8", + ); + } + } + + async function mkdir(path: string): Promise { + if (fs.existsSync(path)) cp.execSync(`npx rimraf ${path}`); + await fs.promises.mkdir(path, { recursive: true }); + } +} diff --git a/test/build/internal/TestStructure.ts b/test/build/internal/TestStructure.ts index 47b6987a0b..1b3c617411 100644 --- a/test/build/internal/TestStructure.ts +++ b/test/build/internal/TestStructure.ts @@ -15,4 +15,5 @@ export interface TestStructure { JSONABLE?: boolean; PRIMITIVE?: boolean; RANDOM?: false | typia.IRandomGenerator; + RECURSIVE?: true; } diff --git a/test/build/template.ts b/test/build/template.ts index 1f7101fc47..182a04e177 100644 --- a/test/build/template.ts +++ b/test/build/template.ts @@ -2,7 +2,8 @@ import cp from "child_process"; import fs from "fs"; import { TestFeature } from "./internal/TestFeature"; -import { TestJsonApplicationGenerator } from "./internal/TestJsonApplicationGenerator"; +import { TestJsonSchemaGenerator } from "./internal/TestJsonSchemaGenerator"; +import { TestLlmSchemaGenerator } from "./internal/TestLlmSchemaGenerator"; import { TestProtobufMessageGenerator } from "./internal/TestProtobufMessageGenerator"; import { TestReflectMetadataGenerator } from "./internal/TestReflectMetadataGenerator"; import { TestStructure } from "./internal/TestStructure"; @@ -161,16 +162,19 @@ async function main(): Promise { if (fs.existsSync(schemas)) cp.execSync(`npx rimraf ${schemas}`); await fs.promises.mkdir(schemas, { recursive: true }); - await TestJsonApplicationGenerator.generate(structures); + await TestJsonSchemaGenerator.generate(structures); await TestProtobufMessageGenerator.generate(structures); await TestReflectMetadataGenerator.generate(structures); + await TestLlmSchemaGenerator.generate(structures); // FILL SCHEMA CONTENTS await new Promise((resolve) => setTimeout(resolve, 1000)); cp.execSync("npm run build", { stdio: "inherit" }); - await TestJsonApplicationGenerator.schemas(); + + await TestJsonSchemaGenerator.schemas(); await TestProtobufMessageGenerator.schemas(); await TestReflectMetadataGenerator.schemas(); + await TestLlmSchemaGenerator.schemas(); cp.execSync("npm run prettier", { stdio: "inherit" }); } diff --git a/test/package.json b/test/package.json index 7459f2fa13..1e39dd5e7c 100644 --- a/test/package.json +++ b/test/package.json @@ -52,6 +52,6 @@ "suppress-warnings": "^1.0.2", "tstl": "^3.0.0", "uuid": "^9.0.1", - "typia": "../typia-6.10.0-dev.20240823.tgz" + "typia": "../typia-6.10.0-dev.20240906.tgz" } } \ No newline at end of file diff --git a/test/schemas/llm/type/ArrayAny.json b/test/schemas/llm/type/ArrayAny.json new file mode 100644 index 0000000000..63e2288e06 --- /dev/null +++ b/test/schemas/llm/type/ArrayAny.json @@ -0,0 +1,53 @@ +{ + "type": "object", + "properties": { + "anys": { + "type": "array", + "items": {} + }, + "undefindable1": { + "type": "array", + "items": {} + }, + "undefindable2": { + "type": "array", + "items": {} + }, + "nullables1": { + "type": "array", + "items": {}, + "nullable": true + }, + "nullables2": { + "type": "array", + "items": {}, + "nullable": true + }, + "both1": { + "type": "array", + "items": {}, + "nullable": true + }, + "both2": { + "type": "array", + "items": {}, + "nullable": true + }, + "both3": { + "type": "array", + "items": {}, + "nullable": true + }, + "union": { + "type": "array", + "items": {} + } + }, + "nullable": false, + "required": [ + "anys", + "nullables1", + "nullables2", + "union" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ArrayAtomicAlias.json b/test/schemas/llm/type/ArrayAtomicAlias.json new file mode 100644 index 0000000000..69987ae2ea --- /dev/null +++ b/test/schemas/llm/type/ArrayAtomicAlias.json @@ -0,0 +1,27 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "minItems": 3, + "maxItems": 3 +} \ No newline at end of file diff --git a/test/schemas/llm/type/ArrayAtomicSimple.json b/test/schemas/llm/type/ArrayAtomicSimple.json new file mode 100644 index 0000000000..69987ae2ea --- /dev/null +++ b/test/schemas/llm/type/ArrayAtomicSimple.json @@ -0,0 +1,27 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "minItems": 3, + "maxItems": 3 +} \ No newline at end of file diff --git a/test/schemas/llm/type/ArrayHierarchical.json b/test/schemas/llm/type/ArrayHierarchical.json new file mode 100644 index 0000000000..2479c6c722 --- /dev/null +++ b/test/schemas/llm/type/ArrayHierarchical.json @@ -0,0 +1,126 @@ +{ + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "serial": { + "type": "number" + }, + "name": { + "type": "string" + }, + "established_at": { + "type": "object", + "properties": { + "time": { + "type": "number" + }, + "zone": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "time", + "zone" + ] + }, + "departments": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "code": { + "type": "string" + }, + "sales": { + "type": "number" + }, + "created_at": { + "type": "object", + "properties": { + "time": { + "type": "number" + }, + "zone": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "time", + "zone" + ] + }, + "employees": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "name": { + "type": "string" + }, + "age": { + "type": "number" + }, + "grade": { + "type": "number" + }, + "employeed_at": { + "type": "object", + "properties": { + "time": { + "type": "number" + }, + "zone": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "time", + "zone" + ] + } + }, + "nullable": false, + "required": [ + "id", + "name", + "age", + "grade", + "employeed_at" + ] + } + } + }, + "nullable": false, + "required": [ + "id", + "code", + "sales", + "created_at", + "employees" + ] + } + } + }, + "nullable": false, + "required": [ + "id", + "serial", + "name", + "established_at", + "departments" + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/ArrayHierarchicalPointer.json b/test/schemas/llm/type/ArrayHierarchicalPointer.json new file mode 100644 index 0000000000..7d03350cc4 --- /dev/null +++ b/test/schemas/llm/type/ArrayHierarchicalPointer.json @@ -0,0 +1,135 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "serial": { + "type": "number" + }, + "name": { + "type": "string" + }, + "established_at": { + "type": "object", + "properties": { + "time": { + "type": "number" + }, + "zone": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "time", + "zone" + ] + }, + "departments": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "code": { + "type": "string" + }, + "sales": { + "type": "number" + }, + "created_at": { + "type": "object", + "properties": { + "time": { + "type": "number" + }, + "zone": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "time", + "zone" + ] + }, + "employees": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "name": { + "type": "string" + }, + "age": { + "type": "number" + }, + "grade": { + "type": "number" + }, + "employeed_at": { + "type": "object", + "properties": { + "time": { + "type": "number" + }, + "zone": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "time", + "zone" + ] + } + }, + "nullable": false, + "required": [ + "id", + "name", + "age", + "grade", + "employeed_at" + ] + } + } + }, + "nullable": false, + "required": [ + "id", + "code", + "sales", + "created_at", + "employees" + ] + } + } + }, + "nullable": false, + "required": [ + "id", + "serial", + "name", + "established_at", + "departments" + ] + } + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ArrayMatrix.json b/test/schemas/llm/type/ArrayMatrix.json new file mode 100644 index 0000000000..b71a8043df --- /dev/null +++ b/test/schemas/llm/type/ArrayMatrix.json @@ -0,0 +1,12 @@ +{ + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + } + } + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/ArraySimple.json b/test/schemas/llm/type/ArraySimple.json new file mode 100644 index 0000000000..7df4a4f1ea --- /dev/null +++ b/test/schemas/llm/type/ArraySimple.json @@ -0,0 +1,43 @@ +{ + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "hobbies": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "body": { + "type": "string" + }, + "rank": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "name", + "body", + "rank" + ] + } + } + }, + "nullable": false, + "required": [ + "name", + "email", + "hobbies" + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/ArrayUnion.json b/test/schemas/llm/type/ArrayUnion.json new file mode 100644 index 0000000000..6f1b0f65e8 --- /dev/null +++ b/test/schemas/llm/type/ArrayUnion.json @@ -0,0 +1,25 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "type": "array", + "items": { + "type": "number" + } + } + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/AtomicAlias.json b/test/schemas/llm/type/AtomicAlias.json new file mode 100644 index 0000000000..a9dc150cdd --- /dev/null +++ b/test/schemas/llm/type/AtomicAlias.json @@ -0,0 +1,18 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + } + ] + }, + "minItems": 3, + "maxItems": 3 +} \ No newline at end of file diff --git a/test/schemas/llm/type/AtomicClass.json b/test/schemas/llm/type/AtomicClass.json new file mode 100644 index 0000000000..74c0cf600a --- /dev/null +++ b/test/schemas/llm/type/AtomicClass.json @@ -0,0 +1,18 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + } + ] + }, + "minItems": 9, + "maxItems": 9 +} \ No newline at end of file diff --git a/test/schemas/llm/type/AtomicIntersection.json b/test/schemas/llm/type/AtomicIntersection.json new file mode 100644 index 0000000000..a9dc150cdd --- /dev/null +++ b/test/schemas/llm/type/AtomicIntersection.json @@ -0,0 +1,18 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + } + ] + }, + "minItems": 3, + "maxItems": 3 +} \ No newline at end of file diff --git a/test/schemas/llm/type/AtomicSimple.json b/test/schemas/llm/type/AtomicSimple.json new file mode 100644 index 0000000000..a9dc150cdd --- /dev/null +++ b/test/schemas/llm/type/AtomicSimple.json @@ -0,0 +1,18 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + } + ] + }, + "minItems": 3, + "maxItems": 3 +} \ No newline at end of file diff --git a/test/schemas/llm/type/AtomicUnion.json b/test/schemas/llm/type/AtomicUnion.json new file mode 100644 index 0000000000..2aaa26775b --- /dev/null +++ b/test/schemas/llm/type/AtomicUnion.json @@ -0,0 +1,19 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "string", + "nullable": true + }, + { + "type": "number", + "nullable": true + }, + { + "type": "boolean", + "nullable": true + } + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/ClassGetter.json b/test/schemas/llm/type/ClassGetter.json new file mode 100644 index 0000000000..46713c7b20 --- /dev/null +++ b/test/schemas/llm/type/ClassGetter.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "dead": { + "type": "boolean", + "nullable": true + } + }, + "nullable": false, + "required": [ + "id", + "name", + "dead" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ClassMethod.json b/test/schemas/llm/type/ClassMethod.json new file mode 100644 index 0000000000..4ebac9586b --- /dev/null +++ b/test/schemas/llm/type/ClassMethod.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "age": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "name", + "age" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ClassPropertyAssignment.json b/test/schemas/llm/type/ClassPropertyAssignment.json new file mode 100644 index 0000000000..50f0bc8d52 --- /dev/null +++ b/test/schemas/llm/type/ClassPropertyAssignment.json @@ -0,0 +1,34 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "name": { + "type": "string" + }, + "note": { + "type": "string", + "enum": [ + "assignment" + ] + }, + "editable": { + "type": "boolean", + "enum": [ + false + ] + }, + "incremental": { + "type": "boolean" + } + }, + "nullable": false, + "required": [ + "id", + "name", + "note", + "editable", + "incremental" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/CommentTagArray.json b/test/schemas/llm/type/CommentTagArray.json new file mode 100644 index 0000000000..5b94c5c1c7 --- /dev/null +++ b/test/schemas/llm/type/CommentTagArray.json @@ -0,0 +1,63 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 3, + "maxItems": 3 + }, + "minItems": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 3 + }, + "both": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 3, + "maxItems": 7 + }, + "equal": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 10, + "maxItems": 10 + }, + "unique": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + } + }, + "nullable": false, + "required": [ + "items", + "minItems", + "both", + "equal", + "unique" + ] + } + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/CommentTagArrayUnion.json b/test/schemas/llm/type/CommentTagArrayUnion.json new file mode 100644 index 0000000000..aaf7cebf78 --- /dev/null +++ b/test/schemas/llm/type/CommentTagArrayUnion.json @@ -0,0 +1,52 @@ +{ + "type": "array", + "items": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 3, + "maxItems": 3 + }, + "minItems": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 3 + }, + "maxItems": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "maxItems": 7 + }, + "both": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 3, + "maxItems": 7 + } + }, + "nullable": false, + "required": [ + "items", + "minItems", + "maxItems", + "both" + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/CommentTagAtomicUnion.json b/test/schemas/llm/type/CommentTagAtomicUnion.json new file mode 100644 index 0000000000..3cc9923e85 --- /dev/null +++ b/test/schemas/llm/type/CommentTagAtomicUnion.json @@ -0,0 +1,34 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "oneOf": [ + { + "type": "string", + "minLength": 3, + "maxLength": 7 + }, + { + "type": "number", + "minimum": 3 + } + ] + } + }, + "nullable": false, + "required": [ + "value" + ] + } + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/CommentTagDefault.json b/test/schemas/llm/type/CommentTagDefault.json new file mode 100644 index 0000000000..6184dbc26a --- /dev/null +++ b/test/schemas/llm/type/CommentTagDefault.json @@ -0,0 +1,121 @@ +{ + "type": "object", + "properties": { + "boolean": { + "type": "boolean", + "title": "Default tag on `boolean` typed value", + "description": "Default tag on `boolean` typed value." + }, + "number": { + "type": "number", + "title": "Default tag on `number` typed value", + "description": "Default tag on `number` typed value." + }, + "string": { + "type": "string", + "title": "Default tag on `string` typed value", + "description": "Default tag on `string` typed value." + }, + "text": { + "type": "string", + "title": "Default tag on `string` typed value with long characters", + "description": "Default tag on `string` typed value with long characters." + }, + "boolean_and_number_and_string": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ], + "title": "Default value on union typed property", + "description": "Default value on union typed property." + }, + "union_but_boolean": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ], + "title": "Default value on union typed property", + "description": "Default value on union typed property." + }, + "union_but_number": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ], + "title": "Default value on union typed property", + "description": "Default value on union typed property." + }, + "union_but_string": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ], + "title": "Default value on union typed property", + "description": "Default value on union typed property." + }, + "vulnerable_range": { + "type": "number", + "minimum": 3, + "maximum": 5, + "title": "Default value on union typed property", + "description": "Default value on union typed property." + }, + "boolean_and_number_and_template": { + "oneOf": [ + { + "type": "string", + "pattern": "^(prefix_(.*))" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ], + "title": "Default value on union typed property", + "description": "Default value on union typed property." + } + }, + "nullable": false, + "required": [ + "boolean", + "number", + "string", + "text", + "boolean_and_number_and_string", + "union_but_boolean", + "union_but_number", + "union_but_string", + "vulnerable_range", + "boolean_and_number_and_template" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/CommentTagFormat.json b/test/schemas/llm/type/CommentTagFormat.json new file mode 100644 index 0000000000..f306d185b7 --- /dev/null +++ b/test/schemas/llm/type/CommentTagFormat.json @@ -0,0 +1,118 @@ +{ + "type": "object", + "properties": { + "byte": { + "type": "string", + "format": "byte" + }, + "password": { + "type": "string", + "format": "password" + }, + "regex": { + "type": "string", + "format": "regex" + }, + "uuid": { + "type": "string", + "format": "uuid" + }, + "email": { + "type": "string", + "format": "email" + }, + "hostname": { + "type": "string", + "format": "hostname" + }, + "idnEmail": { + "type": "string", + "format": "idn-email" + }, + "idnHostname": { + "type": "string", + "format": "idn-hostname" + }, + "iri": { + "type": "string", + "format": "iri" + }, + "iriReference": { + "type": "string", + "format": "iri-reference" + }, + "ipv4": { + "type": "string", + "format": "ipv4" + }, + "ipv6": { + "type": "string", + "format": "ipv6" + }, + "uri": { + "type": "string", + "format": "uri" + }, + "uriReference": { + "type": "string", + "format": "uri-reference" + }, + "uriTemplate": { + "type": "string", + "format": "uri-template" + }, + "url": { + "type": "string", + "format": "url" + }, + "datetime": { + "type": "string", + "format": "date-time" + }, + "date": { + "type": "string", + "format": "date" + }, + "time": { + "type": "string", + "format": "time" + }, + "duration": { + "type": "string", + "format": "duration" + }, + "jsonPointer": { + "type": "string", + "format": "json-pointer" + }, + "relativeJsonPointer": { + "type": "string", + "format": "relative-json-pointer" + } + }, + "nullable": false, + "required": [ + "byte", + "password", + "regex", + "uuid", + "email", + "hostname", + "idnEmail", + "idnHostname", + "iri", + "iriReference", + "ipv4", + "ipv6", + "uri", + "uriReference", + "uriTemplate", + "url", + "datetime", + "date", + "time", + "duration", + "jsonPointer", + "relativeJsonPointer" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/CommentTagLength.json b/test/schemas/llm/type/CommentTagLength.json new file mode 100644 index 0000000000..b6456ad2ee --- /dev/null +++ b/test/schemas/llm/type/CommentTagLength.json @@ -0,0 +1,48 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "object", + "properties": { + "fixed": { + "type": "string", + "minLength": 5, + "maxLength": 5 + }, + "minimum": { + "type": "string", + "minLength": 3 + }, + "maximum": { + "type": "string", + "maxLength": 7 + }, + "minimum_and_maximum": { + "type": "string", + "minLength": 3, + "maxLength": 7 + }, + "equal": { + "type": "string", + "minLength": 10, + "maxLength": 19 + } + }, + "nullable": false, + "required": [ + "fixed", + "minimum", + "maximum", + "minimum_and_maximum", + "equal" + ] + } + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/CommentTagObjectUnion.json b/test/schemas/llm/type/CommentTagObjectUnion.json new file mode 100644 index 0000000000..02727a6a63 --- /dev/null +++ b/test/schemas/llm/type/CommentTagObjectUnion.json @@ -0,0 +1,34 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "value": { + "type": "number", + "minimum": 3 + } + }, + "nullable": false, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "value": { + "type": "string", + "minLength": 3, + "maxLength": 7 + } + }, + "nullable": false, + "required": [ + "value" + ] + } + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/CommentTagPattern.json b/test/schemas/llm/type/CommentTagPattern.json new file mode 100644 index 0000000000..fdf27c1f73 --- /dev/null +++ b/test/schemas/llm/type/CommentTagPattern.json @@ -0,0 +1,28 @@ +{ + "type": "object", + "properties": { + "uuid": { + "type": "string", + "pattern": "[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[4][0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$" + }, + "email": { + "type": "string", + "pattern": "^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$" + }, + "ipv4": { + "type": "string", + "pattern": "(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" + }, + "ipv6": { + "type": "string", + "pattern": "(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$" + } + }, + "nullable": false, + "required": [ + "uuid", + "email", + "ipv4", + "ipv6" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/CommentTagRange.json b/test/schemas/llm/type/CommentTagRange.json new file mode 100644 index 0000000000..d026ba955e --- /dev/null +++ b/test/schemas/llm/type/CommentTagRange.json @@ -0,0 +1,76 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "object", + "properties": { + "greater": { + "type": "integer", + "exclusiveMinimum": true, + "minimum": 3 + }, + "greater_equal": { + "type": "integer", + "minimum": 3 + }, + "less": { + "type": "integer", + "exclusiveMaximum": true, + "maximum": 7 + }, + "less_equal": { + "type": "integer", + "maximum": 7 + }, + "greater_less": { + "type": "integer", + "exclusiveMinimum": true, + "minimum": 3, + "exclusiveMaximum": true, + "maximum": 7 + }, + "greater_equal_less": { + "type": "integer", + "minimum": 3, + "exclusiveMaximum": true, + "maximum": 7 + }, + "greater_less_equal": { + "type": "integer", + "exclusiveMinimum": true, + "minimum": 3, + "maximum": 7 + }, + "greater_equal_less_equal": { + "type": "integer", + "minimum": 3, + "maximum": 7 + }, + "equal": { + "type": "integer", + "minimum": 10, + "maximum": 10 + } + }, + "nullable": false, + "required": [ + "greater", + "greater_equal", + "less", + "less_equal", + "greater_less", + "greater_equal_less", + "greater_less_equal", + "greater_equal_less_equal", + "equal" + ] + } + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/CommentTagType.json b/test/schemas/llm/type/CommentTagType.json new file mode 100644 index 0000000000..8a62d3818c --- /dev/null +++ b/test/schemas/llm/type/CommentTagType.json @@ -0,0 +1,52 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "object", + "properties": { + "int": { + "type": "integer", + "title": "Integer value", + "description": "Integer value." + }, + "uint": { + "type": "integer", + "title": "Unsigned integer value", + "description": "Unsigned integer value." + }, + "int32": { + "type": "integer" + }, + "uint32": { + "type": "integer" + }, + "int64": { + "type": "integer" + }, + "uint64": { + "type": "integer" + }, + "float": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "int", + "uint", + "int32", + "uint32", + "int64", + "uint64", + "float" + ] + } + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ConstantAtomicAbsorbed.json b/test/schemas/llm/type/ConstantAtomicAbsorbed.json new file mode 100644 index 0000000000..182c8602f8 --- /dev/null +++ b/test/schemas/llm/type/ConstantAtomicAbsorbed.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string", + "default": "something" + }, + "age": { + "type": "number", + "default": 20 + } + }, + "nullable": false, + "required": [ + "id", + "age" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ConstantAtomicSimple.json b/test/schemas/llm/type/ConstantAtomicSimple.json new file mode 100644 index 0000000000..031d320b2c --- /dev/null +++ b/test/schemas/llm/type/ConstantAtomicSimple.json @@ -0,0 +1,28 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "boolean", + "enum": [ + false, + true + ] + }, + { + "type": "number", + "enum": [ + 2 + ] + }, + { + "type": "string", + "enum": [ + "three" + ] + } + ] + }, + "minItems": 4, + "maxItems": 4 +} \ No newline at end of file diff --git a/test/schemas/llm/type/ConstantAtomicTagged.json b/test/schemas/llm/type/ConstantAtomicTagged.json new file mode 100644 index 0000000000..84c72bf26e --- /dev/null +++ b/test/schemas/llm/type/ConstantAtomicTagged.json @@ -0,0 +1,38 @@ +{ + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string", + "enum": [ + "latest" + ] + }, + { + "type": "string", + "format": "uuid" + } + ] + }, + "age": { + "oneOf": [ + { + "type": "number", + "enum": [ + -1 + ] + }, + { + "type": "integer", + "maximum": 100 + } + ] + } + }, + "nullable": false, + "required": [ + "id", + "age" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ConstantAtomicUnion.json b/test/schemas/llm/type/ConstantAtomicUnion.json new file mode 100644 index 0000000000..eccbd4f12f --- /dev/null +++ b/test/schemas/llm/type/ConstantAtomicUnion.json @@ -0,0 +1,42 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "boolean", + "enum": [ + false + ] + }, + { + "type": "number", + "enum": [ + 1, + 2 + ] + }, + { + "type": "string", + "enum": [ + "three", + "four" + ] + }, + { + "type": "object", + "properties": { + "key": { + "type": "string", + "enum": [ + "key" + ] + } + }, + "nullable": false, + "required": [ + "key" + ] + } + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/ConstantAtomicWrapper.json b/test/schemas/llm/type/ConstantAtomicWrapper.json new file mode 100644 index 0000000000..5c51ca6176 --- /dev/null +++ b/test/schemas/llm/type/ConstantAtomicWrapper.json @@ -0,0 +1,45 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "value": { + "type": "boolean" + } + }, + "nullable": false, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "value": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "value": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "value" + ] + } + ] + }, + "minItems": 3, + "maxItems": 3 +} \ No newline at end of file diff --git a/test/schemas/llm/type/ConstantConstEnumeration.json b/test/schemas/llm/type/ConstantConstEnumeration.json new file mode 100644 index 0000000000..cc7bc2f458 --- /dev/null +++ b/test/schemas/llm/type/ConstantConstEnumeration.json @@ -0,0 +1,22 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "number", + "enum": [ + 0, + 1, + 2 + ] + }, + { + "type": "string", + "enum": [ + "Three", + "Four" + ] + } + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/ConstantEnumeration.json b/test/schemas/llm/type/ConstantEnumeration.json new file mode 100644 index 0000000000..cc7bc2f458 --- /dev/null +++ b/test/schemas/llm/type/ConstantEnumeration.json @@ -0,0 +1,22 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "number", + "enum": [ + 0, + 1, + 2 + ] + }, + { + "type": "string", + "enum": [ + "Three", + "Four" + ] + } + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/ConstantIntersection.json b/test/schemas/llm/type/ConstantIntersection.json new file mode 100644 index 0000000000..9613f21097 --- /dev/null +++ b/test/schemas/llm/type/ConstantIntersection.json @@ -0,0 +1,27 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "boolean", + "enum": [ + false + ] + }, + { + "type": "number", + "enum": [ + 1 + ] + }, + { + "type": "string", + "enum": [ + "two" + ] + } + ] + }, + "minItems": 3, + "maxItems": 3 +} \ No newline at end of file diff --git a/test/schemas/llm/type/DynamicArray.json b/test/schemas/llm/type/DynamicArray.json new file mode 100644 index 0000000000..68e7eba4a8 --- /dev/null +++ b/test/schemas/llm/type/DynamicArray.json @@ -0,0 +1,20 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "object", + "properties": {}, + "nullable": false, + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/DynamicComposite.json b/test/schemas/llm/type/DynamicComposite.json new file mode 100644 index 0000000000..27209c891d --- /dev/null +++ b/test/schemas/llm/type/DynamicComposite.json @@ -0,0 +1,29 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "id", + "name" + ], + "additionalProperties": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/DynamicConstant.json b/test/schemas/llm/type/DynamicConstant.json new file mode 100644 index 0000000000..c663e2c274 --- /dev/null +++ b/test/schemas/llm/type/DynamicConstant.json @@ -0,0 +1,33 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "object", + "properties": { + "a": { + "type": "number" + }, + "b": { + "type": "number" + }, + "c": { + "type": "number" + }, + "d": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "a", + "b", + "c", + "d" + ] + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/DynamicEnumeration.json b/test/schemas/llm/type/DynamicEnumeration.json new file mode 100644 index 0000000000..849cb1884a --- /dev/null +++ b/test/schemas/llm/type/DynamicEnumeration.json @@ -0,0 +1,45 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "object", + "properties": { + "ar": { + "type": "string" + }, + "zh-Hans": { + "type": "string" + }, + "zh-Hant": { + "type": "string" + }, + "en": { + "type": "string" + }, + "fr": { + "type": "string" + }, + "de": { + "type": "string" + }, + "ja": { + "type": "string" + }, + "ko": { + "type": "string" + }, + "pt": { + "type": "string" + }, + "ru": { + "type": "string" + } + }, + "nullable": false + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/DynamicNever.json b/test/schemas/llm/type/DynamicNever.json new file mode 100644 index 0000000000..82853a2c15 --- /dev/null +++ b/test/schemas/llm/type/DynamicNever.json @@ -0,0 +1,5 @@ +{ + "type": "object", + "properties": {}, + "nullable": false +} \ No newline at end of file diff --git a/test/schemas/llm/type/DynamicSimple.json b/test/schemas/llm/type/DynamicSimple.json new file mode 100644 index 0000000000..d99508e08b --- /dev/null +++ b/test/schemas/llm/type/DynamicSimple.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "object", + "properties": {}, + "nullable": false, + "additionalProperties": { + "type": "number" + } + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/DynamicTemplate.json b/test/schemas/llm/type/DynamicTemplate.json new file mode 100644 index 0000000000..65aded246d --- /dev/null +++ b/test/schemas/llm/type/DynamicTemplate.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": {}, + "nullable": false, + "additionalProperties": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/DynamicUndefined.json b/test/schemas/llm/type/DynamicUndefined.json new file mode 100644 index 0000000000..82853a2c15 --- /dev/null +++ b/test/schemas/llm/type/DynamicUndefined.json @@ -0,0 +1,5 @@ +{ + "type": "object", + "properties": {}, + "nullable": false +} \ No newline at end of file diff --git a/test/schemas/llm/type/DynamicUnion.json b/test/schemas/llm/type/DynamicUnion.json new file mode 100644 index 0000000000..8bbb070407 --- /dev/null +++ b/test/schemas/llm/type/DynamicUnion.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": {}, + "nullable": false, + "additionalProperties": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectAlias.json b/test/schemas/llm/type/ObjectAlias.json new file mode 100644 index 0000000000..f842e93e60 --- /dev/null +++ b/test/schemas/llm/type/ObjectAlias.json @@ -0,0 +1,55 @@ +{ + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + }, + "sex": { + "oneOf": [ + { + "type": "number", + "enum": [ + 1, + 2 + ], + "nullable": true + }, + { + "type": "string", + "enum": [ + "male", + "female" + ], + "nullable": true + } + ] + }, + "age": { + "type": "number", + "nullable": true + }, + "dead": { + "type": "boolean", + "nullable": true + } + }, + "nullable": false, + "required": [ + "id", + "email", + "name", + "sex", + "age", + "dead" + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectDate.json b/test/schemas/llm/type/ObjectDate.json new file mode 100644 index 0000000000..d7d3b6a60b --- /dev/null +++ b/test/schemas/llm/type/ObjectDate.json @@ -0,0 +1,37 @@ +{ + "type": "object", + "properties": { + "classDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "date": { + "type": "string", + "format": "date", + "nullable": true + }, + "datetime": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "time": { + "type": "string", + "format": "time", + "nullable": true + }, + "duration": { + "type": "string", + "format": "duration", + "nullable": true + } + }, + "nullable": false, + "required": [ + "date", + "datetime", + "time", + "duration" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectDescription.json b/test/schemas/llm/type/ObjectDescription.json new file mode 100644 index 0000000000..60129b225c --- /dev/null +++ b/test/schemas/llm/type/ObjectDescription.json @@ -0,0 +1,44 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "title": "Primary Key", + "description": "Primary Key." + }, + "deprecated": { + "type": "boolean", + "deprecated": true, + "title": "Deprecated property", + "description": "Deprecated property.\n\nIf `@deprecated` comment tag being utilized, the property will be marked\nas deprecated in the JSON scheam." + }, + "title": { + "type": "string", + "title": "This is the title", + "description": "Title tag can replace the first line of the comment." + }, + "descriptions": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Description property", + "description": "Description property.\n\nIf you write first line and the first line ends with \".\" character,\nit would be considered as the title. By the way, description does\nnot exclusive the title, so that full content be written." + }, + "newLine": { + "type": "number", + "description": "New line before dot character\n\nIf dot character (\".\") being used before the first new line, it would not\nbe considered as title in the JSON schema." + } + }, + "nullable": false, + "required": [ + "id", + "deprecated", + "title", + "descriptions", + "newLine" + ], + "title": "This is the title of object type", + "description": "An interface designed to test JSON schema's object description." +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectDynamic.json b/test/schemas/llm/type/ObjectDynamic.json new file mode 100644 index 0000000000..65aded246d --- /dev/null +++ b/test/schemas/llm/type/ObjectDynamic.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": {}, + "nullable": false, + "additionalProperties": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectGeneric.json b/test/schemas/llm/type/ObjectGeneric.json new file mode 100644 index 0000000000..4920321243 --- /dev/null +++ b/test/schemas/llm/type/ObjectGeneric.json @@ -0,0 +1,156 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "value": { + "type": "boolean" + }, + "child": { + "type": "object", + "properties": { + "child_value": { + "type": "boolean" + }, + "child_next": { + "type": "boolean" + } + }, + "nullable": false, + "required": [ + "child_value", + "child_next" + ] + }, + "elements": { + "type": "array", + "items": { + "type": "object", + "properties": { + "child_value": { + "type": "boolean" + }, + "child_next": { + "type": "boolean" + } + }, + "nullable": false, + "required": [ + "child_value", + "child_next" + ] + } + } + }, + "nullable": false, + "required": [ + "value", + "child", + "elements" + ] + }, + { + "type": "object", + "properties": { + "value": { + "type": "number" + }, + "child": { + "type": "object", + "properties": { + "child_value": { + "type": "number" + }, + "child_next": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "child_value", + "child_next" + ] + }, + "elements": { + "type": "array", + "items": { + "type": "object", + "properties": { + "child_value": { + "type": "number" + }, + "child_next": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "child_value", + "child_next" + ] + } + } + }, + "nullable": false, + "required": [ + "value", + "child", + "elements" + ] + }, + { + "type": "object", + "properties": { + "value": { + "type": "string" + }, + "child": { + "type": "object", + "properties": { + "child_value": { + "type": "string" + }, + "child_next": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "child_value", + "child_next" + ] + }, + "elements": { + "type": "array", + "items": { + "type": "object", + "properties": { + "child_value": { + "type": "string" + }, + "child_next": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "child_value", + "child_next" + ] + } + } + }, + "nullable": false, + "required": [ + "value", + "child", + "elements" + ] + } + ] + }, + "minItems": 3, + "maxItems": 3 +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectGenericAlias.json b/test/schemas/llm/type/ObjectGenericAlias.json new file mode 100644 index 0000000000..83106cf013 --- /dev/null +++ b/test/schemas/llm/type/ObjectGenericAlias.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectGenericArray.json b/test/schemas/llm/type/ObjectGenericArray.json new file mode 100644 index 0000000000..0813920ba5 --- /dev/null +++ b/test/schemas/llm/type/ObjectGenericArray.json @@ -0,0 +1,53 @@ +{ + "type": "object", + "properties": { + "pagination": { + "type": "object", + "properties": { + "page": { + "type": "number" + }, + "limit": { + "type": "number" + }, + "total_count": { + "type": "number" + }, + "total_pages": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "page", + "limit", + "total_count", + "total_pages" + ] + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "age": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "name", + "age" + ] + } + } + }, + "nullable": false, + "required": [ + "pagination", + "data" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectGenericUnion.json b/test/schemas/llm/type/ObjectGenericUnion.json new file mode 100644 index 0000000000..51190e5e6b --- /dev/null +++ b/test/schemas/llm/type/ObjectGenericUnion.json @@ -0,0 +1,319 @@ +{ + "type": "object", + "properties": { + "value": { + "oneOf": [ + { + "type": "object", + "properties": { + "writer": { + "type": "string" + }, + "answer": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "hit": { + "type": "number" + }, + "contents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "title": { + "type": "string" + }, + "body": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "extension": { + "type": "string", + "nullable": true + }, + "url": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "name", + "extension", + "url" + ] + } + } + }, + "nullable": false, + "required": [ + "id", + "created_at", + "title", + "body", + "files" + ] + } + }, + "created_at": { + "type": "string" + } + }, + "nullable": true, + "required": [ + "id", + "hit", + "contents", + "created_at" + ] + }, + "id": { + "type": "string" + }, + "hit": { + "type": "number" + }, + "contents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "title": { + "type": "string" + }, + "body": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "extension": { + "type": "string", + "nullable": true + }, + "url": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "name", + "extension", + "url" + ] + } + } + }, + "nullable": false, + "required": [ + "id", + "created_at", + "title", + "body", + "files" + ] + } + }, + "created_at": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "writer", + "answer", + "id", + "hit", + "contents", + "created_at" + ] + }, + { + "type": "object", + "properties": { + "writer": { + "type": "string" + }, + "answer": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "hit": { + "type": "number" + }, + "contents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "title": { + "type": "string" + }, + "body": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "extension": { + "type": "string", + "nullable": true + }, + "url": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "name", + "extension", + "url" + ] + } + } + }, + "nullable": false, + "required": [ + "id", + "created_at", + "title", + "body", + "files" + ] + } + }, + "created_at": { + "type": "string" + } + }, + "nullable": true, + "required": [ + "id", + "hit", + "contents", + "created_at" + ] + }, + "id": { + "type": "string" + }, + "hit": { + "type": "number" + }, + "contents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "score": { + "type": "number" + }, + "id": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "title": { + "type": "string" + }, + "body": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "extension": { + "type": "string", + "nullable": true + }, + "url": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "name", + "extension", + "url" + ] + } + } + }, + "nullable": false, + "required": [ + "score", + "id", + "created_at", + "title", + "body", + "files" + ] + } + }, + "created_at": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "writer", + "answer", + "id", + "hit", + "contents", + "created_at" + ] + } + ] + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectHierarchical.json b/test/schemas/llm/type/ObjectHierarchical.json new file mode 100644 index 0000000000..5bf31571a0 --- /dev/null +++ b/test/schemas/llm/type/ObjectHierarchical.json @@ -0,0 +1,277 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "channel": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "code": { + "type": "string" + }, + "name": { + "type": "string" + }, + "sequence": { + "type": "number" + }, + "exclusive": { + "type": "boolean" + }, + "priority": { + "type": "number" + }, + "created_at": { + "type": "object", + "properties": { + "time": { + "type": "number" + }, + "zone": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "time", + "zone" + ] + } + }, + "nullable": false, + "required": [ + "id", + "code", + "name", + "sequence", + "exclusive", + "priority", + "created_at" + ] + }, + "member": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "account": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "code": { + "type": "string" + }, + "created_at": { + "type": "object", + "properties": { + "time": { + "type": "number" + }, + "zone": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "time", + "zone" + ] + } + }, + "nullable": false, + "required": [ + "id", + "code", + "created_at" + ] + }, + "enterprise": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "account": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "code": { + "type": "string" + }, + "created_at": { + "type": "object", + "properties": { + "time": { + "type": "number" + }, + "zone": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "time", + "zone" + ] + } + }, + "nullable": false, + "required": [ + "id", + "code", + "created_at" + ] + }, + "name": { + "type": "string" + }, + "grade": { + "type": "number" + }, + "created_at": { + "type": "object", + "properties": { + "time": { + "type": "number" + }, + "zone": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "time", + "zone" + ] + } + }, + "nullable": true, + "required": [ + "id", + "account", + "name", + "grade", + "created_at" + ] + }, + "emails": { + "type": "array", + "items": { + "type": "string" + } + }, + "created_at": { + "type": "object", + "properties": { + "time": { + "type": "number" + }, + "zone": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "time", + "zone" + ] + }, + "authorized": { + "type": "boolean" + } + }, + "nullable": true, + "required": [ + "id", + "account", + "enterprise", + "emails", + "created_at", + "authorized" + ] + }, + "account": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "code": { + "type": "string" + }, + "created_at": { + "type": "object", + "properties": { + "time": { + "type": "number" + }, + "zone": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "time", + "zone" + ] + } + }, + "nullable": true, + "required": [ + "id", + "code", + "created_at" + ] + }, + "href": { + "type": "string" + }, + "referrer": { + "type": "string" + }, + "ip": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 4, + "maxItems": 4 + }, + "created_at": { + "type": "object", + "properties": { + "time": { + "type": "number" + }, + "zone": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "time", + "zone" + ] + } + }, + "nullable": false, + "required": [ + "id", + "channel", + "member", + "account", + "href", + "referrer", + "ip", + "created_at" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectInternal.json b/test/schemas/llm/type/ObjectInternal.json new file mode 100644 index 0000000000..a19c59b3b9 --- /dev/null +++ b/test/schemas/llm/type/ObjectInternal.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "id", + "name" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectIntersection.json b/test/schemas/llm/type/ObjectIntersection.json new file mode 100644 index 0000000000..82e04dd71d --- /dev/null +++ b/test/schemas/llm/type/ObjectIntersection.json @@ -0,0 +1,20 @@ +{ + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "name": { + "type": "string" + }, + "vulnerable": { + "type": "boolean" + } + }, + "nullable": false, + "required": [ + "email", + "name", + "vulnerable" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectJsonTag.json b/test/schemas/llm/type/ObjectJsonTag.json new file mode 100644 index 0000000000..24b3b0ed77 --- /dev/null +++ b/test/schemas/llm/type/ObjectJsonTag.json @@ -0,0 +1,31 @@ +{ + "type": "object", + "properties": { + "vulnerable": { + "type": "string", + "deprecated": true + }, + "description": { + "type": "string", + "title": "Descripted property", + "description": "Descripted property." + }, + "title": { + "type": "string", + "title": "something", + "description": "Titled property." + }, + "complicate_title": { + "type": "string", + "title": "something weirdo with {@link something } tag", + "description": "Complicate title." + } + }, + "nullable": false, + "required": [ + "vulnerable", + "description", + "title", + "complicate_title" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectLiteralProperty.json b/test/schemas/llm/type/ObjectLiteralProperty.json new file mode 100644 index 0000000000..67d27fcc29 --- /dev/null +++ b/test/schemas/llm/type/ObjectLiteralProperty.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "something-interesting-do-you-want?": { + "type": "string" + }, + "or-something-crazy-do-you-want?": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "something-interesting-do-you-want?", + "or-something-crazy-do-you-want?" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectLiteralType.json b/test/schemas/llm/type/ObjectLiteralType.json new file mode 100644 index 0000000000..c7de81935e --- /dev/null +++ b/test/schemas/llm/type/ObjectLiteralType.json @@ -0,0 +1,20 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "age": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "id", + "name", + "age" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectNullable.json b/test/schemas/llm/type/ObjectNullable.json new file mode 100644 index 0000000000..860077e48a --- /dev/null +++ b/test/schemas/llm/type/ObjectNullable.json @@ -0,0 +1,107 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "manufacturer": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "manufacturer" + ] + }, + "name": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "type", + "name" + ] + }, + "brand": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "brand" + ] + }, + "name": { + "type": "string" + } + }, + "nullable": true, + "required": [ + "type", + "name" + ] + }, + "similar": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "brand" + ] + }, + "name": { + "type": "string" + } + }, + "nullable": true, + "required": [ + "type", + "name" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "manufacturer" + ] + }, + "name": { + "type": "string" + } + }, + "nullable": true, + "required": [ + "type", + "name" + ] + } + ] + } + }, + "nullable": false, + "required": [ + "name", + "manufacturer", + "brand", + "similar" + ] + } + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectOptional.json b/test/schemas/llm/type/ObjectOptional.json new file mode 100644 index 0000000000..719ea4a9fa --- /dev/null +++ b/test/schemas/llm/type/ObjectOptional.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "sequence": { + "type": "number" + } + }, + "nullable": false +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectPrimitive.json b/test/schemas/llm/type/ObjectPrimitive.json new file mode 100644 index 0000000000..8c5ef3ce03 --- /dev/null +++ b/test/schemas/llm/type/ObjectPrimitive.json @@ -0,0 +1,69 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "extension": { + "type": "string", + "enum": [ + "txt", + "md", + "html" + ] + }, + "title": { + "type": "string" + }, + "body": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "extension": { + "type": "string" + }, + "url": { + "type": "string" + }, + "created_at": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "id", + "name", + "extension", + "url", + "created_at" + ] + } + }, + "secret": { + "type": "boolean" + }, + "created_at": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "id", + "extension", + "title", + "body", + "files", + "secret", + "created_at" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectPropertyNullable.json b/test/schemas/llm/type/ObjectPropertyNullable.json new file mode 100644 index 0000000000..9d5d0d23d0 --- /dev/null +++ b/test/schemas/llm/type/ObjectPropertyNullable.json @@ -0,0 +1,98 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "type": "boolean", + "nullable": true + } + }, + "nullable": false, + "required": [ + "value" + ] + } + }, + { + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "value" + ] + } + }, + { + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "type": "string", + "nullable": true + } + }, + "nullable": false, + "required": [ + "value" + ] + } + }, + { + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string", + "nullable": true + }, + "grade": { + "type": "number" + }, + "serial": { + "type": "number", + "nullable": true + }, + "activated": { + "type": "boolean", + "nullable": true + } + }, + "nullable": true, + "required": [ + "id", + "name", + "activated" + ] + } + }, + "nullable": false, + "required": [ + "value" + ] + } + } + ] + }, + "minItems": 4, + "maxItems": 4 +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectSimple.json b/test/schemas/llm/type/ObjectSimple.json new file mode 100644 index 0000000000..845b92b924 --- /dev/null +++ b/test/schemas/llm/type/ObjectSimple.json @@ -0,0 +1,92 @@ +{ + "type": "object", + "properties": { + "scale": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y", + "z" + ] + }, + "position": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y", + "z" + ] + }, + "rotate": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y", + "z" + ] + }, + "pivot": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y", + "z" + ] + } + }, + "nullable": false, + "required": [ + "scale", + "position", + "rotate", + "pivot" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectTuple.json b/test/schemas/llm/type/ObjectTuple.json new file mode 100644 index 0000000000..a9c940758a --- /dev/null +++ b/test/schemas/llm/type/ObjectTuple.json @@ -0,0 +1,49 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "code": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "id", + "code", + "name" + ] + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "mobile": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "id", + "mobile", + "name" + ] + } + ] + }, + "minItems": 2, + "maxItems": 2 +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectUndefined.json b/test/schemas/llm/type/ObjectUndefined.json new file mode 100644 index 0000000000..e48e2935a8 --- /dev/null +++ b/test/schemas/llm/type/ObjectUndefined.json @@ -0,0 +1,46 @@ +{ + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "professor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "classroom": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "id", + "name" + ] + }, + "grade": { + "type": "number" + }, + "unknown": {} + }, + "nullable": false, + "required": [ + "name", + "unknown" + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectUnionComposite.json b/test/schemas/llm/type/ObjectUnionComposite.json new file mode 100644 index 0000000000..58356e8de7 --- /dev/null +++ b/test/schemas/llm/type/ObjectUnionComposite.json @@ -0,0 +1,371 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + { + "type": "object", + "properties": { + "p1": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p2": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + }, + "nullable": false, + "required": [ + "p1", + "p2" + ] + }, + { + "type": "object", + "properties": { + "p1": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p2": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + }, + "nullable": false, + "required": [ + "p1", + "p2", + "p3" + ] + }, + { + "type": "object", + "properties": { + "p1": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p2": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p4": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + }, + "nullable": false, + "required": [ + "p1", + "p2", + "p3", + "p4" + ] + }, + { + "type": "object", + "properties": { + "points": { + "type": "array", + "items": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + } + }, + "nullable": false, + "required": [ + "points" + ] + }, + { + "type": "object", + "properties": { + "outer": { + "type": "array", + "items": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + }, + "inner": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + }, + "nullable": false, + "required": [ + "outer", + "inner" + ] + }, + { + "type": "object", + "properties": { + "outer": { + "type": "object", + "properties": { + "points": { + "type": "array", + "items": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + } + }, + "nullable": false, + "required": [ + "points" + ] + }, + "inner": { + "type": "array", + "items": { + "type": "object", + "properties": { + "points": { + "type": "array", + "items": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + } + }, + "nullable": false, + "required": [ + "points" + ] + } + } + }, + "nullable": false, + "required": [ + "outer", + "inner" + ] + }, + { + "type": "object", + "properties": { + "centroid": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "radius": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "centroid", + "radius" + ] + } + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectUnionCompositePointer.json b/test/schemas/llm/type/ObjectUnionCompositePointer.json new file mode 100644 index 0000000000..d4cb9db5f9 --- /dev/null +++ b/test/schemas/llm/type/ObjectUnionCompositePointer.json @@ -0,0 +1,389 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "oneOf": [ + { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + { + "type": "object", + "properties": { + "p1": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p2": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + }, + "nullable": false, + "required": [ + "p1", + "p2" + ] + }, + { + "type": "object", + "properties": { + "p1": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p2": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + }, + "nullable": false, + "required": [ + "p1", + "p2", + "p3" + ] + }, + { + "type": "object", + "properties": { + "p1": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p2": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p4": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + }, + "nullable": false, + "required": [ + "p1", + "p2", + "p3", + "p4" + ] + }, + { + "type": "object", + "properties": { + "points": { + "type": "array", + "items": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + } + }, + "nullable": false, + "required": [ + "points" + ] + }, + { + "type": "object", + "properties": { + "outer": { + "type": "array", + "items": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + }, + "inner": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + }, + "nullable": false, + "required": [ + "outer", + "inner" + ] + }, + { + "type": "object", + "properties": { + "outer": { + "type": "object", + "properties": { + "points": { + "type": "array", + "items": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + } + }, + "nullable": false, + "required": [ + "points" + ] + }, + "inner": { + "type": "array", + "items": { + "type": "object", + "properties": { + "points": { + "type": "array", + "items": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + } + }, + "nullable": false, + "required": [ + "points" + ] + } + } + }, + "nullable": false, + "required": [ + "outer", + "inner" + ] + }, + { + "type": "object", + "properties": { + "centroid": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "radius": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "centroid", + "radius" + ] + } + ] + } + }, + "nullable": false, + "required": [ + "value" + ] + } + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectUnionDouble.json b/test/schemas/llm/type/ObjectUnionDouble.json new file mode 100644 index 0000000000..201c4298bb --- /dev/null +++ b/test/schemas/llm/type/ObjectUnionDouble.json @@ -0,0 +1,146 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "value": { + "type": "object", + "properties": { + "x": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x" + ] + }, + "child": { + "oneOf": [ + { + "type": "object", + "properties": { + "value": { + "type": "object", + "properties": { + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "y" + ] + } + }, + "nullable": false, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "value": { + "type": "object", + "properties": { + "y": { + "type": "boolean" + } + }, + "nullable": false, + "required": [ + "y" + ] + } + }, + "nullable": false, + "required": [ + "value" + ] + } + ] + } + }, + "nullable": false, + "required": [ + "value", + "child" + ] + }, + { + "type": "object", + "properties": { + "value": { + "type": "object", + "properties": { + "x": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "x" + ] + }, + "child": { + "oneOf": [ + { + "type": "object", + "properties": { + "value": { + "type": "object", + "properties": { + "y": { + "type": "array", + "items": { + "type": "number" + } + } + }, + "nullable": false, + "required": [ + "y" + ] + } + }, + "nullable": false, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "value": { + "type": "object", + "properties": { + "y": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "y" + ] + } + }, + "nullable": false, + "required": [ + "value" + ] + } + ] + } + }, + "nullable": false, + "required": [ + "value", + "child" + ] + } + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectUnionExplicit.json b/test/schemas/llm/type/ObjectUnionExplicit.json new file mode 100644 index 0000000000..3dedb1eacc --- /dev/null +++ b/test/schemas/llm/type/ObjectUnionExplicit.json @@ -0,0 +1,375 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "type": { + "type": "string", + "enum": [ + "point" + ] + } + }, + "nullable": false, + "required": [ + "x", + "y", + "type" + ] + }, + { + "type": "object", + "properties": { + "p1": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p2": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "type": { + "type": "string", + "enum": [ + "line" + ] + } + }, + "nullable": false, + "required": [ + "p1", + "p2", + "type" + ] + }, + { + "type": "object", + "properties": { + "p1": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p2": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "type": { + "type": "string", + "enum": [ + "triangle" + ] + } + }, + "nullable": false, + "required": [ + "p1", + "p2", + "p3", + "type" + ] + }, + { + "type": "object", + "properties": { + "p1": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p2": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p4": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "type": { + "type": "string", + "enum": [ + "rectangle" + ] + } + }, + "nullable": false, + "required": [ + "p1", + "p2", + "p3", + "p4", + "type" + ] + }, + { + "type": "object", + "properties": { + "points": { + "type": "array", + "items": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + }, + "type": { + "type": "string", + "enum": [ + "polyline" + ] + } + }, + "nullable": false, + "required": [ + "points", + "type" + ] + }, + { + "type": "object", + "properties": { + "outer": { + "type": "object", + "properties": { + "points": { + "type": "array", + "items": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + } + }, + "nullable": false, + "required": [ + "points" + ] + }, + "inner": { + "type": "array", + "items": { + "type": "object", + "properties": { + "points": { + "type": "array", + "items": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + } + }, + "nullable": false, + "required": [ + "points" + ] + } + }, + "type": { + "type": "string", + "enum": [ + "polygon" + ] + } + }, + "nullable": false, + "required": [ + "outer", + "inner", + "type" + ] + }, + { + "type": "object", + "properties": { + "centroid": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "radius": { + "type": "number" + }, + "type": { + "type": "string", + "enum": [ + "circle" + ] + } + }, + "nullable": false, + "required": [ + "centroid", + "radius", + "type" + ] + } + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectUnionExplicitPointer.json b/test/schemas/llm/type/ObjectUnionExplicitPointer.json new file mode 100644 index 0000000000..92c4b3859c --- /dev/null +++ b/test/schemas/llm/type/ObjectUnionExplicitPointer.json @@ -0,0 +1,393 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "oneOf": [ + { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "type": { + "type": "string", + "enum": [ + "point" + ] + } + }, + "nullable": false, + "required": [ + "x", + "y", + "type" + ] + }, + { + "type": "object", + "properties": { + "p1": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p2": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "type": { + "type": "string", + "enum": [ + "line" + ] + } + }, + "nullable": false, + "required": [ + "p1", + "p2", + "type" + ] + }, + { + "type": "object", + "properties": { + "p1": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p2": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "type": { + "type": "string", + "enum": [ + "triangle" + ] + } + }, + "nullable": false, + "required": [ + "p1", + "p2", + "p3", + "type" + ] + }, + { + "type": "object", + "properties": { + "p1": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p2": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p4": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "type": { + "type": "string", + "enum": [ + "rectangle" + ] + } + }, + "nullable": false, + "required": [ + "p1", + "p2", + "p3", + "p4", + "type" + ] + }, + { + "type": "object", + "properties": { + "points": { + "type": "array", + "items": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + }, + "type": { + "type": "string", + "enum": [ + "polyline" + ] + } + }, + "nullable": false, + "required": [ + "points", + "type" + ] + }, + { + "type": "object", + "properties": { + "outer": { + "type": "object", + "properties": { + "points": { + "type": "array", + "items": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + } + }, + "nullable": false, + "required": [ + "points" + ] + }, + "inner": { + "type": "array", + "items": { + "type": "object", + "properties": { + "points": { + "type": "array", + "items": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + } + }, + "nullable": false, + "required": [ + "points" + ] + } + }, + "type": { + "type": "string", + "enum": [ + "polygon" + ] + } + }, + "nullable": false, + "required": [ + "outer", + "inner", + "type" + ] + }, + { + "type": "object", + "properties": { + "centroid": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "radius": { + "type": "number" + }, + "type": { + "type": "string", + "enum": [ + "circle" + ] + } + }, + "nullable": false, + "required": [ + "centroid", + "radius", + "type" + ] + } + ] + } + }, + "nullable": false, + "required": [ + "value" + ] + } + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectUnionImplicit.json b/test/schemas/llm/type/ObjectUnionImplicit.json new file mode 100644 index 0000000000..cf14b4f54a --- /dev/null +++ b/test/schemas/llm/type/ObjectUnionImplicit.json @@ -0,0 +1,432 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "slope": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + { + "type": "object", + "properties": { + "p1": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "slope": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p2": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "slope": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "width": { + "type": "number", + "nullable": true + }, + "distance": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "p1", + "p2" + ] + }, + { + "type": "object", + "properties": { + "p1": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "slope": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p2": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "slope": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "slope": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "width": { + "type": "number", + "nullable": true + }, + "height": { + "type": "number", + "nullable": true + }, + "area": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "p1", + "p2", + "p3" + ] + }, + { + "type": "object", + "properties": { + "p1": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "slope": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p2": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "slope": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "slope": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "p4": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "slope": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "width": { + "type": "number", + "nullable": true + }, + "height": { + "type": "number", + "nullable": true + }, + "area": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "p1", + "p2", + "p3", + "p4" + ] + }, + { + "type": "object", + "properties": { + "points": { + "type": "array", + "items": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "slope": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + }, + "length": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "points" + ] + }, + { + "type": "object", + "properties": { + "outer": { + "type": "object", + "properties": { + "points": { + "type": "array", + "items": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "slope": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + }, + "length": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "points" + ] + }, + "inner": { + "type": "array", + "items": { + "type": "object", + "properties": { + "points": { + "type": "array", + "items": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "slope": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + } + }, + "length": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "points" + ] + } + }, + "area": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "outer" + ] + }, + { + "type": "object", + "properties": { + "radius": { + "type": "number" + }, + "centroid": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "slope": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "x", + "y" + ] + }, + "area": { + "type": "number", + "nullable": true + } + }, + "nullable": false, + "required": [ + "radius" + ] + } + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/ObjectUnionNonPredictable.json b/test/schemas/llm/type/ObjectUnionNonPredictable.json new file mode 100644 index 0000000000..65d5ecafa0 --- /dev/null +++ b/test/schemas/llm/type/ObjectUnionNonPredictable.json @@ -0,0 +1,97 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "type": "object", + "properties": { + "value": { + "oneOf": [ + { + "type": "object", + "properties": { + "value": { + "type": "object", + "properties": { + "value": { + "type": "boolean" + } + }, + "nullable": false, + "required": [ + "value" + ] + } + }, + "nullable": false, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "value": { + "type": "object", + "properties": { + "value": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "value" + ] + } + }, + "nullable": false, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "value": { + "type": "object", + "properties": { + "value": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "value" + ] + } + }, + "nullable": false, + "required": [ + "value" + ] + } + ] + } + }, + "nullable": false, + "required": [ + "value" + ] + } + }, + "nullable": false, + "required": [ + "value" + ] + } + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/TemplateAtomic.json b/test/schemas/llm/type/TemplateAtomic.json new file mode 100644 index 0000000000..bd8a984d88 --- /dev/null +++ b/test/schemas/llm/type/TemplateAtomic.json @@ -0,0 +1,51 @@ +{ + "type": "object", + "properties": { + "prefix": { + "type": "string", + "pattern": "^(prefix_(.*))" + }, + "postfix": { + "type": "string", + "pattern": "((.*)_postfix)$" + }, + "middle_string": { + "type": "string", + "pattern": "^(the_(.*)_value)$" + }, + "middle_string_empty": { + "type": "string", + "pattern": "^(the_(.*)_value)$" + }, + "middle_numeric": { + "type": "string", + "pattern": "^(the_[+-]?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?_value)$" + }, + "middle_boolean": { + "type": "string", + "enum": [ + "the_false_value", + "the_true_value" + ] + }, + "ipv4": { + "type": "string", + "pattern": "^([+-]?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\.[+-]?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\.[+-]?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\.[+-]?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)$" + }, + "email": { + "type": "string", + "pattern": "((.*)@(.*)\\.(.*))" + } + }, + "nullable": false, + "required": [ + "prefix", + "postfix", + "middle_string", + "middle_string_empty", + "middle_numeric", + "middle_boolean", + "ipv4", + "email" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/TemplateConstant.json b/test/schemas/llm/type/TemplateConstant.json new file mode 100644 index 0000000000..04ecd5f5b9 --- /dev/null +++ b/test/schemas/llm/type/TemplateConstant.json @@ -0,0 +1,53 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "object", + "properties": { + "prefix": { + "type": "string", + "enum": [ + "prefix_A", + "prefix_B", + "prefix_C" + ] + }, + "postfix": { + "type": "string", + "enum": [ + "1_postfix", + "2_postfix", + "3_postfix" + ] + }, + "combined": { + "type": "string", + "enum": [ + "the_1_value_with_label_A", + "the_1_value_with_label_B", + "the_1_value_with_label_C", + "the_2_value_with_label_A", + "the_2_value_with_label_B", + "the_2_value_with_label_C", + "the_3_value_with_label_A", + "the_3_value_with_label_B", + "the_3_value_with_label_C" + ] + } + }, + "nullable": false, + "required": [ + "prefix", + "postfix", + "combined" + ] + } + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/TemplateUnion.json b/test/schemas/llm/type/TemplateUnion.json new file mode 100644 index 0000000000..1e15748859 --- /dev/null +++ b/test/schemas/llm/type/TemplateUnion.json @@ -0,0 +1,80 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "object", + "properties": { + "prefix": { + "type": "string", + "pattern": "^((prefix_(.*))|(prefix_[+-]?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?))$" + }, + "postfix": { + "type": "string", + "pattern": "(((.*)_postfix)|([+-]?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?_postfix))$" + }, + "middle": { + "oneOf": [ + { + "type": "string", + "pattern": "^(the_[+-]?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?_value)$" + }, + { + "type": "string", + "enum": [ + "the_false_value", + "the_true_value" + ] + } + ] + }, + "mixed": { + "oneOf": [ + { + "type": "string", + "pattern": "^(the_[+-]?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?_value)$" + }, + { + "type": "string", + "enum": [ + "the_A_value", + "the_B_value" + ] + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "name" + ] + } + ] + } + }, + "nullable": false, + "required": [ + "prefix", + "postfix", + "middle", + "mixed" + ] + } + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ToJsonArray.json b/test/schemas/llm/type/ToJsonArray.json new file mode 100644 index 0000000000..37a1378c03 --- /dev/null +++ b/test/schemas/llm/type/ToJsonArray.json @@ -0,0 +1,42 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "id" + ] + } + } + ] + }, + "minItems": 4, + "maxItems": 4 +} \ No newline at end of file diff --git a/test/schemas/llm/type/ToJsonAtomicSimple.json b/test/schemas/llm/type/ToJsonAtomicSimple.json new file mode 100644 index 0000000000..a9dc150cdd --- /dev/null +++ b/test/schemas/llm/type/ToJsonAtomicSimple.json @@ -0,0 +1,18 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + } + ] + }, + "minItems": 3, + "maxItems": 3 +} \ No newline at end of file diff --git a/test/schemas/llm/type/ToJsonAtomicUnion.json b/test/schemas/llm/type/ToJsonAtomicUnion.json new file mode 100644 index 0000000000..2aaa26775b --- /dev/null +++ b/test/schemas/llm/type/ToJsonAtomicUnion.json @@ -0,0 +1,19 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "string", + "nullable": true + }, + { + "type": "number", + "nullable": true + }, + { + "type": "boolean", + "nullable": true + } + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/ToJsonDouble.json b/test/schemas/llm/type/ToJsonDouble.json new file mode 100644 index 0000000000..c96a5c12b6 --- /dev/null +++ b/test/schemas/llm/type/ToJsonDouble.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "flag": { + "type": "boolean" + } + }, + "nullable": false, + "required": [ + "id", + "flag" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/ToJsonNull.json b/test/schemas/llm/type/ToJsonNull.json new file mode 100644 index 0000000000..743b3af495 --- /dev/null +++ b/test/schemas/llm/type/ToJsonNull.json @@ -0,0 +1,3 @@ +{ + "type": "null" +} \ No newline at end of file diff --git a/test/schemas/llm/type/ToJsonTuple.json b/test/schemas/llm/type/ToJsonTuple.json new file mode 100644 index 0000000000..0018d1d01f --- /dev/null +++ b/test/schemas/llm/type/ToJsonTuple.json @@ -0,0 +1,34 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "code", + "name" + ] + } + ] + }, + "minItems": 4, + "maxItems": 4 +} \ No newline at end of file diff --git a/test/schemas/llm/type/ToJsonUnion.json b/test/schemas/llm/type/ToJsonUnion.json new file mode 100644 index 0000000000..94faf372a3 --- /dev/null +++ b/test/schemas/llm/type/ToJsonUnion.json @@ -0,0 +1,76 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "mobile": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "id", + "mobile", + "name" + ] + }, + { + "type": "object", + "properties": { + "manufacturer": { + "type": "string" + }, + "brand": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "manufacturer", + "brand", + "name" + ] + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "mobile": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "id", + "mobile", + "name" + ] + } + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/TupleHierarchical.json b/test/schemas/llm/type/TupleHierarchical.json new file mode 100644 index 0000000000..1c3b3258e8 --- /dev/null +++ b/test/schemas/llm/type/TupleHierarchical.json @@ -0,0 +1,120 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "boolean", + "nullable": true + }, + { + "type": "number", + "nullable": true + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "boolean", + "nullable": true + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string" + } + ] + }, + "minItems": 2, + "maxItems": 2 + } + ] + }, + "minItems": 2, + "maxItems": 2, + "nullable": true + } + ] + }, + "minItems": 3, + "maxItems": 3, + "nullable": true + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "array", + "items": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "type": "array", + "items": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string" + } + ] + }, + "minItems": 2, + "maxItems": 2 + } + ] + }, + "minItems": 3, + "maxItems": 3 + } + } + ] + }, + "minItems": 3, + "maxItems": 3 + } + } + ] + }, + "minItems": 2, + "maxItems": 2, + "nullable": true + } + ] + }, + "minItems": 5, + "maxItems": 5 +} \ No newline at end of file diff --git a/test/schemas/llm/type/TupleRestArray.json b/test/schemas/llm/type/TupleRestArray.json new file mode 100644 index 0000000000..98b9dcf82e --- /dev/null +++ b/test/schemas/llm/type/TupleRestArray.json @@ -0,0 +1,20 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "minItems": 2 +} \ No newline at end of file diff --git a/test/schemas/llm/type/TupleRestAtomic.json b/test/schemas/llm/type/TupleRestAtomic.json new file mode 100644 index 0000000000..e0857629a7 --- /dev/null +++ b/test/schemas/llm/type/TupleRestAtomic.json @@ -0,0 +1,17 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + } + ] + }, + "minItems": 2 +} \ No newline at end of file diff --git a/test/schemas/llm/type/TupleRestObject.json b/test/schemas/llm/type/TupleRestObject.json new file mode 100644 index 0000000000..8f43262fe7 --- /dev/null +++ b/test/schemas/llm/type/TupleRestObject.json @@ -0,0 +1,26 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "object", + "properties": { + "value": { + "type": "string" + } + }, + "nullable": false, + "required": [ + "value" + ] + } + ] + }, + "minItems": 2 +} \ No newline at end of file diff --git a/test/schemas/llm/type/TypeTagArray.json b/test/schemas/llm/type/TypeTagArray.json new file mode 100644 index 0000000000..5a29b02321 --- /dev/null +++ b/test/schemas/llm/type/TypeTagArray.json @@ -0,0 +1,68 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "minItems": 3, + "maxItems": 3 + }, + "minItems": { + "type": "array", + "items": { + "type": "number", + "minimum": 3 + }, + "minItems": 3 + }, + "both": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "minItems": 3, + "maxItems": 7 + }, + "equal": { + "type": "array", + "items": { + "type": "number", + "minimum": 10, + "maximum": 10 + }, + "minItems": 10, + "maxItems": 10 + }, + "unique": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + } + }, + "nullable": false, + "required": [ + "items", + "minItems", + "both", + "equal", + "unique" + ] + } + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/TypeTagArrayUnion.json b/test/schemas/llm/type/TypeTagArrayUnion.json new file mode 100644 index 0000000000..1d48a385b5 --- /dev/null +++ b/test/schemas/llm/type/TypeTagArrayUnion.json @@ -0,0 +1,57 @@ +{ + "type": "array", + "items": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "minItems": 3, + "maxItems": 3 + }, + "minItems": { + "type": "array", + "items": { + "type": "number", + "minimum": 3 + }, + "minItems": 3 + }, + "maxItems": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string", + "maxLength": 7 + }, + { + "type": "number", + "maximum": 7 + } + ] + }, + "maxItems": 7 + }, + "both": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "minItems": 3, + "maxItems": 7 + } + }, + "nullable": false, + "required": [ + "items", + "minItems", + "maxItems", + "both" + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/TypeTagAtomicUnion.json b/test/schemas/llm/type/TypeTagAtomicUnion.json new file mode 100644 index 0000000000..3cc9923e85 --- /dev/null +++ b/test/schemas/llm/type/TypeTagAtomicUnion.json @@ -0,0 +1,34 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "oneOf": [ + { + "type": "string", + "minLength": 3, + "maxLength": 7 + }, + { + "type": "number", + "minimum": 3 + } + ] + } + }, + "nullable": false, + "required": [ + "value" + ] + } + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/TypeTagCustom.json b/test/schemas/llm/type/TypeTagCustom.json new file mode 100644 index 0000000000..0664ad68ca --- /dev/null +++ b/test/schemas/llm/type/TypeTagCustom.json @@ -0,0 +1,28 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "dollar": { + "type": "string", + "x-typia-monetary": "dollar" + }, + "postfix": { + "type": "string", + "x-typia-postfix": "abcd" + }, + "powerOf": { + "type": "number", + "x-typia-powerOf": 2 + } + }, + "nullable": false, + "required": [ + "id", + "dollar", + "postfix", + "powerOf" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/TypeTagDefault.json b/test/schemas/llm/type/TypeTagDefault.json new file mode 100644 index 0000000000..692ede47df --- /dev/null +++ b/test/schemas/llm/type/TypeTagDefault.json @@ -0,0 +1,107 @@ +{ + "type": "object", + "properties": { + "boolean": { + "type": "boolean", + "default": false + }, + "number": { + "type": "number", + "default": 1 + }, + "string": { + "type": "string", + "default": "two" + }, + "text": { + "type": "string", + "default": "Very long text, can you understand it?" + }, + "boolean_and_number_and_string": { + "oneOf": [ + { + "type": "number", + "default": 1 + }, + { + "type": "string", + "default": "two" + }, + { + "type": "boolean", + "default": false + } + ] + }, + "union_but_boolean": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean", + "default": false + } + ] + }, + "union_but_number": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number", + "default": 1 + }, + { + "type": "boolean" + } + ] + }, + "union_but_string": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string", + "default": "two" + }, + { + "type": "boolean" + } + ] + }, + "boolean_and_number_and_template": { + "oneOf": [ + { + "type": "string", + "pattern": "^(prefix_(.*))" + }, + { + "type": "number", + "default": 2 + }, + { + "type": "boolean", + "default": false + } + ] + } + }, + "nullable": false, + "required": [ + "boolean", + "number", + "string", + "text", + "boolean_and_number_and_string", + "union_but_boolean", + "union_but_number", + "union_but_string", + "boolean_and_number_and_template" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/TypeTagFormat.json b/test/schemas/llm/type/TypeTagFormat.json new file mode 100644 index 0000000000..f306d185b7 --- /dev/null +++ b/test/schemas/llm/type/TypeTagFormat.json @@ -0,0 +1,118 @@ +{ + "type": "object", + "properties": { + "byte": { + "type": "string", + "format": "byte" + }, + "password": { + "type": "string", + "format": "password" + }, + "regex": { + "type": "string", + "format": "regex" + }, + "uuid": { + "type": "string", + "format": "uuid" + }, + "email": { + "type": "string", + "format": "email" + }, + "hostname": { + "type": "string", + "format": "hostname" + }, + "idnEmail": { + "type": "string", + "format": "idn-email" + }, + "idnHostname": { + "type": "string", + "format": "idn-hostname" + }, + "iri": { + "type": "string", + "format": "iri" + }, + "iriReference": { + "type": "string", + "format": "iri-reference" + }, + "ipv4": { + "type": "string", + "format": "ipv4" + }, + "ipv6": { + "type": "string", + "format": "ipv6" + }, + "uri": { + "type": "string", + "format": "uri" + }, + "uriReference": { + "type": "string", + "format": "uri-reference" + }, + "uriTemplate": { + "type": "string", + "format": "uri-template" + }, + "url": { + "type": "string", + "format": "url" + }, + "datetime": { + "type": "string", + "format": "date-time" + }, + "date": { + "type": "string", + "format": "date" + }, + "time": { + "type": "string", + "format": "time" + }, + "duration": { + "type": "string", + "format": "duration" + }, + "jsonPointer": { + "type": "string", + "format": "json-pointer" + }, + "relativeJsonPointer": { + "type": "string", + "format": "relative-json-pointer" + } + }, + "nullable": false, + "required": [ + "byte", + "password", + "regex", + "uuid", + "email", + "hostname", + "idnEmail", + "idnHostname", + "iri", + "iriReference", + "ipv4", + "ipv6", + "uri", + "uriReference", + "uriTemplate", + "url", + "datetime", + "date", + "time", + "duration", + "jsonPointer", + "relativeJsonPointer" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/TypeTagLength.json b/test/schemas/llm/type/TypeTagLength.json new file mode 100644 index 0000000000..b6456ad2ee --- /dev/null +++ b/test/schemas/llm/type/TypeTagLength.json @@ -0,0 +1,48 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "object", + "properties": { + "fixed": { + "type": "string", + "minLength": 5, + "maxLength": 5 + }, + "minimum": { + "type": "string", + "minLength": 3 + }, + "maximum": { + "type": "string", + "maxLength": 7 + }, + "minimum_and_maximum": { + "type": "string", + "minLength": 3, + "maxLength": 7 + }, + "equal": { + "type": "string", + "minLength": 10, + "maxLength": 19 + } + }, + "nullable": false, + "required": [ + "fixed", + "minimum", + "maximum", + "minimum_and_maximum", + "equal" + ] + } + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/TypeTagMatrix.json b/test/schemas/llm/type/TypeTagMatrix.json new file mode 100644 index 0000000000..be382592e4 --- /dev/null +++ b/test/schemas/llm/type/TypeTagMatrix.json @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "matrix": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "minItems": 4, + "maxItems": 4 + }, + "minItems": 3, + "maxItems": 3 + } + }, + "nullable": false, + "required": [ + "matrix" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/TypeTagObjectUnion.json b/test/schemas/llm/type/TypeTagObjectUnion.json new file mode 100644 index 0000000000..02727a6a63 --- /dev/null +++ b/test/schemas/llm/type/TypeTagObjectUnion.json @@ -0,0 +1,34 @@ +{ + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "value": { + "type": "number", + "minimum": 3 + } + }, + "nullable": false, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "value": { + "type": "string", + "minLength": 3, + "maxLength": 7 + } + }, + "nullable": false, + "required": [ + "value" + ] + } + ] + } +} \ No newline at end of file diff --git a/test/schemas/llm/type/TypeTagPattern.json b/test/schemas/llm/type/TypeTagPattern.json new file mode 100644 index 0000000000..9411000ad9 --- /dev/null +++ b/test/schemas/llm/type/TypeTagPattern.json @@ -0,0 +1,28 @@ +{ + "type": "object", + "properties": { + "uuid": { + "type": "string", + "pattern": "^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$" + }, + "email": { + "type": "string", + "pattern": "^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$" + }, + "ipv4": { + "type": "string", + "pattern": "^(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" + }, + "ipv6": { + "type": "string", + "pattern": "^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$" + } + }, + "nullable": false, + "required": [ + "uuid", + "email", + "ipv4", + "ipv6" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/TypeTagRange.json b/test/schemas/llm/type/TypeTagRange.json new file mode 100644 index 0000000000..d026ba955e --- /dev/null +++ b/test/schemas/llm/type/TypeTagRange.json @@ -0,0 +1,76 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "object", + "properties": { + "greater": { + "type": "integer", + "exclusiveMinimum": true, + "minimum": 3 + }, + "greater_equal": { + "type": "integer", + "minimum": 3 + }, + "less": { + "type": "integer", + "exclusiveMaximum": true, + "maximum": 7 + }, + "less_equal": { + "type": "integer", + "maximum": 7 + }, + "greater_less": { + "type": "integer", + "exclusiveMinimum": true, + "minimum": 3, + "exclusiveMaximum": true, + "maximum": 7 + }, + "greater_equal_less": { + "type": "integer", + "minimum": 3, + "exclusiveMaximum": true, + "maximum": 7 + }, + "greater_less_equal": { + "type": "integer", + "exclusiveMinimum": true, + "minimum": 3, + "maximum": 7 + }, + "greater_equal_less_equal": { + "type": "integer", + "minimum": 3, + "maximum": 7 + }, + "equal": { + "type": "integer", + "minimum": 10, + "maximum": 10 + } + }, + "nullable": false, + "required": [ + "greater", + "greater_equal", + "less", + "less_equal", + "greater_less", + "greater_equal_less", + "greater_less_equal", + "greater_equal_less_equal", + "equal" + ] + } + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/TypeTagTuple.json b/test/schemas/llm/type/TypeTagTuple.json new file mode 100644 index 0000000000..a96c4a967f --- /dev/null +++ b/test/schemas/llm/type/TypeTagTuple.json @@ -0,0 +1,48 @@ +{ + "type": "object", + "properties": { + "tuple": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string", + "minLength": 3, + "maxLength": 7 + }, + { + "type": "number", + "minimum": 3, + "maximum": 7 + }, + { + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 2 + }, + "minItems": 3, + "maxItems": 7 + }, + { + "type": "array", + "items": { + "type": "number", + "minimum": 1, + "maximum": 2 + }, + "minItems": 3, + "maxItems": 7 + } + ] + }, + "minItems": 4, + "maxItems": 4 + } + }, + "nullable": false, + "required": [ + "tuple" + ] +} \ No newline at end of file diff --git a/test/schemas/llm/type/TypeTagType.json b/test/schemas/llm/type/TypeTagType.json new file mode 100644 index 0000000000..3c7b4fdd2a --- /dev/null +++ b/test/schemas/llm/type/TypeTagType.json @@ -0,0 +1,48 @@ +{ + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "object", + "properties": { + "int": { + "type": "integer" + }, + "uint": { + "type": "integer" + }, + "int32": { + "type": "integer" + }, + "uint32": { + "type": "integer" + }, + "int64": { + "type": "integer" + }, + "uint64": { + "type": "integer" + }, + "float": { + "type": "number" + } + }, + "nullable": false, + "required": [ + "int", + "uint", + "int32", + "uint32", + "int64", + "uint64", + "float" + ] + } + } + }, + "nullable": false, + "required": [ + "value" + ] +} \ No newline at end of file diff --git a/test/src/features/llm.schema/test_llm_schema_ArrayAny.ts b/test/src/features/llm.schema/test_llm_schema_ArrayAny.ts new file mode 100644 index 0000000000..a904bd1152 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ArrayAny.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ArrayAny } from "../../structures/ArrayAny"; + +export const test_llm_schema_ArrayAny = _test_llm_schema("ArrayAny")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_ArrayAtomicAlias.ts b/test/src/features/llm.schema/test_llm_schema_ArrayAtomicAlias.ts new file mode 100644 index 0000000000..dcd41f135f --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ArrayAtomicAlias.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ArrayAtomicAlias } from "../../structures/ArrayAtomicAlias"; + +export const test_llm_schema_ArrayAtomicAlias = _test_llm_schema( + "ArrayAtomicAlias", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ArrayAtomicSimple.ts b/test/src/features/llm.schema/test_llm_schema_ArrayAtomicSimple.ts new file mode 100644 index 0000000000..bac8cdf2ca --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ArrayAtomicSimple.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ArrayAtomicSimple } from "../../structures/ArrayAtomicSimple"; + +export const test_llm_schema_ArrayAtomicSimple = _test_llm_schema( + "ArrayAtomicSimple", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ArrayHierarchical.ts b/test/src/features/llm.schema/test_llm_schema_ArrayHierarchical.ts new file mode 100644 index 0000000000..269606153f --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ArrayHierarchical.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ArrayHierarchical } from "../../structures/ArrayHierarchical"; + +export const test_llm_schema_ArrayHierarchical = _test_llm_schema( + "ArrayHierarchical", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ArrayHierarchicalPointer.ts b/test/src/features/llm.schema/test_llm_schema_ArrayHierarchicalPointer.ts new file mode 100644 index 0000000000..bc7cbd62ec --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ArrayHierarchicalPointer.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ArrayHierarchicalPointer } from "../../structures/ArrayHierarchicalPointer"; + +export const test_llm_schema_ArrayHierarchicalPointer = _test_llm_schema( + "ArrayHierarchicalPointer", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ArrayMatrix.ts b/test/src/features/llm.schema/test_llm_schema_ArrayMatrix.ts new file mode 100644 index 0000000000..463998f627 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ArrayMatrix.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ArrayMatrix } from "../../structures/ArrayMatrix"; + +export const test_llm_schema_ArrayMatrix = _test_llm_schema("ArrayMatrix")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_ArraySimple.ts b/test/src/features/llm.schema/test_llm_schema_ArraySimple.ts new file mode 100644 index 0000000000..03f5da4d36 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ArraySimple.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ArraySimple } from "../../structures/ArraySimple"; + +export const test_llm_schema_ArraySimple = _test_llm_schema("ArraySimple")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_ArrayUnion.ts b/test/src/features/llm.schema/test_llm_schema_ArrayUnion.ts new file mode 100644 index 0000000000..ff4482e315 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ArrayUnion.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ArrayUnion } from "../../structures/ArrayUnion"; + +export const test_llm_schema_ArrayUnion = _test_llm_schema("ArrayUnion")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_AtomicAlias.ts b/test/src/features/llm.schema/test_llm_schema_AtomicAlias.ts new file mode 100644 index 0000000000..611950de34 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_AtomicAlias.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { AtomicAlias } from "../../structures/AtomicAlias"; + +export const test_llm_schema_AtomicAlias = _test_llm_schema("AtomicAlias")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_AtomicClass.ts b/test/src/features/llm.schema/test_llm_schema_AtomicClass.ts new file mode 100644 index 0000000000..9dc662d8ed --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_AtomicClass.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { AtomicClass } from "../../structures/AtomicClass"; + +export const test_llm_schema_AtomicClass = _test_llm_schema("AtomicClass")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_AtomicIntersection.ts b/test/src/features/llm.schema/test_llm_schema_AtomicIntersection.ts new file mode 100644 index 0000000000..47e6577483 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_AtomicIntersection.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { AtomicIntersection } from "../../structures/AtomicIntersection"; + +export const test_llm_schema_AtomicIntersection = _test_llm_schema( + "AtomicIntersection", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_AtomicSimple.ts b/test/src/features/llm.schema/test_llm_schema_AtomicSimple.ts new file mode 100644 index 0000000000..2053c72f45 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_AtomicSimple.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { AtomicSimple } from "../../structures/AtomicSimple"; + +export const test_llm_schema_AtomicSimple = _test_llm_schema("AtomicSimple")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_AtomicUnion.ts b/test/src/features/llm.schema/test_llm_schema_AtomicUnion.ts new file mode 100644 index 0000000000..26e29cfbdb --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_AtomicUnion.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { AtomicUnion } from "../../structures/AtomicUnion"; + +export const test_llm_schema_AtomicUnion = _test_llm_schema("AtomicUnion")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_ClassGetter.ts b/test/src/features/llm.schema/test_llm_schema_ClassGetter.ts new file mode 100644 index 0000000000..b0b2446be3 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ClassGetter.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ClassGetter } from "../../structures/ClassGetter"; + +export const test_llm_schema_ClassGetter = _test_llm_schema("ClassGetter")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_ClassMethod.ts b/test/src/features/llm.schema/test_llm_schema_ClassMethod.ts new file mode 100644 index 0000000000..db82f44c38 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ClassMethod.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ClassMethod } from "../../structures/ClassMethod"; + +export const test_llm_schema_ClassMethod = _test_llm_schema("ClassMethod")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_ClassPropertyAssignment.ts b/test/src/features/llm.schema/test_llm_schema_ClassPropertyAssignment.ts new file mode 100644 index 0000000000..bc15f18035 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ClassPropertyAssignment.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ClassPropertyAssignment } from "../../structures/ClassPropertyAssignment"; + +export const test_llm_schema_ClassPropertyAssignment = _test_llm_schema( + "ClassPropertyAssignment", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_CommentTagArray.ts b/test/src/features/llm.schema/test_llm_schema_CommentTagArray.ts new file mode 100644 index 0000000000..0ae698de24 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_CommentTagArray.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { CommentTagArray } from "../../structures/CommentTagArray"; + +export const test_llm_schema_CommentTagArray = _test_llm_schema( + "CommentTagArray", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_CommentTagArrayUnion.ts b/test/src/features/llm.schema/test_llm_schema_CommentTagArrayUnion.ts new file mode 100644 index 0000000000..146f898ed9 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_CommentTagArrayUnion.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { CommentTagArrayUnion } from "../../structures/CommentTagArrayUnion"; + +export const test_llm_schema_CommentTagArrayUnion = _test_llm_schema( + "CommentTagArrayUnion", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_CommentTagAtomicUnion.ts b/test/src/features/llm.schema/test_llm_schema_CommentTagAtomicUnion.ts new file mode 100644 index 0000000000..2a3cd565d3 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_CommentTagAtomicUnion.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { CommentTagAtomicUnion } from "../../structures/CommentTagAtomicUnion"; + +export const test_llm_schema_CommentTagAtomicUnion = _test_llm_schema( + "CommentTagAtomicUnion", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_CommentTagDefault.ts b/test/src/features/llm.schema/test_llm_schema_CommentTagDefault.ts new file mode 100644 index 0000000000..dd7541881f --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_CommentTagDefault.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { CommentTagDefault } from "../../structures/CommentTagDefault"; + +export const test_llm_schema_CommentTagDefault = _test_llm_schema( + "CommentTagDefault", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_CommentTagFormat.ts b/test/src/features/llm.schema/test_llm_schema_CommentTagFormat.ts new file mode 100644 index 0000000000..655159b1ca --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_CommentTagFormat.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { CommentTagFormat } from "../../structures/CommentTagFormat"; + +export const test_llm_schema_CommentTagFormat = _test_llm_schema( + "CommentTagFormat", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_CommentTagLength.ts b/test/src/features/llm.schema/test_llm_schema_CommentTagLength.ts new file mode 100644 index 0000000000..02a7048d60 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_CommentTagLength.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { CommentTagLength } from "../../structures/CommentTagLength"; + +export const test_llm_schema_CommentTagLength = _test_llm_schema( + "CommentTagLength", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_CommentTagObjectUnion.ts b/test/src/features/llm.schema/test_llm_schema_CommentTagObjectUnion.ts new file mode 100644 index 0000000000..9f22cdce50 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_CommentTagObjectUnion.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { CommentTagObjectUnion } from "../../structures/CommentTagObjectUnion"; + +export const test_llm_schema_CommentTagObjectUnion = _test_llm_schema( + "CommentTagObjectUnion", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_CommentTagPattern.ts b/test/src/features/llm.schema/test_llm_schema_CommentTagPattern.ts new file mode 100644 index 0000000000..8b4c2da902 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_CommentTagPattern.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { CommentTagPattern } from "../../structures/CommentTagPattern"; + +export const test_llm_schema_CommentTagPattern = _test_llm_schema( + "CommentTagPattern", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_CommentTagRange.ts b/test/src/features/llm.schema/test_llm_schema_CommentTagRange.ts new file mode 100644 index 0000000000..392703d652 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_CommentTagRange.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { CommentTagRange } from "../../structures/CommentTagRange"; + +export const test_llm_schema_CommentTagRange = _test_llm_schema( + "CommentTagRange", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_CommentTagType.ts b/test/src/features/llm.schema/test_llm_schema_CommentTagType.ts new file mode 100644 index 0000000000..0259aa953c --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_CommentTagType.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { CommentTagType } from "../../structures/CommentTagType"; + +export const test_llm_schema_CommentTagType = _test_llm_schema( + "CommentTagType", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ConstantAtomicAbsorbed.ts b/test/src/features/llm.schema/test_llm_schema_ConstantAtomicAbsorbed.ts new file mode 100644 index 0000000000..12679944d2 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ConstantAtomicAbsorbed.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ConstantAtomicAbsorbed } from "../../structures/ConstantAtomicAbsorbed"; + +export const test_llm_schema_ConstantAtomicAbsorbed = _test_llm_schema( + "ConstantAtomicAbsorbed", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ConstantAtomicSimple.ts b/test/src/features/llm.schema/test_llm_schema_ConstantAtomicSimple.ts new file mode 100644 index 0000000000..0f6a3eeeb3 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ConstantAtomicSimple.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ConstantAtomicSimple } from "../../structures/ConstantAtomicSimple"; + +export const test_llm_schema_ConstantAtomicSimple = _test_llm_schema( + "ConstantAtomicSimple", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ConstantAtomicTagged.ts b/test/src/features/llm.schema/test_llm_schema_ConstantAtomicTagged.ts new file mode 100644 index 0000000000..3d4ba71e6c --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ConstantAtomicTagged.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ConstantAtomicTagged } from "../../structures/ConstantAtomicTagged"; + +export const test_llm_schema_ConstantAtomicTagged = _test_llm_schema( + "ConstantAtomicTagged", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ConstantAtomicUnion.ts b/test/src/features/llm.schema/test_llm_schema_ConstantAtomicUnion.ts new file mode 100644 index 0000000000..64130e4ad0 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ConstantAtomicUnion.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ConstantAtomicUnion } from "../../structures/ConstantAtomicUnion"; + +export const test_llm_schema_ConstantAtomicUnion = _test_llm_schema( + "ConstantAtomicUnion", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ConstantAtomicWrapper.ts b/test/src/features/llm.schema/test_llm_schema_ConstantAtomicWrapper.ts new file mode 100644 index 0000000000..4b984fb9ea --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ConstantAtomicWrapper.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ConstantAtomicWrapper } from "../../structures/ConstantAtomicWrapper"; + +export const test_llm_schema_ConstantAtomicWrapper = _test_llm_schema( + "ConstantAtomicWrapper", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ConstantConstEnumeration.ts b/test/src/features/llm.schema/test_llm_schema_ConstantConstEnumeration.ts new file mode 100644 index 0000000000..4afd55f92d --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ConstantConstEnumeration.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ConstantConstEnumeration } from "../../structures/ConstantConstEnumeration"; + +export const test_llm_schema_ConstantConstEnumeration = _test_llm_schema( + "ConstantConstEnumeration", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ConstantEnumeration.ts b/test/src/features/llm.schema/test_llm_schema_ConstantEnumeration.ts new file mode 100644 index 0000000000..8b5de65645 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ConstantEnumeration.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ConstantEnumeration } from "../../structures/ConstantEnumeration"; + +export const test_llm_schema_ConstantEnumeration = _test_llm_schema( + "ConstantEnumeration", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ConstantIntersection.ts b/test/src/features/llm.schema/test_llm_schema_ConstantIntersection.ts new file mode 100644 index 0000000000..a03a82d0ee --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ConstantIntersection.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ConstantIntersection } from "../../structures/ConstantIntersection"; + +export const test_llm_schema_ConstantIntersection = _test_llm_schema( + "ConstantIntersection", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_DynamicArray.ts b/test/src/features/llm.schema/test_llm_schema_DynamicArray.ts new file mode 100644 index 0000000000..e94a4d67ad --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_DynamicArray.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { DynamicArray } from "../../structures/DynamicArray"; + +export const test_llm_schema_DynamicArray = _test_llm_schema("DynamicArray")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_DynamicComposite.ts b/test/src/features/llm.schema/test_llm_schema_DynamicComposite.ts new file mode 100644 index 0000000000..1e233acd94 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_DynamicComposite.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { DynamicComposite } from "../../structures/DynamicComposite"; + +export const test_llm_schema_DynamicComposite = _test_llm_schema( + "DynamicComposite", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_DynamicConstant.ts b/test/src/features/llm.schema/test_llm_schema_DynamicConstant.ts new file mode 100644 index 0000000000..0ed4341574 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_DynamicConstant.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { DynamicConstant } from "../../structures/DynamicConstant"; + +export const test_llm_schema_DynamicConstant = _test_llm_schema( + "DynamicConstant", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_DynamicEnumeration.ts b/test/src/features/llm.schema/test_llm_schema_DynamicEnumeration.ts new file mode 100644 index 0000000000..ae0746504b --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_DynamicEnumeration.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { DynamicEnumeration } from "../../structures/DynamicEnumeration"; + +export const test_llm_schema_DynamicEnumeration = _test_llm_schema( + "DynamicEnumeration", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_DynamicNever.ts b/test/src/features/llm.schema/test_llm_schema_DynamicNever.ts new file mode 100644 index 0000000000..a8aeea93fb --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_DynamicNever.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { DynamicNever } from "../../structures/DynamicNever"; + +export const test_llm_schema_DynamicNever = _test_llm_schema("DynamicNever")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_DynamicSimple.ts b/test/src/features/llm.schema/test_llm_schema_DynamicSimple.ts new file mode 100644 index 0000000000..61e2e29e90 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_DynamicSimple.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { DynamicSimple } from "../../structures/DynamicSimple"; + +export const test_llm_schema_DynamicSimple = _test_llm_schema("DynamicSimple")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_DynamicTemplate.ts b/test/src/features/llm.schema/test_llm_schema_DynamicTemplate.ts new file mode 100644 index 0000000000..4fe621d1ca --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_DynamicTemplate.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { DynamicTemplate } from "../../structures/DynamicTemplate"; + +export const test_llm_schema_DynamicTemplate = _test_llm_schema( + "DynamicTemplate", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_DynamicUndefined.ts b/test/src/features/llm.schema/test_llm_schema_DynamicUndefined.ts new file mode 100644 index 0000000000..e959c5e401 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_DynamicUndefined.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { DynamicUndefined } from "../../structures/DynamicUndefined"; + +export const test_llm_schema_DynamicUndefined = _test_llm_schema( + "DynamicUndefined", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_DynamicUnion.ts b/test/src/features/llm.schema/test_llm_schema_DynamicUnion.ts new file mode 100644 index 0000000000..19c71f9c35 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_DynamicUnion.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { DynamicUnion } from "../../structures/DynamicUnion"; + +export const test_llm_schema_DynamicUnion = _test_llm_schema("DynamicUnion")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectAlias.ts b/test/src/features/llm.schema/test_llm_schema_ObjectAlias.ts new file mode 100644 index 0000000000..205c82de72 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectAlias.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectAlias } from "../../structures/ObjectAlias"; + +export const test_llm_schema_ObjectAlias = _test_llm_schema("ObjectAlias")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectDate.ts b/test/src/features/llm.schema/test_llm_schema_ObjectDate.ts new file mode 100644 index 0000000000..75dbe54dc6 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectDate.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectDate } from "../../structures/ObjectDate"; + +export const test_llm_schema_ObjectDate = _test_llm_schema("ObjectDate")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectDescription.ts b/test/src/features/llm.schema/test_llm_schema_ObjectDescription.ts new file mode 100644 index 0000000000..c898d096b5 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectDescription.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectDescription } from "../../structures/ObjectDescription"; + +export const test_llm_schema_ObjectDescription = _test_llm_schema( + "ObjectDescription", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectDynamic.ts b/test/src/features/llm.schema/test_llm_schema_ObjectDynamic.ts new file mode 100644 index 0000000000..9340768a4a --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectDynamic.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectDynamic } from "../../structures/ObjectDynamic"; + +export const test_llm_schema_ObjectDynamic = _test_llm_schema("ObjectDynamic")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectGeneric.ts b/test/src/features/llm.schema/test_llm_schema_ObjectGeneric.ts new file mode 100644 index 0000000000..3fc191c257 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectGeneric.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectGeneric } from "../../structures/ObjectGeneric"; + +export const test_llm_schema_ObjectGeneric = _test_llm_schema("ObjectGeneric")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectGenericAlias.ts b/test/src/features/llm.schema/test_llm_schema_ObjectGenericAlias.ts new file mode 100644 index 0000000000..276389d697 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectGenericAlias.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectGenericAlias } from "../../structures/ObjectGenericAlias"; + +export const test_llm_schema_ObjectGenericAlias = _test_llm_schema( + "ObjectGenericAlias", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectGenericArray.ts b/test/src/features/llm.schema/test_llm_schema_ObjectGenericArray.ts new file mode 100644 index 0000000000..d993a03da3 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectGenericArray.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectGenericArray } from "../../structures/ObjectGenericArray"; + +export const test_llm_schema_ObjectGenericArray = _test_llm_schema( + "ObjectGenericArray", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectGenericUnion.ts b/test/src/features/llm.schema/test_llm_schema_ObjectGenericUnion.ts new file mode 100644 index 0000000000..dfdd28861f --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectGenericUnion.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectGenericUnion } from "../../structures/ObjectGenericUnion"; + +export const test_llm_schema_ObjectGenericUnion = _test_llm_schema( + "ObjectGenericUnion", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectHierarchical.ts b/test/src/features/llm.schema/test_llm_schema_ObjectHierarchical.ts new file mode 100644 index 0000000000..12bea708c0 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectHierarchical.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectHierarchical } from "../../structures/ObjectHierarchical"; + +export const test_llm_schema_ObjectHierarchical = _test_llm_schema( + "ObjectHierarchical", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectInternal.ts b/test/src/features/llm.schema/test_llm_schema_ObjectInternal.ts new file mode 100644 index 0000000000..636b92cdcd --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectInternal.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectInternal } from "../../structures/ObjectInternal"; + +export const test_llm_schema_ObjectInternal = _test_llm_schema( + "ObjectInternal", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectIntersection.ts b/test/src/features/llm.schema/test_llm_schema_ObjectIntersection.ts new file mode 100644 index 0000000000..fc132e8172 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectIntersection.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectIntersection } from "../../structures/ObjectIntersection"; + +export const test_llm_schema_ObjectIntersection = _test_llm_schema( + "ObjectIntersection", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectJsonTag.ts b/test/src/features/llm.schema/test_llm_schema_ObjectJsonTag.ts new file mode 100644 index 0000000000..8d79e2ae22 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectJsonTag.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectJsonTag } from "../../structures/ObjectJsonTag"; + +export const test_llm_schema_ObjectJsonTag = _test_llm_schema("ObjectJsonTag")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectLiteralProperty.ts b/test/src/features/llm.schema/test_llm_schema_ObjectLiteralProperty.ts new file mode 100644 index 0000000000..db74429636 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectLiteralProperty.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectLiteralProperty } from "../../structures/ObjectLiteralProperty"; + +export const test_llm_schema_ObjectLiteralProperty = _test_llm_schema( + "ObjectLiteralProperty", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectLiteralType.ts b/test/src/features/llm.schema/test_llm_schema_ObjectLiteralType.ts new file mode 100644 index 0000000000..7a98bf9887 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectLiteralType.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectLiteralType } from "../../structures/ObjectLiteralType"; + +export const test_llm_schema_ObjectLiteralType = _test_llm_schema( + "ObjectLiteralType", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectNullable.ts b/test/src/features/llm.schema/test_llm_schema_ObjectNullable.ts new file mode 100644 index 0000000000..39af55c3fc --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectNullable.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectNullable } from "../../structures/ObjectNullable"; + +export const test_llm_schema_ObjectNullable = _test_llm_schema( + "ObjectNullable", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectOptional.ts b/test/src/features/llm.schema/test_llm_schema_ObjectOptional.ts new file mode 100644 index 0000000000..f897bc4c8d --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectOptional.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectOptional } from "../../structures/ObjectOptional"; + +export const test_llm_schema_ObjectOptional = _test_llm_schema( + "ObjectOptional", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectPrimitive.ts b/test/src/features/llm.schema/test_llm_schema_ObjectPrimitive.ts new file mode 100644 index 0000000000..3f7e4489d6 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectPrimitive.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectPrimitive } from "../../structures/ObjectPrimitive"; + +export const test_llm_schema_ObjectPrimitive = _test_llm_schema( + "ObjectPrimitive", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectPropertyNullable.ts b/test/src/features/llm.schema/test_llm_schema_ObjectPropertyNullable.ts new file mode 100644 index 0000000000..38953c03c0 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectPropertyNullable.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectPropertyNullable } from "../../structures/ObjectPropertyNullable"; + +export const test_llm_schema_ObjectPropertyNullable = _test_llm_schema( + "ObjectPropertyNullable", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectSimple.ts b/test/src/features/llm.schema/test_llm_schema_ObjectSimple.ts new file mode 100644 index 0000000000..13449e9ba7 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectSimple.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectSimple } from "../../structures/ObjectSimple"; + +export const test_llm_schema_ObjectSimple = _test_llm_schema("ObjectSimple")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectTuple.ts b/test/src/features/llm.schema/test_llm_schema_ObjectTuple.ts new file mode 100644 index 0000000000..f0a3685e35 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectTuple.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectTuple } from "../../structures/ObjectTuple"; + +export const test_llm_schema_ObjectTuple = _test_llm_schema("ObjectTuple")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectUndefined.ts b/test/src/features/llm.schema/test_llm_schema_ObjectUndefined.ts new file mode 100644 index 0000000000..6aa8908a4f --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectUndefined.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectUndefined } from "../../structures/ObjectUndefined"; + +export const test_llm_schema_ObjectUndefined = _test_llm_schema( + "ObjectUndefined", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectUnionComposite.ts b/test/src/features/llm.schema/test_llm_schema_ObjectUnionComposite.ts new file mode 100644 index 0000000000..07ec62c6ce --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectUnionComposite.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectUnionComposite } from "../../structures/ObjectUnionComposite"; + +export const test_llm_schema_ObjectUnionComposite = _test_llm_schema( + "ObjectUnionComposite", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectUnionCompositePointer.ts b/test/src/features/llm.schema/test_llm_schema_ObjectUnionCompositePointer.ts new file mode 100644 index 0000000000..b8805dc304 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectUnionCompositePointer.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectUnionCompositePointer } from "../../structures/ObjectUnionCompositePointer"; + +export const test_llm_schema_ObjectUnionCompositePointer = _test_llm_schema( + "ObjectUnionCompositePointer", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectUnionDouble.ts b/test/src/features/llm.schema/test_llm_schema_ObjectUnionDouble.ts new file mode 100644 index 0000000000..8f0c340a46 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectUnionDouble.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectUnionDouble } from "../../structures/ObjectUnionDouble"; + +export const test_llm_schema_ObjectUnionDouble = _test_llm_schema( + "ObjectUnionDouble", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectUnionExplicit.ts b/test/src/features/llm.schema/test_llm_schema_ObjectUnionExplicit.ts new file mode 100644 index 0000000000..fc65826006 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectUnionExplicit.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectUnionExplicit } from "../../structures/ObjectUnionExplicit"; + +export const test_llm_schema_ObjectUnionExplicit = _test_llm_schema( + "ObjectUnionExplicit", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectUnionExplicitPointer.ts b/test/src/features/llm.schema/test_llm_schema_ObjectUnionExplicitPointer.ts new file mode 100644 index 0000000000..debdac1ab2 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectUnionExplicitPointer.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectUnionExplicitPointer } from "../../structures/ObjectUnionExplicitPointer"; + +export const test_llm_schema_ObjectUnionExplicitPointer = _test_llm_schema( + "ObjectUnionExplicitPointer", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectUnionImplicit.ts b/test/src/features/llm.schema/test_llm_schema_ObjectUnionImplicit.ts new file mode 100644 index 0000000000..ec7afa0e21 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectUnionImplicit.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectUnionImplicit } from "../../structures/ObjectUnionImplicit"; + +export const test_llm_schema_ObjectUnionImplicit = _test_llm_schema( + "ObjectUnionImplicit", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ObjectUnionNonPredictable.ts b/test/src/features/llm.schema/test_llm_schema_ObjectUnionNonPredictable.ts new file mode 100644 index 0000000000..b42b5fff51 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ObjectUnionNonPredictable.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ObjectUnionNonPredictable } from "../../structures/ObjectUnionNonPredictable"; + +export const test_llm_schema_ObjectUnionNonPredictable = _test_llm_schema( + "ObjectUnionNonPredictable", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_TemplateAtomic.ts b/test/src/features/llm.schema/test_llm_schema_TemplateAtomic.ts new file mode 100644 index 0000000000..bb1015d44f --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_TemplateAtomic.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { TemplateAtomic } from "../../structures/TemplateAtomic"; + +export const test_llm_schema_TemplateAtomic = _test_llm_schema( + "TemplateAtomic", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_TemplateConstant.ts b/test/src/features/llm.schema/test_llm_schema_TemplateConstant.ts new file mode 100644 index 0000000000..5e44a3bb24 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_TemplateConstant.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { TemplateConstant } from "../../structures/TemplateConstant"; + +export const test_llm_schema_TemplateConstant = _test_llm_schema( + "TemplateConstant", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_TemplateUnion.ts b/test/src/features/llm.schema/test_llm_schema_TemplateUnion.ts new file mode 100644 index 0000000000..2e21b1fbf6 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_TemplateUnion.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { TemplateUnion } from "../../structures/TemplateUnion"; + +export const test_llm_schema_TemplateUnion = _test_llm_schema("TemplateUnion")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_ToJsonArray.ts b/test/src/features/llm.schema/test_llm_schema_ToJsonArray.ts new file mode 100644 index 0000000000..d4b44bd12e --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ToJsonArray.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ToJsonArray } from "../../structures/ToJsonArray"; + +export const test_llm_schema_ToJsonArray = _test_llm_schema("ToJsonArray")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_ToJsonAtomicSimple.ts b/test/src/features/llm.schema/test_llm_schema_ToJsonAtomicSimple.ts new file mode 100644 index 0000000000..cae4764af0 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ToJsonAtomicSimple.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ToJsonAtomicSimple } from "../../structures/ToJsonAtomicSimple"; + +export const test_llm_schema_ToJsonAtomicSimple = _test_llm_schema( + "ToJsonAtomicSimple", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ToJsonAtomicUnion.ts b/test/src/features/llm.schema/test_llm_schema_ToJsonAtomicUnion.ts new file mode 100644 index 0000000000..c30568a82c --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ToJsonAtomicUnion.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ToJsonAtomicUnion } from "../../structures/ToJsonAtomicUnion"; + +export const test_llm_schema_ToJsonAtomicUnion = _test_llm_schema( + "ToJsonAtomicUnion", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_ToJsonDouble.ts b/test/src/features/llm.schema/test_llm_schema_ToJsonDouble.ts new file mode 100644 index 0000000000..4bea2d320b --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ToJsonDouble.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ToJsonDouble } from "../../structures/ToJsonDouble"; + +export const test_llm_schema_ToJsonDouble = _test_llm_schema("ToJsonDouble")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_ToJsonNull.ts b/test/src/features/llm.schema/test_llm_schema_ToJsonNull.ts new file mode 100644 index 0000000000..5d058cd379 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ToJsonNull.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ToJsonNull } from "../../structures/ToJsonNull"; + +export const test_llm_schema_ToJsonNull = _test_llm_schema("ToJsonNull")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_ToJsonTuple.ts b/test/src/features/llm.schema/test_llm_schema_ToJsonTuple.ts new file mode 100644 index 0000000000..e3616eda27 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ToJsonTuple.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ToJsonTuple } from "../../structures/ToJsonTuple"; + +export const test_llm_schema_ToJsonTuple = _test_llm_schema("ToJsonTuple")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_ToJsonUnion.ts b/test/src/features/llm.schema/test_llm_schema_ToJsonUnion.ts new file mode 100644 index 0000000000..61f32dd5f4 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_ToJsonUnion.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { ToJsonUnion } from "../../structures/ToJsonUnion"; + +export const test_llm_schema_ToJsonUnion = _test_llm_schema("ToJsonUnion")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_TupleHierarchical.ts b/test/src/features/llm.schema/test_llm_schema_TupleHierarchical.ts new file mode 100644 index 0000000000..aff57f6fa8 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_TupleHierarchical.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { TupleHierarchical } from "../../structures/TupleHierarchical"; + +export const test_llm_schema_TupleHierarchical = _test_llm_schema( + "TupleHierarchical", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_TupleRestArray.ts b/test/src/features/llm.schema/test_llm_schema_TupleRestArray.ts new file mode 100644 index 0000000000..b6c5622836 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_TupleRestArray.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { TupleRestArray } from "../../structures/TupleRestArray"; + +export const test_llm_schema_TupleRestArray = _test_llm_schema( + "TupleRestArray", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_TupleRestAtomic.ts b/test/src/features/llm.schema/test_llm_schema_TupleRestAtomic.ts new file mode 100644 index 0000000000..b72e4f0285 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_TupleRestAtomic.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { TupleRestAtomic } from "../../structures/TupleRestAtomic"; + +export const test_llm_schema_TupleRestAtomic = _test_llm_schema( + "TupleRestAtomic", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_TupleRestObject.ts b/test/src/features/llm.schema/test_llm_schema_TupleRestObject.ts new file mode 100644 index 0000000000..f7ea113a4d --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_TupleRestObject.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { TupleRestObject } from "../../structures/TupleRestObject"; + +export const test_llm_schema_TupleRestObject = _test_llm_schema( + "TupleRestObject", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_TypeTagArray.ts b/test/src/features/llm.schema/test_llm_schema_TypeTagArray.ts new file mode 100644 index 0000000000..dfe1663ce3 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_TypeTagArray.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { TypeTagArray } from "../../structures/TypeTagArray"; + +export const test_llm_schema_TypeTagArray = _test_llm_schema("TypeTagArray")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_TypeTagArrayUnion.ts b/test/src/features/llm.schema/test_llm_schema_TypeTagArrayUnion.ts new file mode 100644 index 0000000000..1453494e1c --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_TypeTagArrayUnion.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { TypeTagArrayUnion } from "../../structures/TypeTagArrayUnion"; + +export const test_llm_schema_TypeTagArrayUnion = _test_llm_schema( + "TypeTagArrayUnion", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_TypeTagAtomicUnion.ts b/test/src/features/llm.schema/test_llm_schema_TypeTagAtomicUnion.ts new file mode 100644 index 0000000000..ebb7251e12 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_TypeTagAtomicUnion.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { TypeTagAtomicUnion } from "../../structures/TypeTagAtomicUnion"; + +export const test_llm_schema_TypeTagAtomicUnion = _test_llm_schema( + "TypeTagAtomicUnion", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_TypeTagCustom.ts b/test/src/features/llm.schema/test_llm_schema_TypeTagCustom.ts new file mode 100644 index 0000000000..c5ff33a23a --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_TypeTagCustom.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { TypeTagCustom } from "../../structures/TypeTagCustom"; + +export const test_llm_schema_TypeTagCustom = _test_llm_schema("TypeTagCustom")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_TypeTagDefault.ts b/test/src/features/llm.schema/test_llm_schema_TypeTagDefault.ts new file mode 100644 index 0000000000..3b760ef241 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_TypeTagDefault.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { TypeTagDefault } from "../../structures/TypeTagDefault"; + +export const test_llm_schema_TypeTagDefault = _test_llm_schema( + "TypeTagDefault", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_TypeTagFormat.ts b/test/src/features/llm.schema/test_llm_schema_TypeTagFormat.ts new file mode 100644 index 0000000000..1cc503fd34 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_TypeTagFormat.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { TypeTagFormat } from "../../structures/TypeTagFormat"; + +export const test_llm_schema_TypeTagFormat = _test_llm_schema("TypeTagFormat")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_TypeTagLength.ts b/test/src/features/llm.schema/test_llm_schema_TypeTagLength.ts new file mode 100644 index 0000000000..8a91a27ead --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_TypeTagLength.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { TypeTagLength } from "../../structures/TypeTagLength"; + +export const test_llm_schema_TypeTagLength = _test_llm_schema("TypeTagLength")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_TypeTagMatrix.ts b/test/src/features/llm.schema/test_llm_schema_TypeTagMatrix.ts new file mode 100644 index 0000000000..f1c8307cc5 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_TypeTagMatrix.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { TypeTagMatrix } from "../../structures/TypeTagMatrix"; + +export const test_llm_schema_TypeTagMatrix = _test_llm_schema("TypeTagMatrix")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_TypeTagObjectUnion.ts b/test/src/features/llm.schema/test_llm_schema_TypeTagObjectUnion.ts new file mode 100644 index 0000000000..896a977c05 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_TypeTagObjectUnion.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { TypeTagObjectUnion } from "../../structures/TypeTagObjectUnion"; + +export const test_llm_schema_TypeTagObjectUnion = _test_llm_schema( + "TypeTagObjectUnion", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_TypeTagPattern.ts b/test/src/features/llm.schema/test_llm_schema_TypeTagPattern.ts new file mode 100644 index 0000000000..be6156686c --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_TypeTagPattern.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { TypeTagPattern } from "../../structures/TypeTagPattern"; + +export const test_llm_schema_TypeTagPattern = _test_llm_schema( + "TypeTagPattern", +)(typia.llm.schema()); diff --git a/test/src/features/llm.schema/test_llm_schema_TypeTagRange.ts b/test/src/features/llm.schema/test_llm_schema_TypeTagRange.ts new file mode 100644 index 0000000000..757e1e01c5 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_TypeTagRange.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { TypeTagRange } from "../../structures/TypeTagRange"; + +export const test_llm_schema_TypeTagRange = _test_llm_schema("TypeTagRange")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_TypeTagTuple.ts b/test/src/features/llm.schema/test_llm_schema_TypeTagTuple.ts new file mode 100644 index 0000000000..0dc0a05f44 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_TypeTagTuple.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { TypeTagTuple } from "../../structures/TypeTagTuple"; + +export const test_llm_schema_TypeTagTuple = _test_llm_schema("TypeTagTuple")( + typia.llm.schema(), +); diff --git a/test/src/features/llm.schema/test_llm_schema_TypeTagType.ts b/test/src/features/llm.schema/test_llm_schema_TypeTagType.ts new file mode 100644 index 0000000000..dd5b692998 --- /dev/null +++ b/test/src/features/llm.schema/test_llm_schema_TypeTagType.ts @@ -0,0 +1,8 @@ +import typia from "typia"; + +import { _test_llm_schema } from "../../internal/_test_llm_schema"; +import { TypeTagType } from "../../structures/TypeTagType"; + +export const test_llm_schema_TypeTagType = _test_llm_schema("TypeTagType")( + typia.llm.schema(), +); diff --git a/test/src/internal/_test_llm_schema.ts b/test/src/internal/_test_llm_schema.ts new file mode 100644 index 0000000000..580bf08758 --- /dev/null +++ b/test/src/internal/_test_llm_schema.ts @@ -0,0 +1,35 @@ +import { ILlmSchema } from "@samchon/openapi"; +import fs from "fs"; + +export const _test_llm_schema = + (name: string) => + (expected: ILlmSchema): void => { + const actual: ILlmSchema = JSON.parse( + fs.readFileSync( + `${__dirname}/../../schemas/llm/type/${name}.json`, + "utf8", + ), + ); + sort(expected); + sort(actual); + }; + +function sort(app: ILlmSchema): void { + function object(elem: object) { + for (const value of Object.values(elem)) iterate(value); + } + function array(elem: Array) { + for (const v of elem) iterate(v); + elem.sort((x, y) => { + const alpha = JSON.stringify(x); + const beta = JSON.stringify(y); + return alpha < beta ? -1 : alpha === beta ? 0 : 1; + }); + } + function iterate(elem: any) { + if (elem === null || elem === undefined) return; + else if (Array.isArray(elem)) array(elem); + else if (typeof elem === "object") object(elem); + } + iterate(app); +} diff --git a/test/src/structures/ArrayRecursive.ts b/test/src/structures/ArrayRecursive.ts index 0108f20b50..e717f345b6 100644 --- a/test/src/structures/ArrayRecursive.ts +++ b/test/src/structures/ArrayRecursive.ts @@ -3,6 +3,8 @@ import { TestRandomGenerator } from "../helpers/TestRandomGenerator"; export type ArrayRecursive = ArrayRecursive.ICategory; export namespace ArrayRecursive { + export const RECURSIVE = true; + export interface ICategory { children: ICategory[]; id: number; diff --git a/test/src/structures/ArrayRecursiveUnionExplicit.ts b/test/src/structures/ArrayRecursiveUnionExplicit.ts index 78845315b8..7cb8c47ae6 100644 --- a/test/src/structures/ArrayRecursiveUnionExplicit.ts +++ b/test/src/structures/ArrayRecursiveUnionExplicit.ts @@ -3,6 +3,8 @@ import { TestRandomGenerator } from "../helpers/TestRandomGenerator"; export type ArrayRecursiveUnionExplicit = ArrayRecursiveUnionExplicit.IBucket[]; export namespace ArrayRecursiveUnionExplicit { + export const RECURSIVE = true; + export type IBucket = | IDirectory | IImageFile diff --git a/test/src/structures/ArrayRecursiveUnionExplicitPointer.ts b/test/src/structures/ArrayRecursiveUnionExplicitPointer.ts index 77b5f9498e..c944a43e67 100644 --- a/test/src/structures/ArrayRecursiveUnionExplicitPointer.ts +++ b/test/src/structures/ArrayRecursiveUnionExplicitPointer.ts @@ -6,6 +6,8 @@ export type ArrayRecursiveUnionExplicitPointer = IPointer< ArrayRecursiveUnionExplicitPointer.IBucket[] >; export namespace ArrayRecursiveUnionExplicitPointer { + export const RECURSIVE = true; + export type IBucket = IPointer< IDirectory | IImageFile | ITextFile | IZipFile | IShortcut >; diff --git a/test/src/structures/ArrayRecursiveUnionImplicit.ts b/test/src/structures/ArrayRecursiveUnionImplicit.ts index 532b0ab834..a36e9263b5 100644 --- a/test/src/structures/ArrayRecursiveUnionImplicit.ts +++ b/test/src/structures/ArrayRecursiveUnionImplicit.ts @@ -3,6 +3,8 @@ import { TestRandomGenerator } from "../helpers/TestRandomGenerator"; export type ArrayRecursiveUnionImplicit = ArrayRecursiveUnionImplicit.IBucket[]; export namespace ArrayRecursiveUnionImplicit { + export const RECURSIVE = true; + export type IBucket = | IDirectory | ISharedDirectory diff --git a/test/src/structures/ArrayRepeatedNullable.ts b/test/src/structures/ArrayRepeatedNullable.ts index 5bc3e92a9c..cea6a2fed7 100644 --- a/test/src/structures/ArrayRepeatedNullable.ts +++ b/test/src/structures/ArrayRepeatedNullable.ts @@ -8,6 +8,8 @@ export type ArrayRepeatedNullable = | string | ArrayRepeatedNullable[]; export namespace ArrayRepeatedNullable { + export const RECURSIVE = true; + export function generate(): ArrayRepeatedNullable { const random = typia.createRandom(); return [ diff --git a/test/src/structures/ArrayRepeatedOptional.ts b/test/src/structures/ArrayRepeatedOptional.ts index ee83288885..0a9946942c 100644 --- a/test/src/structures/ArrayRepeatedOptional.ts +++ b/test/src/structures/ArrayRepeatedOptional.ts @@ -8,6 +8,8 @@ export type ArrayRepeatedOptional = | string | ArrayRepeatedOptional[]; export namespace ArrayRepeatedOptional { + export const RECURSIVE = true; + export function generate(): ArrayRepeatedOptional { const random = typia.createRandom(); return [ diff --git a/test/src/structures/ArrayRepeatedRequired.ts b/test/src/structures/ArrayRepeatedRequired.ts index d18bc8cdc6..f6713eed32 100644 --- a/test/src/structures/ArrayRepeatedRequired.ts +++ b/test/src/structures/ArrayRepeatedRequired.ts @@ -4,6 +4,8 @@ import { Spoiler } from "../helpers/Spoiler"; export type ArrayRepeatedRequired = number | string | ArrayRepeatedRequired[]; export namespace ArrayRepeatedRequired { + export const RECURSIVE = true; + export function generate(): ArrayRepeatedRequired { const random = typia.createRandom(); return [ diff --git a/test/src/structures/ArrayRepeatedUnion.ts b/test/src/structures/ArrayRepeatedUnion.ts index 440f0254c8..1692ce71cd 100644 --- a/test/src/structures/ArrayRepeatedUnion.ts +++ b/test/src/structures/ArrayRepeatedUnion.ts @@ -9,6 +9,8 @@ export type ArrayRepeatedUnion = | ArrayRepeatedUnion[] | ArrayRepeatedUnion.IBox3D[]; export namespace ArrayRepeatedUnion { + export const RECURSIVE = true; + export interface IBox3D { scale: IPoint3D; position: IPoint3D; diff --git a/test/src/structures/ArrayRepeatedUnionWithTuple.ts b/test/src/structures/ArrayRepeatedUnionWithTuple.ts index 2740657c3c..a1a9537238 100644 --- a/test/src/structures/ArrayRepeatedUnionWithTuple.ts +++ b/test/src/structures/ArrayRepeatedUnionWithTuple.ts @@ -11,6 +11,8 @@ export type ArrayRepeatedUnionWithTuple = | [string, number, boolean] | [ArrayRepeatedUnionWithTuple.IBox3D, ArrayRepeatedUnionWithTuple.IPoint3D]; export namespace ArrayRepeatedUnionWithTuple { + export const RECURSIVE = true; + export interface IBox3D { scale: IPoint3D; position: IPoint3D; diff --git a/test/src/structures/DynamicTree.ts b/test/src/structures/DynamicTree.ts index 8da6964b0b..786a7b4be5 100644 --- a/test/src/structures/DynamicTree.ts +++ b/test/src/structures/DynamicTree.ts @@ -10,6 +10,9 @@ export interface DynamicTree { children: Record; } export namespace DynamicTree { + export const ADDABLE = false; + export const RECURSIVE = true; + export function generate(): DynamicTree { return create(3, 1); } @@ -42,6 +45,4 @@ export namespace DynamicTree { return [`$input.children["${top.id}"].children["${bottom.id}"].sequence`]; }, ]; - - export const ADDABLE = false; } diff --git a/test/src/structures/ObjectPartial.ts b/test/src/structures/ObjectPartial.ts index c0ee7b0fa6..2d2ba6e7a3 100644 --- a/test/src/structures/ObjectPartial.ts +++ b/test/src/structures/ObjectPartial.ts @@ -2,6 +2,8 @@ import { Spoiler } from "../helpers/Spoiler"; export type ObjectPartial = Partial; export namespace ObjectPartial { + export const RECURSIVE = true; + export interface IBase { boolean: boolean; number: number; diff --git a/test/src/structures/ObjectPartialAndRequired.ts b/test/src/structures/ObjectPartialAndRequired.ts index 0b0ba4aee2..dd94bfc521 100644 --- a/test/src/structures/ObjectPartialAndRequired.ts +++ b/test/src/structures/ObjectPartialAndRequired.ts @@ -6,6 +6,8 @@ export type ObjectPartialAndRequired = Pick< > & Required>; export namespace ObjectPartialAndRequired { + export const RECURSIVE = true; + export interface IBase { boolean: boolean; number: number; diff --git a/test/src/structures/ObjectRecursive.ts b/test/src/structures/ObjectRecursive.ts index 93d0ab5516..9b1ef907e3 100644 --- a/test/src/structures/ObjectRecursive.ts +++ b/test/src/structures/ObjectRecursive.ts @@ -4,6 +4,7 @@ import { TestRandomGenerator } from "../helpers/TestRandomGenerator"; export type ObjectRecursive = ObjectRecursive.IDepartment; export namespace ObjectRecursive { export const BINARABLE = false; + export const RECURSIVE = true; export interface IDepartment { parent: IDepartment | null; diff --git a/test/src/structures/ObjectRequired.ts b/test/src/structures/ObjectRequired.ts index 5150976913..5c1b460d40 100644 --- a/test/src/structures/ObjectRequired.ts +++ b/test/src/structures/ObjectRequired.ts @@ -2,6 +2,8 @@ import { Spoiler } from "../helpers/Spoiler"; export type ObjectRequired = Required; export namespace ObjectRequired { + export const RECURSIVE = true; + export interface IBase { boolean?: boolean; number?: number; diff --git a/test/src/structures/UltimateUnion.ts b/test/src/structures/UltimateUnion.ts index 97b7ef6d29..8c51e9fdfc 100644 --- a/test/src/structures/UltimateUnion.ts +++ b/test/src/structures/UltimateUnion.ts @@ -7,6 +7,8 @@ import { ObjectUnionImplicit } from "./ObjectUnionImplicit"; export type UltimateUnion = typia.IJsonApplication[]; export namespace UltimateUnion { + export const RECURSIVE = true; + export function generate(): typia.IJsonApplication[] { const output = [ typia.json.application<[ObjectUnionExplicit]>(),