typia 9.7.1 → 9.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AssertionGuard.d.mts +27 -25
- package/lib/AssertionGuard.d.ts +27 -25
- package/lib/CamelCase.d.mts +1 -1
- package/lib/CamelCase.d.ts +1 -1
- package/lib/IRandomGenerator.d.mts +44 -42
- package/lib/IRandomGenerator.d.ts +44 -42
- package/lib/IReadableURLSearchParams.d.mts +2 -2
- package/lib/IReadableURLSearchParams.d.ts +2 -2
- package/lib/PascalCase.d.mts +1 -1
- package/lib/PascalCase.d.ts +1 -1
- package/lib/Primitive.d.mts +20 -22
- package/lib/Primitive.d.ts +20 -22
- package/lib/Resolved.d.mts +16 -18
- package/lib/Resolved.d.ts +16 -18
- package/lib/SnakeCase.d.mts +3 -2
- package/lib/SnakeCase.d.ts +3 -2
- package/lib/TypeGuardError.d.mts +88 -61
- package/lib/TypeGuardError.d.ts +88 -61
- package/lib/TypeGuardError.js +40 -29
- package/lib/TypeGuardError.js.map +1 -1
- package/lib/TypeGuardError.mjs +70 -48
- package/lib/factories/MetadataCollection.js +4 -12
- package/lib/factories/MetadataCollection.js.map +1 -1
- package/lib/factories/MetadataCollection.mjs +4 -12
- package/lib/factories/MetadataCommentTagFactory.js +5 -15
- package/lib/factories/MetadataCommentTagFactory.js.map +1 -1
- package/lib/factories/MetadataCommentTagFactory.mjs +5 -15
- package/lib/factories/MetadataFactory.js +1 -3
- package/lib/factories/MetadataFactory.js.map +1 -1
- package/lib/factories/MetadataFactory.mjs +1 -3
- package/lib/factories/ProtobufFactory.js +1 -3
- package/lib/factories/ProtobufFactory.js.map +1 -1
- package/lib/factories/ProtobufFactory.mjs +1 -3
- package/lib/functional.d.mts +196 -195
- package/lib/functional.d.ts +196 -195
- package/lib/functional.js +18 -54
- package/lib/functional.js.map +1 -1
- package/lib/functional.mjs +18 -54
- package/lib/http.d.mts +303 -319
- package/lib/http.d.ts +303 -319
- package/lib/http.js +26 -78
- package/lib/http.js.map +1 -1
- package/lib/http.mjs +26 -78
- package/lib/internal/_ProtobufReader.d.mts +3 -9
- package/lib/internal/_ProtobufReader.d.ts +3 -9
- package/lib/internal/_ProtobufReader.js.map +1 -1
- package/lib/internal/_ProtobufReader.mjs +3 -9
- package/lib/internal/_ProtobufSizer.d.mts +4 -12
- package/lib/internal/_ProtobufSizer.d.ts +4 -12
- package/lib/internal/_ProtobufSizer.js.map +1 -1
- package/lib/internal/_ProtobufSizer.mjs +4 -12
- package/lib/internal/_ProtobufWriter.d.mts +5 -15
- package/lib/internal/_ProtobufWriter.d.ts +5 -15
- package/lib/internal/_ProtobufWriter.js.map +1 -1
- package/lib/internal/_ProtobufWriter.mjs +5 -15
- package/lib/internal/_jsonStringifyString.d.mts +4 -4
- package/lib/internal/_jsonStringifyString.d.ts +4 -4
- package/lib/internal/_jsonStringifyString.js +4 -4
- package/lib/internal/_jsonStringifyString.mjs +4 -4
- package/lib/json.d.mts +174 -195
- package/lib/json.d.ts +174 -195
- package/lib/json.js +16 -48
- package/lib/json.js.map +1 -1
- package/lib/json.mjs +16 -48
- package/lib/llm.d.mts +275 -192
- package/lib/llm.d.ts +275 -192
- package/lib/llm.js +4 -12
- package/lib/llm.js.map +1 -1
- package/lib/llm.mjs +4 -12
- package/lib/misc.d.mts +149 -172
- package/lib/misc.d.ts +149 -172
- package/lib/misc.js +17 -51
- package/lib/misc.js.map +1 -1
- package/lib/misc.mjs +17 -51
- package/lib/module.d.mts +263 -275
- package/lib/module.d.ts +263 -275
- package/lib/module.js +18 -54
- package/lib/module.js.map +1 -1
- package/lib/module.mjs +18 -54
- package/lib/notations.d.mts +153 -174
- package/lib/notations.d.ts +153 -174
- package/lib/notations.js +24 -72
- package/lib/notations.js.map +1 -1
- package/lib/notations.mjs +24 -72
- package/lib/programmers/FeatureProgrammer.d.mts +19 -41
- package/lib/programmers/FeatureProgrammer.d.ts +19 -41
- package/lib/programmers/FeatureProgrammer.js.map +1 -1
- package/lib/programmers/ImportProgrammer.js +3 -9
- package/lib/programmers/ImportProgrammer.js.map +1 -1
- package/lib/programmers/ImportProgrammer.mjs +3 -9
- package/lib/programmers/RandomProgrammer.js +6 -0
- package/lib/programmers/RandomProgrammer.js.map +1 -1
- package/lib/programmers/RandomProgrammer.mjs +6 -0
- package/lib/programmers/helpers/ProtobufWire.d.mts +13 -13
- package/lib/programmers/helpers/ProtobufWire.d.ts +13 -13
- package/lib/programmers/internal/check_array_length.js +2 -6
- package/lib/programmers/internal/check_array_length.js.map +1 -1
- package/lib/programmers/internal/check_array_length.mjs +2 -6
- package/lib/programmers/internal/check_bigint.js +2 -6
- package/lib/programmers/internal/check_bigint.js.map +1 -1
- package/lib/programmers/internal/check_bigint.mjs +2 -6
- package/lib/programmers/internal/check_dynamic_key.js +2 -6
- package/lib/programmers/internal/check_dynamic_key.js.map +1 -1
- package/lib/programmers/internal/check_dynamic_key.mjs +2 -6
- package/lib/programmers/internal/check_dynamic_properties.js +3 -9
- package/lib/programmers/internal/check_dynamic_properties.js.map +1 -1
- package/lib/programmers/internal/check_dynamic_properties.mjs +3 -9
- package/lib/programmers/internal/check_everything.js +1 -3
- package/lib/programmers/internal/check_everything.js.map +1 -1
- package/lib/programmers/internal/check_everything.mjs +1 -3
- package/lib/programmers/internal/check_native.js +2 -6
- package/lib/programmers/internal/check_native.js.map +1 -1
- package/lib/programmers/internal/check_native.mjs +2 -6
- package/lib/programmers/internal/check_number.js +2 -6
- package/lib/programmers/internal/check_number.js.map +1 -1
- package/lib/programmers/internal/check_number.mjs +2 -6
- package/lib/programmers/internal/check_object.js +2 -6
- package/lib/programmers/internal/check_object.js.map +1 -1
- package/lib/programmers/internal/check_object.mjs +2 -6
- package/lib/programmers/internal/check_string.js +2 -6
- package/lib/programmers/internal/check_string.js.map +1 -1
- package/lib/programmers/internal/check_string.mjs +2 -6
- package/lib/programmers/internal/check_template.js +1 -3
- package/lib/programmers/internal/check_template.js.map +1 -1
- package/lib/programmers/internal/check_template.mjs +1 -3
- package/lib/programmers/internal/check_union_array_like.js +1 -3
- package/lib/programmers/internal/check_union_array_like.js.map +1 -1
- package/lib/programmers/internal/check_union_array_like.mjs +1 -3
- package/lib/programmers/internal/decode_union_object.js +2 -6
- package/lib/programmers/internal/decode_union_object.js.map +1 -1
- package/lib/programmers/internal/decode_union_object.mjs +2 -6
- package/lib/programmers/internal/feature_object_entries.js +1 -3
- package/lib/programmers/internal/feature_object_entries.js.map +1 -1
- package/lib/programmers/internal/feature_object_entries.mjs +1 -3
- package/lib/programmers/internal/json_schema_escaped.js +2 -6
- package/lib/programmers/internal/json_schema_escaped.js.map +1 -1
- package/lib/programmers/internal/json_schema_escaped.mjs +2 -6
- package/lib/programmers/internal/json_schema_object.js +3 -9
- package/lib/programmers/internal/json_schema_object.js.map +1 -1
- package/lib/programmers/internal/json_schema_object.mjs +3 -9
- package/lib/programmers/internal/metadata_to_pattern.js +1 -3
- package/lib/programmers/internal/metadata_to_pattern.js.map +1 -1
- package/lib/programmers/internal/metadata_to_pattern.mjs +1 -3
- package/lib/programmers/internal/postfix_of_tuple.js +1 -3
- package/lib/programmers/internal/postfix_of_tuple.js.map +1 -1
- package/lib/programmers/internal/postfix_of_tuple.mjs +1 -3
- package/lib/programmers/internal/prune_object_properties.js +1 -3
- package/lib/programmers/internal/prune_object_properties.js.map +1 -1
- package/lib/programmers/internal/prune_object_properties.mjs +1 -3
- package/lib/programmers/internal/stringify_dynamic_properties.js +2 -6
- package/lib/programmers/internal/stringify_dynamic_properties.js.map +1 -1
- package/lib/programmers/internal/stringify_dynamic_properties.mjs +2 -6
- package/lib/programmers/internal/stringify_native.js +1 -3
- package/lib/programmers/internal/stringify_native.js.map +1 -1
- package/lib/programmers/internal/stringify_native.mjs +1 -3
- package/lib/programmers/internal/stringify_regular_properties.js +2 -6
- package/lib/programmers/internal/stringify_regular_properties.js.map +1 -1
- package/lib/programmers/internal/stringify_regular_properties.mjs +2 -6
- package/lib/programmers/internal/template_to_pattern.js +1 -3
- package/lib/programmers/internal/template_to_pattern.js.map +1 -1
- package/lib/programmers/internal/template_to_pattern.mjs +1 -3
- package/lib/programmers/internal/wrap_metadata_rest_tuple.js +1 -3
- package/lib/programmers/internal/wrap_metadata_rest_tuple.js.map +1 -1
- package/lib/programmers/internal/wrap_metadata_rest_tuple.mjs +1 -3
- package/lib/programmers/json/JsonStringifyProgrammer.js +2 -2
- package/lib/programmers/json/JsonStringifyProgrammer.js.map +1 -1
- package/lib/programmers/json/JsonStringifyProgrammer.mjs +2 -2
- package/lib/protobuf.d.mts +290 -297
- package/lib/protobuf.d.ts +290 -297
- package/lib/protobuf.js +17 -51
- package/lib/protobuf.js.map +1 -1
- package/lib/protobuf.mjs +17 -51
- package/lib/reflect.d.mts +2 -4
- package/lib/reflect.d.ts +2 -4
- package/lib/reflect.js +1 -3
- package/lib/reflect.js.map +1 -1
- package/lib/reflect.mjs +1 -3
- package/lib/schemas/json/IJsonApplication.d.mts +4 -4
- package/lib/schemas/json/IJsonApplication.d.ts +4 -4
- package/lib/schemas/json/IJsonSchemaCollection.d.mts +73 -56
- package/lib/schemas/json/IJsonSchemaCollection.d.ts +73 -56
- package/lib/schemas/json/IJsonSchemaUnit.d.mts +83 -70
- package/lib/schemas/json/IJsonSchemaUnit.d.ts +83 -70
- package/lib/schemas/metadata/Metadata.d.mts +1 -3
- package/lib/schemas/metadata/Metadata.d.ts +1 -3
- package/lib/schemas/metadata/Metadata.js +9 -27
- package/lib/schemas/metadata/Metadata.js.map +1 -1
- package/lib/schemas/metadata/Metadata.mjs +9 -27
- package/lib/schemas/metadata/MetadataAliasType.d.mts +1 -3
- package/lib/schemas/metadata/MetadataAliasType.d.ts +1 -3
- package/lib/schemas/metadata/MetadataAliasType.js +3 -9
- package/lib/schemas/metadata/MetadataAliasType.js.map +1 -1
- package/lib/schemas/metadata/MetadataAliasType.mjs +3 -9
- package/lib/schemas/metadata/MetadataApplication.d.mts +1 -3
- package/lib/schemas/metadata/MetadataApplication.d.ts +1 -3
- package/lib/schemas/metadata/MetadataApplication.js +2 -6
- package/lib/schemas/metadata/MetadataApplication.js.map +1 -1
- package/lib/schemas/metadata/MetadataApplication.mjs +2 -6
- package/lib/schemas/metadata/MetadataArray.d.mts +1 -3
- package/lib/schemas/metadata/MetadataArray.d.ts +1 -3
- package/lib/schemas/metadata/MetadataArray.js +1 -3
- package/lib/schemas/metadata/MetadataArray.js.map +1 -1
- package/lib/schemas/metadata/MetadataArray.mjs +1 -3
- package/lib/schemas/metadata/MetadataArrayType.d.mts +1 -3
- package/lib/schemas/metadata/MetadataArrayType.d.ts +1 -3
- package/lib/schemas/metadata/MetadataArrayType.js +3 -9
- package/lib/schemas/metadata/MetadataArrayType.js.map +1 -1
- package/lib/schemas/metadata/MetadataArrayType.mjs +3 -9
- package/lib/schemas/metadata/MetadataAtomic.js +1 -3
- package/lib/schemas/metadata/MetadataAtomic.js.map +1 -1
- package/lib/schemas/metadata/MetadataAtomic.mjs +1 -3
- package/lib/schemas/metadata/MetadataEscaped.d.mts +1 -3
- package/lib/schemas/metadata/MetadataEscaped.d.ts +1 -3
- package/lib/schemas/metadata/MetadataEscaped.js +3 -9
- package/lib/schemas/metadata/MetadataEscaped.js.map +1 -1
- package/lib/schemas/metadata/MetadataEscaped.mjs +3 -9
- package/lib/schemas/metadata/MetadataFunction.d.mts +1 -3
- package/lib/schemas/metadata/MetadataFunction.d.ts +1 -3
- package/lib/schemas/metadata/MetadataFunction.js +2 -6
- package/lib/schemas/metadata/MetadataFunction.js.map +1 -1
- package/lib/schemas/metadata/MetadataFunction.mjs +2 -6
- package/lib/schemas/metadata/MetadataObject.d.mts +1 -3
- package/lib/schemas/metadata/MetadataObject.d.ts +1 -3
- package/lib/schemas/metadata/MetadataObject.js +1 -3
- package/lib/schemas/metadata/MetadataObject.js.map +1 -1
- package/lib/schemas/metadata/MetadataObject.mjs +1 -3
- package/lib/schemas/metadata/MetadataObjectType.d.mts +1 -3
- package/lib/schemas/metadata/MetadataObjectType.d.ts +1 -3
- package/lib/schemas/metadata/MetadataObjectType.js +5 -15
- package/lib/schemas/metadata/MetadataObjectType.js.map +1 -1
- package/lib/schemas/metadata/MetadataObjectType.mjs +6 -18
- package/lib/schemas/metadata/MetadataParameter.js +1 -3
- package/lib/schemas/metadata/MetadataParameter.js.map +1 -1
- package/lib/schemas/metadata/MetadataParameter.mjs +1 -3
- package/lib/schemas/metadata/MetadataProperty.d.mts +1 -3
- package/lib/schemas/metadata/MetadataProperty.d.ts +1 -3
- package/lib/schemas/metadata/MetadataProperty.js +3 -9
- package/lib/schemas/metadata/MetadataProperty.js.map +1 -1
- package/lib/schemas/metadata/MetadataProperty.mjs +3 -9
- package/lib/schemas/metadata/MetadataTemplate.js +1 -3
- package/lib/schemas/metadata/MetadataTemplate.js.map +1 -1
- package/lib/schemas/metadata/MetadataTemplate.mjs +1 -3
- package/lib/schemas/metadata/MetadataTuple.d.mts +1 -3
- package/lib/schemas/metadata/MetadataTuple.d.ts +1 -3
- package/lib/schemas/metadata/MetadataTuple.js +2 -6
- package/lib/schemas/metadata/MetadataTuple.js.map +1 -1
- package/lib/schemas/metadata/MetadataTuple.mjs +2 -6
- package/lib/schemas/metadata/MetadataTupleType.js +2 -6
- package/lib/schemas/metadata/MetadataTupleType.js.map +1 -1
- package/lib/schemas/metadata/MetadataTupleType.mjs +3 -9
- package/lib/tags/Constant.d.mts +16 -16
- package/lib/tags/Constant.d.ts +16 -16
- package/lib/tags/ContentMediaType.d.mts +7 -7
- package/lib/tags/ContentMediaType.d.ts +7 -7
- package/lib/tags/Default.d.mts +19 -19
- package/lib/tags/Default.d.ts +19 -19
- package/lib/tags/Example.d.mts +18 -18
- package/lib/tags/Example.d.ts +18 -18
- package/lib/tags/Examples.d.mts +23 -23
- package/lib/tags/Examples.d.ts +23 -23
- package/lib/tags/ExclusiveMaximum.d.mts +8 -5
- package/lib/tags/ExclusiveMaximum.d.ts +8 -5
- package/lib/tags/ExclusiveMinimum.d.mts +8 -5
- package/lib/tags/ExclusiveMinimum.d.ts +8 -5
- package/lib/tags/Format.d.mts +12 -8
- package/lib/tags/Format.d.ts +12 -8
- package/lib/tags/JsonSchemaPlugin.d.mts +20 -18
- package/lib/tags/JsonSchemaPlugin.d.ts +20 -18
- package/lib/tags/MaxItems.d.mts +9 -9
- package/lib/tags/MaxItems.d.ts +9 -9
- package/lib/tags/MaxLength.d.mts +6 -5
- package/lib/tags/MaxLength.d.ts +6 -5
- package/lib/tags/Maximum.d.mts +9 -7
- package/lib/tags/Maximum.d.ts +9 -7
- package/lib/tags/MinItems.d.mts +9 -9
- package/lib/tags/MinItems.d.ts +9 -9
- package/lib/tags/MinLength.d.mts +6 -5
- package/lib/tags/MinLength.d.ts +6 -5
- package/lib/tags/Minimum.d.mts +9 -7
- package/lib/tags/Minimum.d.ts +9 -7
- package/lib/tags/MultipleOf.d.mts +10 -7
- package/lib/tags/MultipleOf.d.ts +10 -7
- package/lib/tags/Pattern.d.mts +7 -4
- package/lib/tags/Pattern.d.ts +7 -4
- package/lib/tags/Sequence.d.mts +19 -17
- package/lib/tags/Sequence.d.ts +19 -17
- package/lib/tags/TagBase.d.mts +21 -28
- package/lib/tags/TagBase.d.ts +21 -28
- package/lib/tags/Type.d.mts +12 -11
- package/lib/tags/Type.d.ts +12 -11
- package/lib/tags/UniqueItems.d.mts +10 -9
- package/lib/tags/UniqueItems.d.ts +10 -9
- package/lib/tags/internal/FormatCheatSheet.d.mts +1 -3
- package/lib/tags/internal/FormatCheatSheet.d.ts +1 -3
- package/lib/tags/internal/FormatCheatSheet.js +1 -3
- package/lib/tags/internal/FormatCheatSheet.js.map +1 -1
- package/lib/tags/internal/FormatCheatSheet.mjs +1 -3
- package/lib/transformers/ITransformOptions.d.mts +27 -19
- package/lib/transformers/ITransformOptions.d.ts +27 -19
- package/lib/transformers/ImportTransformer.js +5 -10
- package/lib/transformers/ImportTransformer.js.map +1 -1
- package/lib/transformers/ImportTransformer.mjs +5 -10
- package/lib/transformers/NoTransformConfigurationError.js +1 -3
- package/lib/transformers/NoTransformConfigurationError.js.map +1 -1
- package/lib/transformers/NoTransformConfigurationError.mjs +1 -3
- package/lib/transformers/features/llm/LlmApplicationTransformer.js +1 -3
- package/lib/transformers/features/llm/LlmApplicationTransformer.js.map +1 -1
- package/lib/transformers/features/llm/LlmApplicationTransformer.mjs +1 -3
- package/lib/typings/Equal.d.mts +6 -6
- package/lib/typings/Equal.d.ts +6 -6
- package/package.json +2 -1
- package/src/AssertionGuard.ts +27 -25
- package/src/CamelCase.ts +1 -1
- package/src/IRandomGenerator.ts +44 -42
- package/src/IReadableURLSearchParams.ts +2 -2
- package/src/PascalCase.ts +1 -1
- package/src/Primitive.ts +20 -22
- package/src/Resolved.ts +16 -18
- package/src/SnakeCase.ts +3 -2
- package/src/TypeGuardError.ts +101 -64
- package/src/factories/MetadataCollection.ts +4 -12
- package/src/factories/MetadataCommentTagFactory.ts +8 -24
- package/src/factories/MetadataFactory.ts +1 -3
- package/src/factories/ProtobufFactory.ts +1 -3
- package/src/functional.ts +214 -249
- package/src/http.ts +329 -397
- package/src/internal/_ProtobufReader.ts +3 -9
- package/src/internal/_ProtobufSizer.ts +4 -12
- package/src/internal/_ProtobufWriter.ts +5 -15
- package/src/internal/_jsonStringifyString.ts +4 -4
- package/src/json.ts +190 -243
- package/src/llm.ts +279 -204
- package/src/misc.ts +166 -223
- package/src/module.ts +281 -329
- package/src/notations.ts +177 -246
- package/src/programmers/FeatureProgrammer.ts +19 -41
- package/src/programmers/ImportProgrammer.ts +3 -9
- package/src/programmers/RandomProgrammer.ts +6 -1
- package/src/programmers/helpers/ProtobufWire.ts +13 -13
- package/src/programmers/internal/check_array_length.ts +2 -6
- package/src/programmers/internal/check_bigint.ts +2 -6
- package/src/programmers/internal/check_dynamic_key.ts +2 -6
- package/src/programmers/internal/check_dynamic_properties.ts +3 -9
- package/src/programmers/internal/check_everything.ts +1 -3
- package/src/programmers/internal/check_native.ts +2 -6
- package/src/programmers/internal/check_number.ts +2 -6
- package/src/programmers/internal/check_object.ts +3 -9
- package/src/programmers/internal/check_string.ts +2 -6
- package/src/programmers/internal/check_template.ts +1 -3
- package/src/programmers/internal/check_union_array_like.ts +2 -6
- package/src/programmers/internal/decode_union_object.ts +3 -9
- package/src/programmers/internal/feature_object_entries.ts +1 -3
- package/src/programmers/internal/json_schema_escaped.ts +2 -6
- package/src/programmers/internal/json_schema_object.ts +4 -12
- package/src/programmers/internal/metadata_to_pattern.ts +1 -3
- package/src/programmers/internal/postfix_of_tuple.ts +1 -3
- package/src/programmers/internal/prune_object_properties.ts +1 -3
- package/src/programmers/internal/stringify_dynamic_properties.ts +2 -6
- package/src/programmers/internal/stringify_native.ts +1 -3
- package/src/programmers/internal/stringify_regular_properties.ts +2 -6
- package/src/programmers/internal/template_to_pattern.ts +1 -3
- package/src/programmers/internal/wrap_metadata_rest_tuple.ts +1 -3
- package/src/programmers/json/JsonStringifyProgrammer.ts +2 -2
- package/src/protobuf.ts +307 -348
- package/src/reflect.ts +3 -7
- package/src/schemas/json/IJsonApplication.ts +4 -4
- package/src/schemas/json/IJsonSchemaCollection.ts +73 -56
- package/src/schemas/json/IJsonSchemaUnit.ts +83 -70
- package/src/schemas/metadata/IMetadataTypeTag.ts +1 -3
- package/src/schemas/metadata/Metadata.ts +9 -27
- package/src/schemas/metadata/MetadataAliasType.ts +3 -9
- package/src/schemas/metadata/MetadataApplication.ts +2 -6
- package/src/schemas/metadata/MetadataArray.ts +1 -3
- package/src/schemas/metadata/MetadataArrayType.ts +3 -9
- package/src/schemas/metadata/MetadataAtomic.ts +1 -3
- package/src/schemas/metadata/MetadataEscaped.ts +3 -9
- package/src/schemas/metadata/MetadataFunction.ts +2 -6
- package/src/schemas/metadata/MetadataObject.ts +1 -3
- package/src/schemas/metadata/MetadataObjectType.ts +6 -18
- package/src/schemas/metadata/MetadataParameter.ts +1 -3
- package/src/schemas/metadata/MetadataProperty.ts +3 -9
- package/src/schemas/metadata/MetadataTemplate.ts +1 -3
- package/src/schemas/metadata/MetadataTuple.ts +2 -6
- package/src/schemas/metadata/MetadataTupleType.ts +3 -9
- package/src/tags/Constant.ts +16 -16
- package/src/tags/ContentMediaType.ts +7 -7
- package/src/tags/Default.ts +19 -19
- package/src/tags/Example.ts +18 -18
- package/src/tags/Examples.ts +23 -23
- package/src/tags/ExclusiveMaximum.ts +8 -5
- package/src/tags/ExclusiveMinimum.ts +8 -5
- package/src/tags/Format.ts +12 -8
- package/src/tags/JsonSchemaPlugin.ts +20 -18
- package/src/tags/MaxItems.ts +9 -9
- package/src/tags/MaxLength.ts +6 -5
- package/src/tags/Maximum.ts +9 -7
- package/src/tags/MinItems.ts +9 -9
- package/src/tags/MinLength.ts +6 -5
- package/src/tags/Minimum.ts +9 -7
- package/src/tags/MultipleOf.ts +10 -7
- package/src/tags/Pattern.ts +7 -4
- package/src/tags/Sequence.ts +19 -17
- package/src/tags/TagBase.ts +21 -28
- package/src/tags/Type.ts +12 -11
- package/src/tags/UniqueItems.ts +10 -9
- package/src/tags/internal/FormatCheatSheet.ts +1 -3
- package/src/transformers/ITransformOptions.ts +27 -19
- package/src/transformers/ImportTransformer.ts +5 -10
- package/src/transformers/NoTransformConfigurationError.ts +1 -3
- package/src/transformers/features/llm/LlmApplicationTransformer.ts +1 -3
- package/src/typings/Equal.ts +6 -6
package/src/reflect.ts
CHANGED
|
@@ -13,10 +13,9 @@ import { NoTransformConfigurationError } from "./transformers/NoTransformConfigu
|
|
|
13
13
|
* stored in the {@link IMetadataApplication.components} property. Also, alias
|
|
14
14
|
* types are stored in the {@link IMetadataApplication.aliases} property, too.
|
|
15
15
|
*
|
|
16
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
16
17
|
* @template Types Tuple of target types
|
|
17
18
|
* @returns Metadata application
|
|
18
|
-
*
|
|
19
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
20
19
|
*/
|
|
21
20
|
export function metadata(): never;
|
|
22
21
|
|
|
@@ -29,16 +28,13 @@ export function metadata(): never;
|
|
|
29
28
|
* stored in the {@link IMetadataApplication.components} property. Also, alias
|
|
30
29
|
* types are stored in the {@link IMetadataApplication.aliases} property, too.
|
|
31
30
|
*
|
|
31
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
32
32
|
* @template Types Tuple of target types
|
|
33
33
|
* @returns Metadata application
|
|
34
|
-
*
|
|
35
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
36
34
|
*/
|
|
37
35
|
export function metadata<Types extends unknown[]>(): IMetadataApplication;
|
|
38
36
|
|
|
39
|
-
/**
|
|
40
|
-
* @internal
|
|
41
|
-
*/
|
|
37
|
+
/** @internal */
|
|
42
38
|
export function metadata(): never {
|
|
43
39
|
NoTransformConfigurationError("reflect.metadata");
|
|
44
40
|
}
|
|
@@ -3,12 +3,12 @@ import { IJsonSchemaCollection } from "./IJsonSchemaCollection";
|
|
|
3
3
|
/**
|
|
4
4
|
* Collection of JSON schemas.
|
|
5
5
|
*
|
|
6
|
-
* @
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
7
|
+
* @deprecated Use {@link IJsonSchemaCollection} instead please. This interface
|
|
8
|
+
* type would be changed to {@link ILlmApplication} like structure in the
|
|
9
|
+
* future version (maybe next v8 major update).
|
|
9
10
|
* @template Version Version of the OpenAPI specification.
|
|
10
11
|
* @template Types Original TypeScript types used in the JSON schemas.
|
|
11
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
12
12
|
*/
|
|
13
13
|
export type IJsonApplication = IJsonSchemaCollection;
|
|
14
14
|
export namespace IJsonApplication {
|
|
@@ -4,37 +4,43 @@ import type { OpenApi, OpenApiV3 } from "@samchon/openapi";
|
|
|
4
4
|
* Collection of JSON schemas with OpenAPI specification support.
|
|
5
5
|
*
|
|
6
6
|
* `IJsonSchemaCollection` represents a comprehensive collection of JSON schemas
|
|
7
|
-
* that can be generated from TypeScript types using the `typia.json.schemas()`
|
|
8
|
-
* This interface supports both OpenAPI v3.0 and v3.1 specifications,
|
|
9
|
-
* to automatically generate appropriate schema definitions
|
|
7
|
+
* that can be generated from TypeScript types using the `typia.json.schemas()`
|
|
8
|
+
* function. This interface supports both OpenAPI v3.0 and v3.1 specifications,
|
|
9
|
+
* with the ability to automatically generate appropriate schema definitions
|
|
10
|
+
* based on the specified version.
|
|
10
11
|
*
|
|
11
12
|
* The collection includes:
|
|
12
|
-
*
|
|
13
|
+
*
|
|
14
|
+
* - Generated JSON schemas array containing schema definitions for the specified
|
|
15
|
+
* types
|
|
13
16
|
* - Reusable components that can be referenced across different schemas
|
|
14
|
-
* - Version-specific formatting that adheres to either OpenAPI v3.0 or v3.1
|
|
17
|
+
* - Version-specific formatting that adheres to either OpenAPI v3.0 or v3.1
|
|
18
|
+
* standards
|
|
15
19
|
*
|
|
16
20
|
* Key differences between versions:
|
|
17
|
-
* - OpenAPI v3.0: Uses {@link OpenApiV3.IJsonSchema} format with limited tuple support
|
|
18
|
-
* - OpenAPI v3.1: Uses {@link OpenApi.IJsonSchema} format with full JSON Schema Draft 2020-12 compatibility
|
|
19
21
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* back to the source TypeScript definitions.
|
|
22
|
+
* - OpenAPI v3.0: Uses {@link OpenApiV3.IJsonSchema} format with limited tuple
|
|
23
|
+
* support
|
|
24
|
+
* - OpenAPI v3.1: Uses {@link OpenApi.IJsonSchema} format with full JSON Schema
|
|
25
|
+
* Draft 2020-12 compatibility
|
|
25
26
|
*
|
|
27
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
26
28
|
* @example
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
29
|
+
* ```typescript
|
|
30
|
+
* // Generate schemas for OpenAPI v3.1 (default)
|
|
31
|
+
* const schemas = typia.json.schemas<[User, Product]>();
|
|
32
|
+
* // Type: IJsonSchemaCollection<"3.1", [User, Product]>
|
|
31
33
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
34
|
+
* // Generate schemas for OpenAPI v3.0 (Swagger compatibility)
|
|
35
|
+
* const swaggerSchemas = typia.json.schemas<[User, Product], "3.0">();
|
|
36
|
+
* // Type: IJsonSchemaCollection<"3.0", [User, Product]>
|
|
37
|
+
* ```;
|
|
36
38
|
*
|
|
37
|
-
* @
|
|
39
|
+
* @template Version The OpenAPI specification version to target ("3.0" or
|
|
40
|
+
* "3.1"). Defaults to "3.1" for enhanced JSON Schema compatibility.
|
|
41
|
+
* @template Types Array of original TypeScript types that were analyzed to
|
|
42
|
+
* generate the JSON schemas. This provides type safety and traceability back
|
|
43
|
+
* to the source TypeScript definitions.
|
|
38
44
|
*/
|
|
39
45
|
export type IJsonSchemaCollection<
|
|
40
46
|
Version extends "3.0" | "3.1" = "3.1",
|
|
@@ -48,56 +54,61 @@ export namespace IJsonSchemaCollection {
|
|
|
48
54
|
* JSON Schema collection formatted for OpenAPI v3.0 specification.
|
|
49
55
|
*
|
|
50
56
|
* This interface represents a collection of JSON schemas that comply with
|
|
51
|
-
* OpenAPI v3.0 standards, which are compatible with Swagger tools and
|
|
52
|
-
*
|
|
53
|
-
*
|
|
57
|
+
* OpenAPI v3.0 standards, which are compatible with Swagger tools and legacy
|
|
58
|
+
* OpenAPI implementations. OpenAPI v3.0 has some limitations compared to
|
|
59
|
+
* v3.1, particularly around tuple types and pattern properties.
|
|
54
60
|
*
|
|
55
61
|
* Key characteristics of v3.0:
|
|
62
|
+
*
|
|
56
63
|
* - Cannot express tuple types natively (falls back to array representations)
|
|
57
64
|
* - Cannot express pattern properties in object schemas
|
|
58
65
|
* - Uses nullable property instead of union with null type
|
|
59
66
|
* - Limited JSON Schema Draft compatibility (based on Draft 4)
|
|
60
67
|
*
|
|
61
|
-
* @template Types Array of original TypeScript types used to generate the
|
|
62
|
-
*
|
|
63
|
-
*
|
|
68
|
+
* @template Types Array of original TypeScript types used to generate the
|
|
69
|
+
* schemas. This provides compile-time type information about what types
|
|
70
|
+
* were analyzed during schema generation.
|
|
64
71
|
*/
|
|
65
72
|
export interface IV3_0<Types = unknown[]> {
|
|
66
73
|
/**
|
|
67
74
|
* OpenAPI specification version identifier.
|
|
68
75
|
*
|
|
69
|
-
* Always set to "3.0" to indicate this collection uses OpenAPI v3.0
|
|
70
|
-
*
|
|
76
|
+
* Always set to "3.0" to indicate this collection uses OpenAPI v3.0 schema
|
|
77
|
+
* format and constraints.
|
|
71
78
|
*/
|
|
72
79
|
version: "3.0";
|
|
73
80
|
|
|
74
81
|
/**
|
|
75
82
|
* Array of generated JSON schemas.
|
|
76
83
|
*
|
|
77
|
-
* Contains the actual JSON schema definitions generated from the input
|
|
78
|
-
* Each schema in this array corresponds to one of the
|
|
79
|
-
* template parameter. The schemas follow
|
|
80
|
-
* references to components defined in
|
|
84
|
+
* Contains the actual JSON schema definitions generated from the input
|
|
85
|
+
* TypeScript types. Each schema in this array corresponds to one of the
|
|
86
|
+
* types specified in the `Types` template parameter. The schemas follow
|
|
87
|
+
* OpenAPI v3.0 format and may contain references to components defined in
|
|
88
|
+
* the {@link components} property.
|
|
81
89
|
*
|
|
82
|
-
* Schema references typically use the format: `{ "$ref":
|
|
90
|
+
* Schema references typically use the format: `{ "$ref":
|
|
91
|
+
* "#/components/schemas/TypeName" }`
|
|
83
92
|
*/
|
|
84
93
|
schemas: OpenApiV3.IJsonSchema[];
|
|
85
94
|
|
|
86
95
|
/**
|
|
87
96
|
* Reusable schema components for OpenAPI v3.0.
|
|
88
97
|
*
|
|
89
|
-
* Contains reusable schema definitions, security schemes, and other
|
|
90
|
-
* that can be referenced from the main schemas. This follows the
|
|
91
|
-
* components structure and enables schema reuse and
|
|
98
|
+
* Contains reusable schema definitions, security schemes, and other
|
|
99
|
+
* components that can be referenced from the main schemas. This follows the
|
|
100
|
+
* OpenAPI v3.0 components structure and enables schema reuse and
|
|
101
|
+
* modularity.
|
|
92
102
|
*
|
|
93
103
|
* Components include:
|
|
94
|
-
*
|
|
95
|
-
* -
|
|
96
|
-
* -
|
|
97
|
-
* -
|
|
98
|
-
* -
|
|
99
|
-
* -
|
|
100
|
-
* -
|
|
104
|
+
*
|
|
105
|
+
* - Schemas: Named type definitions that can be referenced via $ref
|
|
106
|
+
* - SecuritySchemes: Authentication and authorization schemes
|
|
107
|
+
* - Parameters: Reusable parameter definitions
|
|
108
|
+
* - RequestBodies: Reusable request body definitions
|
|
109
|
+
* - Responses: Reusable response definitions
|
|
110
|
+
* - Headers: Reusable header definitions
|
|
111
|
+
* - Examples: Reusable example definitions
|
|
101
112
|
*/
|
|
102
113
|
components: OpenApiV3.IComponents;
|
|
103
114
|
|
|
@@ -110,6 +121,7 @@ export namespace IJsonSchemaCollection {
|
|
|
110
121
|
* and undefined to prevent it from appearing in serialized JSON output.
|
|
111
122
|
*
|
|
112
123
|
* This enables:
|
|
124
|
+
*
|
|
113
125
|
* - Compile-time type checking against the original types
|
|
114
126
|
* - IDE intellisense and autocompletion
|
|
115
127
|
* - Type-safe schema validation and usage
|
|
@@ -122,26 +134,27 @@ export namespace IJsonSchemaCollection {
|
|
|
122
134
|
*
|
|
123
135
|
* This interface represents a collection of JSON schemas that comply with
|
|
124
136
|
* OpenAPI v3.1 standards, which provide enhanced JSON Schema compatibility
|
|
125
|
-
* and support for modern JSON Schema features. OpenAPI v3.1 is based on
|
|
126
|
-
*
|
|
137
|
+
* and support for modern JSON Schema features. OpenAPI v3.1 is based on JSON
|
|
138
|
+
* Schema Draft 2020-12 and offers significant improvements over v3.0.
|
|
127
139
|
*
|
|
128
140
|
* Key advantages of v3.1:
|
|
141
|
+
*
|
|
129
142
|
* - Full tuple type support with prefixItems
|
|
130
143
|
* - Pattern properties support for dynamic object keys
|
|
131
144
|
* - Proper null type handling via union types
|
|
132
145
|
* - Enhanced JSON Schema Draft 2020-12 compatibility
|
|
133
146
|
* - Better const, enum, and validation support
|
|
134
147
|
*
|
|
135
|
-
* @template Types Array of original TypeScript types used to generate the
|
|
136
|
-
*
|
|
137
|
-
*
|
|
148
|
+
* @template Types Array of original TypeScript types used to generate the
|
|
149
|
+
* schemas. This provides compile-time type information about what types
|
|
150
|
+
* were analyzed during schema generation.
|
|
138
151
|
*/
|
|
139
152
|
export interface IV3_1<Types = unknown[]> {
|
|
140
153
|
/**
|
|
141
154
|
* OpenAPI specification version identifier.
|
|
142
155
|
*
|
|
143
|
-
* Always set to "3.1" to indicate this collection uses OpenAPI v3.1
|
|
144
|
-
*
|
|
156
|
+
* Always set to "3.1" to indicate this collection uses OpenAPI v3.1 schema
|
|
157
|
+
* format with enhanced JSON Schema compatibility.
|
|
145
158
|
*/
|
|
146
159
|
version: "3.1";
|
|
147
160
|
|
|
@@ -149,12 +162,13 @@ export namespace IJsonSchemaCollection {
|
|
|
149
162
|
* Reusable schema components for OpenAPI v3.1.
|
|
150
163
|
*
|
|
151
164
|
* Contains reusable schema definitions and other components following the
|
|
152
|
-
* OpenAPI v3.1 specification. This structure is similar to v3.0 but
|
|
153
|
-
* enhanced JSON Schema features and improved type definitions.
|
|
165
|
+
* OpenAPI v3.1 specification. This structure is similar to v3.0 but
|
|
166
|
+
* supports enhanced JSON Schema features and improved type definitions.
|
|
154
167
|
*
|
|
155
168
|
* Components include:
|
|
156
|
-
*
|
|
157
|
-
* -
|
|
169
|
+
*
|
|
170
|
+
* - Schemas: Named type definitions with enhanced JSON Schema support
|
|
171
|
+
* - SecuritySchemes: Authentication and authorization schemes
|
|
158
172
|
*
|
|
159
173
|
* The emended OpenAPI v3.1 format used here removes ambiguous expressions
|
|
160
174
|
* and standardizes certain patterns for better tooling compatibility.
|
|
@@ -167,6 +181,7 @@ export namespace IJsonSchemaCollection {
|
|
|
167
181
|
* Contains JSON schema definitions that take advantage of OpenAPI v3.1's
|
|
168
182
|
* enhanced capabilities. These schemas can express more complex TypeScript
|
|
169
183
|
* types accurately, including:
|
|
184
|
+
*
|
|
170
185
|
* - Tuple types using prefixItems
|
|
171
186
|
* - Union types with proper null handling
|
|
172
187
|
* - Complex nested object structures
|
|
@@ -182,9 +197,11 @@ export namespace IJsonSchemaCollection {
|
|
|
182
197
|
*
|
|
183
198
|
* This optional property stores the original TypeScript types that were
|
|
184
199
|
* used to generate the JSON schemas. It provides compile-time type safety
|
|
185
|
-
* and enables better development experience without affecting runtime
|
|
200
|
+
* and enables better development experience without affecting runtime
|
|
201
|
+
* behavior.
|
|
186
202
|
*
|
|
187
203
|
* Benefits include:
|
|
204
|
+
*
|
|
188
205
|
* - Strong typing connection to original TypeScript definitions
|
|
189
206
|
* - Enhanced IDE support and autocompletion
|
|
190
207
|
* - Compile-time validation of schema usage
|
|
@@ -3,55 +3,57 @@ import { OpenApi, OpenApiV3 } from "@samchon/openapi";
|
|
|
3
3
|
/**
|
|
4
4
|
* Single unit of JSON schema representation.
|
|
5
5
|
*
|
|
6
|
-
* `IJsonSchemaUnit` represents a self-contained JSON schema unit that
|
|
7
|
-
* a single schema definition along with its associated reusable
|
|
8
|
-
* typically used when generating a JSON schema for a single
|
|
9
|
-
* opposed to a collection of multiple types.
|
|
6
|
+
* `IJsonSchemaUnit` represents a self-contained JSON schema unit that
|
|
7
|
+
* encapsulates a single schema definition along with its associated reusable
|
|
8
|
+
* components. This is typically used when generating a JSON schema for a single
|
|
9
|
+
* TypeScript type, as opposed to a collection of multiple types.
|
|
10
10
|
*
|
|
11
|
-
* Unlike {@link IJsonSchemaCollection} which handles multiple schemas,
|
|
12
|
-
* focuses on representing a single schema with its
|
|
13
|
-
* for scenarios where you need to work with
|
|
14
|
-
* integrating with systems that expect
|
|
11
|
+
* Unlike {@link IJsonSchemaCollection} which handles multiple schemas,
|
|
12
|
+
* `IJsonSchemaUnit` focuses on representing a single schema with its
|
|
13
|
+
* dependencies. This makes it ideal for scenarios where you need to work with
|
|
14
|
+
* individual type definitions or when integrating with systems that expect
|
|
15
|
+
* single schema documents.
|
|
15
16
|
*
|
|
16
17
|
* The unit contains:
|
|
18
|
+
*
|
|
17
19
|
* - A single JSON schema definition for the specified TypeScript type
|
|
18
20
|
* - All necessary reusable components that the schema may reference
|
|
19
21
|
* - Version-specific formatting for either OpenAPI v3.0 or v3.1 compatibility
|
|
20
22
|
* - Optional type metadata for compile-time type safety
|
|
21
23
|
*
|
|
22
24
|
* Key differences from collection:
|
|
25
|
+
*
|
|
23
26
|
* - Contains only one schema instead of an array of schemas
|
|
24
27
|
* - More lightweight for single-type use cases
|
|
25
28
|
* - Simpler structure for direct schema consumption
|
|
26
29
|
* - Still maintains full component reference support
|
|
27
30
|
*
|
|
28
|
-
* @
|
|
29
|
-
* Defaults to "3.1" for enhanced JSON Schema Draft 2020-12 compatibility.
|
|
30
|
-
* This determines the schema format, validation capabilities, and
|
|
31
|
-
* available features like tuple support and null type handling.
|
|
32
|
-
* @template Type The original TypeScript type that was analyzed to generate this
|
|
33
|
-
* JSON schema unit. This provides compile-time type safety and
|
|
34
|
-
* enables IDEs to provide better intellisense and validation.
|
|
35
|
-
*
|
|
31
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
36
32
|
* @example
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
33
|
+
* ```typescript
|
|
34
|
+
* interface User {
|
|
35
|
+
* id: string;
|
|
36
|
+
* name: string;
|
|
37
|
+
* email?: string;
|
|
38
|
+
* }
|
|
43
39
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
40
|
+
* // Generate a single schema unit for OpenAPI v3.1 (default)
|
|
41
|
+
* const userSchema = typia.json.schema<User>();
|
|
42
|
+
* // Type: IJsonSchemaUnit<"3.1", User>
|
|
47
43
|
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
44
|
+
* // Generate a single schema unit for OpenAPI v3.0 (Swagger compatibility)
|
|
45
|
+
* const swaggerUserSchema = typia.json.schema<User, "3.0">();
|
|
46
|
+
* // Type: IJsonSchemaUnit<"3.0", User>
|
|
47
|
+
* ```;
|
|
52
48
|
*
|
|
49
|
+
* @template Version The OpenAPI specification version to target ("3.0" or
|
|
50
|
+
* "3.1"). Defaults to "3.1" for enhanced JSON Schema Draft 2020-12
|
|
51
|
+
* compatibility. This determines the schema format, validation capabilities,
|
|
52
|
+
* and available features like tuple support and null type handling.
|
|
53
|
+
* @template Type The original TypeScript type that was analyzed to generate
|
|
54
|
+
* this JSON schema unit. This provides compile-time type safety and enables
|
|
55
|
+
* IDEs to provide better intellisense and validation.
|
|
53
56
|
* @see {@link IJsonSchemaCollection} For handling multiple schemas at once
|
|
54
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
55
57
|
*/
|
|
56
58
|
export type IJsonSchemaUnit<
|
|
57
59
|
Version extends "3.0" | "3.1" = "3.1",
|
|
@@ -65,11 +67,12 @@ export namespace IJsonSchemaUnit {
|
|
|
65
67
|
* JSON Schema unit formatted for OpenAPI v3.0 specification.
|
|
66
68
|
*
|
|
67
69
|
* This interface represents a single JSON schema unit that complies with
|
|
68
|
-
* OpenAPI v3.0 standards. It contains one schema definition along with
|
|
69
|
-
*
|
|
70
|
-
*
|
|
70
|
+
* OpenAPI v3.0 standards. It contains one schema definition along with any
|
|
71
|
+
* reusable components that the schema references, formatted according to
|
|
72
|
+
* OpenAPI v3.0 constraints and limitations.
|
|
71
73
|
*
|
|
72
74
|
* OpenAPI v3.0 characteristics affecting this unit:
|
|
75
|
+
*
|
|
73
76
|
* - Schema follows OpenAPI v3.0 JSON Schema subset
|
|
74
77
|
* - Limited support for advanced JSON Schema features
|
|
75
78
|
* - Uses nullable property for optional null values
|
|
@@ -77,33 +80,35 @@ export namespace IJsonSchemaUnit {
|
|
|
77
80
|
* - Based on JSON Schema Draft 4 with OpenAPI-specific extensions
|
|
78
81
|
*
|
|
79
82
|
* Use cases for v3.0:
|
|
83
|
+
*
|
|
80
84
|
* - Integration with legacy Swagger tooling
|
|
81
85
|
* - Compatibility with older OpenAPI implementations
|
|
82
86
|
* - Systems that specifically require OpenAPI v3.0 format
|
|
83
87
|
* - Code generation tools that expect v3.0 schemas
|
|
84
88
|
*
|
|
85
|
-
* @template Type The original TypeScript type represented by this schema
|
|
86
|
-
*
|
|
87
|
-
*
|
|
89
|
+
* @template Type The original TypeScript type represented by this schema
|
|
90
|
+
* unit. Provides compile-time type information and enables type-safe
|
|
91
|
+
* operations on the schema.
|
|
88
92
|
*/
|
|
89
93
|
export interface IV3_0<Type> {
|
|
90
94
|
/**
|
|
91
95
|
* OpenAPI specification version identifier.
|
|
92
96
|
*
|
|
93
|
-
* Always set to "3.0" to indicate this schema unit uses OpenAPI v3.0
|
|
94
|
-
*
|
|
97
|
+
* Always set to "3.0" to indicate this schema unit uses OpenAPI v3.0 format
|
|
98
|
+
* and adheres to its specific constraints and limitations.
|
|
95
99
|
*/
|
|
96
100
|
version: "3.0";
|
|
97
101
|
|
|
98
102
|
/**
|
|
99
103
|
* The primary JSON schema definition.
|
|
100
104
|
*
|
|
101
|
-
* Contains the main JSON schema that represents the TypeScript type
|
|
102
|
-
* in the `Type` template parameter. This schema follows OpenAPI
|
|
103
|
-
* and may contain references to reusable components defined in
|
|
104
|
-
* {@link components} property.
|
|
105
|
+
* Contains the main JSON schema that represents the TypeScript type
|
|
106
|
+
* specified in the `Type` template parameter. This schema follows OpenAPI
|
|
107
|
+
* v3.0 format and may contain references to reusable components defined in
|
|
108
|
+
* the {@link components} property.
|
|
105
109
|
*
|
|
106
110
|
* The schema structure includes:
|
|
111
|
+
*
|
|
107
112
|
* - Type definitions following OpenAPI v3.0 constraints
|
|
108
113
|
* - Property definitions with v3.0-compatible validation rules
|
|
109
114
|
* - References to shared components using $ref syntax
|
|
@@ -122,13 +127,14 @@ export namespace IJsonSchemaUnit {
|
|
|
122
127
|
* within the schema definition.
|
|
123
128
|
*
|
|
124
129
|
* Component categories include:
|
|
125
|
-
*
|
|
126
|
-
* -
|
|
127
|
-
* -
|
|
128
|
-
* -
|
|
129
|
-
* -
|
|
130
|
-
* -
|
|
131
|
-
* -
|
|
130
|
+
*
|
|
131
|
+
* - Schemas: Named type definitions for complex objects, arrays, and unions
|
|
132
|
+
* - SecuritySchemes: Authentication and authorization definitions
|
|
133
|
+
* - Parameters: Reusable parameter specifications
|
|
134
|
+
* - RequestBodies: Reusable request body definitions
|
|
135
|
+
* - Responses: Reusable response specifications
|
|
136
|
+
* - Headers: Reusable header definitions
|
|
137
|
+
* - Examples: Reusable example values
|
|
132
138
|
*
|
|
133
139
|
* All components follow OpenAPI v3.0 format restrictions and capabilities.
|
|
134
140
|
*/
|
|
@@ -142,14 +148,15 @@ export namespace IJsonSchemaUnit {
|
|
|
142
148
|
* type information without affecting the runtime JSON representation.
|
|
143
149
|
*
|
|
144
150
|
* Benefits of type metadata:
|
|
151
|
+
*
|
|
145
152
|
* - Enables type-safe schema validation and usage
|
|
146
153
|
* - Provides IDE intellisense and autocompletion
|
|
147
154
|
* - Allows compile-time checking of schema operations
|
|
148
155
|
* - Maintains traceability to original TypeScript definitions
|
|
149
156
|
*
|
|
150
157
|
* The property is intentionally marked as optional and undefined to ensure
|
|
151
|
-
* it doesn't appear in serialized JSON output while preserving type
|
|
152
|
-
* at compile time.
|
|
158
|
+
* it doesn't appear in serialized JSON output while preserving type
|
|
159
|
+
* information at compile time.
|
|
153
160
|
*/
|
|
154
161
|
__type?: Type | undefined;
|
|
155
162
|
}
|
|
@@ -157,12 +164,13 @@ export namespace IJsonSchemaUnit {
|
|
|
157
164
|
/**
|
|
158
165
|
* JSON Schema unit formatted for OpenAPI v3.1 specification.
|
|
159
166
|
*
|
|
160
|
-
* This interface represents a single JSON schema unit that takes advantage
|
|
161
|
-
*
|
|
162
|
-
* It provides a more feature-rich and accurate representation
|
|
163
|
-
* types compared to the v3.0 format.
|
|
167
|
+
* This interface represents a single JSON schema unit that takes advantage of
|
|
168
|
+
* OpenAPI v3.1's enhanced capabilities and improved JSON Schema
|
|
169
|
+
* compatibility. It provides a more feature-rich and accurate representation
|
|
170
|
+
* of TypeScript types compared to the v3.0 format.
|
|
164
171
|
*
|
|
165
172
|
* OpenAPI v3.1 advantages for this unit:
|
|
173
|
+
*
|
|
166
174
|
* - Full JSON Schema Draft 2020-12 compatibility
|
|
167
175
|
* - Native tuple type support using prefixItems
|
|
168
176
|
* - Proper null type handling via union types
|
|
@@ -171,21 +179,22 @@ export namespace IJsonSchemaUnit {
|
|
|
171
179
|
* - Better support for complex nested structures
|
|
172
180
|
*
|
|
173
181
|
* Use cases for v3.1:
|
|
182
|
+
*
|
|
174
183
|
* - Modern OpenAPI implementations and tooling
|
|
175
184
|
* - Systems requiring accurate TypeScript type representation
|
|
176
185
|
* - Applications needing advanced JSON Schema features
|
|
177
186
|
* - New projects without legacy compatibility requirements
|
|
178
187
|
*
|
|
179
|
-
* @template Type The original TypeScript type represented by this schema
|
|
180
|
-
*
|
|
181
|
-
*
|
|
188
|
+
* @template Type The original TypeScript type represented by this schema
|
|
189
|
+
* unit. Enables compile-time type safety and provides enhanced development
|
|
190
|
+
* experience with better IDE support.
|
|
182
191
|
*/
|
|
183
192
|
export interface IV3_1<Type> {
|
|
184
193
|
/**
|
|
185
194
|
* OpenAPI specification version identifier.
|
|
186
195
|
*
|
|
187
|
-
* Always set to "3.1" to indicate this schema unit uses OpenAPI v3.1
|
|
188
|
-
*
|
|
196
|
+
* Always set to "3.1" to indicate this schema unit uses OpenAPI v3.1 format
|
|
197
|
+
* with enhanced JSON Schema compatibility and modern features.
|
|
189
198
|
*/
|
|
190
199
|
version: "3.1";
|
|
191
200
|
|
|
@@ -194,9 +203,11 @@ export namespace IJsonSchemaUnit {
|
|
|
194
203
|
*
|
|
195
204
|
* Contains the main JSON schema that accurately represents the TypeScript
|
|
196
205
|
* type using OpenAPI v3.1's enhanced capabilities. This schema can express
|
|
197
|
-
* complex TypeScript constructs that were not possible or accurate in
|
|
206
|
+
* complex TypeScript constructs that were not possible or accurate in
|
|
207
|
+
* v3.0.
|
|
198
208
|
*
|
|
199
209
|
* Enhanced schema features include:
|
|
210
|
+
*
|
|
200
211
|
* - Tuple types using prefixItems for exact array structure
|
|
201
212
|
* - Union types with proper null handling via oneOf
|
|
202
213
|
* - Const values for literal types
|
|
@@ -204,21 +215,22 @@ export namespace IJsonSchemaUnit {
|
|
|
204
215
|
* - Advanced validation constraints and metadata
|
|
205
216
|
* - Recursive type definitions with proper $ref handling
|
|
206
217
|
*
|
|
207
|
-
* The schema follows the emended OpenAPI v3.1 format used by typia,
|
|
208
|
-
*
|
|
218
|
+
* The schema follows the emended OpenAPI v3.1 format used by typia, which
|
|
219
|
+
* removes ambiguous expressions while maintaining full compatibility.
|
|
209
220
|
*/
|
|
210
221
|
schema: OpenApi.IJsonSchema;
|
|
211
222
|
|
|
212
223
|
/**
|
|
213
224
|
* Reusable schema components for OpenAPI v3.1.
|
|
214
225
|
*
|
|
215
|
-
* Contains reusable schema definitions and components that leverage
|
|
216
|
-
*
|
|
217
|
-
*
|
|
226
|
+
* Contains reusable schema definitions and components that leverage OpenAPI
|
|
227
|
+
* v3.1's enhanced capabilities. These components provide better type
|
|
228
|
+
* representation and more accurate schema definitions compared to v3.0.
|
|
218
229
|
*
|
|
219
230
|
* Enhanced component features:
|
|
220
|
-
*
|
|
221
|
-
* -
|
|
231
|
+
*
|
|
232
|
+
* - Schemas: More accurate type definitions with v3.1 JSON Schema features
|
|
233
|
+
* - SecuritySchemes: Enhanced authentication scheme definitions
|
|
222
234
|
* - Better support for complex nested references
|
|
223
235
|
* - Improved handling of recursive and circular type dependencies
|
|
224
236
|
*
|
|
@@ -232,10 +244,11 @@ export namespace IJsonSchemaUnit {
|
|
|
232
244
|
*
|
|
233
245
|
* This optional property preserves the original TypeScript type information
|
|
234
246
|
* for compile-time type checking and enhanced development experience. It
|
|
235
|
-
* enables type-safe operations and better IDE support without affecting
|
|
236
|
-
*
|
|
247
|
+
* enables type-safe operations and better IDE support without affecting the
|
|
248
|
+
* runtime JSON schema representation.
|
|
237
249
|
*
|
|
238
250
|
* Enhanced type safety features:
|
|
251
|
+
*
|
|
239
252
|
* - Strong typing connection to original TypeScript definitions
|
|
240
253
|
* - Better IDE intellisense and error detection
|
|
241
254
|
* - Compile-time validation of schema usage patterns
|