typia icon indicating copy to clipboard operation
typia copied to clipboard

Is There a Way to Get the Standard JSON Schema?

Open uanid opened this issue 10 months ago • 1 comments

Hello,

According to the documentation, using typia.json.schema() should return a JSON Schema, but I have confirmed that it returns an OpenAPI V3 document instead.

Although OpenAPI was developed based on JSON Schema Draft 04, it includes additional features such as nullable—which are not supported by JSON Schema validators—making it challenging to use with standard JSON Schema validations.

I really appreciate the functionality of typia, and I think it would be great if typia could support both OpenAPI and JSON Schema.

uanid avatar Apr 18 '25 06:04 uanid

typia.json.schema<T>() function returns OpenApi.IJsonSchema type, a specification of 2020-12 draft.

The OpenAPI v3 schema is returned only when you configure like typia.json.schema<T, "3.0">().

samchon avatar Apr 18 '25 06:04 samchon