Skip to content

Commit

Permalink
Complement #633 - IJsonSchema.description to be undefined when zero…
Browse files Browse the repository at this point in the history
… length
  • Loading branch information
samchon committed May 19, 2023
1 parent bfd5488 commit f168828
Show file tree
Hide file tree
Showing 232 changed files with 5 additions and 4,961 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typia",
"version": "4.0.0-dev.20230519-3",
"version": "4.0.0-dev.20230520",
"description": "Superfast runtime validators with only one line",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/typescript-json/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typescript-json",
"version": "4.0.0-dev.20230519-3",
"version": "4.0.0-dev.20230520",
"description": "Superfast runtime validators with only one line",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down Expand Up @@ -64,7 +64,7 @@
},
"homepage": "https://typia.io",
"dependencies": {
"typia": "4.0.0-dev.20230519-3"
"typia": "4.0.0-dev.20230520"
},
"peerDependencies": {
"typescript": ">= 4.5.2"
Expand Down
3 changes: 2 additions & 1 deletion src/utils/TsSymbolUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export namespace TsSymbolUtil {
const text: string = TsNodeUtil.getSourceFile(tsc)(
node,
).text.substring(range.pos, range.end);
return transform(text).join("\n");
const output: string = transform(text).join("\n");
return output.length ? output : undefined;
};

export const getCommentTags =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,172 +17,143 @@ export const test_application_ajv_ArrayAny = _test_application("ajv")(
type: "object",
properties: {
anys: {
description: "",
"x-typia-required": true,
"x-typia-optional": false,
type: "array",
items: {
description: "",
"x-typia-required": true,
"x-typia-optional": false,
},
},
undefindable1: {
description: "",
"x-typia-required": false,
"x-typia-optional": false,
type: "array",
items: {
description: "",
"x-typia-required": false,
"x-typia-optional": false,
},
},
undefindable2: {
description: "",
"x-typia-required": false,
"x-typia-optional": false,
type: "array",
items: {
description: "",
"x-typia-required": false,
"x-typia-optional": false,
},
},
nullables1: {
oneOf: [
{
description: "",
"x-typia-required": true,
"x-typia-optional": false,
type: "null",
},
{
description: "",
"x-typia-required": true,
"x-typia-optional": false,
type: "array",
items: {
description: "",
"x-typia-required": true,
"x-typia-optional": false,
},
},
],
description: "",
"x-typia-required": true,
"x-typia-optional": false,
},
nullables2: {
oneOf: [
{
description: "",
"x-typia-required": true,
"x-typia-optional": false,
type: "null",
},
{
description: "",
"x-typia-required": true,
"x-typia-optional": false,
type: "array",
items: {
description: "",
"x-typia-required": true,
"x-typia-optional": false,
},
},
],
description: "",
"x-typia-required": true,
"x-typia-optional": false,
},
both1: {
oneOf: [
{
description: "",
"x-typia-required": false,
"x-typia-optional": false,
type: "null",
},
{
description: "",
"x-typia-required": false,
"x-typia-optional": false,
type: "array",
items: {
description: "",
"x-typia-required": false,
"x-typia-optional": false,
},
},
],
description: "",
"x-typia-required": false,
"x-typia-optional": false,
},
both2: {
oneOf: [
{
description: "",
"x-typia-required": false,
"x-typia-optional": false,
type: "null",
},
{
description: "",
"x-typia-required": false,
"x-typia-optional": false,
type: "array",
items: {
description: "",
"x-typia-required": false,
"x-typia-optional": false,
},
},
],
description: "",
"x-typia-required": false,
"x-typia-optional": false,
},
both3: {
oneOf: [
{
description: "",
"x-typia-required": false,
"x-typia-optional": false,
type: "null",
},
{
description: "",
"x-typia-required": false,
"x-typia-optional": false,
type: "array",
items: {
description: "",
"x-typia-required": false,
"x-typia-optional": false,
},
},
],
description: "",
"x-typia-required": false,
"x-typia-optional": false,
},
union: {
description: "",
"x-typia-required": true,
"x-typia-optional": false,
type: "array",
items: {
description: "",
"x-typia-required": true,
"x-typia-optional": false,
},
},
},
required: ["anys", "nullables1", "nullables2", "union"],
description: "",
"x-typia-jsDocTags": [],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,31 @@ export const test_application_ajv_ArrayHierarchical = _test_application("ajv")(
type: "object",
properties: {
id: {
description: "",
"x-typia-required": true,
"x-typia-optional": false,
type: "number",
},
serial: {
description: "",
"x-typia-required": true,
"x-typia-optional": false,
type: "number",
},
name: {
description: "",
"x-typia-required": true,
"x-typia-optional": false,
type: "string",
},
established_at: {
$ref: "#/components/schemas/ArrayHierarchical.ITimestamp",
description: "",
"x-typia-required": true,
"x-typia-optional": false,
},
departments: {
description: "",
"x-typia-required": true,
"x-typia-optional": false,
type: "array",
items: {
$ref: "#/components/schemas/ArrayHierarchical.IDepartment",
description: "",
"x-typia-required": true,
"x-typia-optional": false,
},
Expand All @@ -63,66 +57,56 @@ export const test_application_ajv_ArrayHierarchical = _test_application("ajv")(
"established_at",
"departments",
],
description: "",
"x-typia-jsDocTags": [],
},
"ArrayHierarchical.ITimestamp": {
$id: "#/components/schemas/ArrayHierarchical.ITimestamp",
type: "object",
properties: {
time: {
description: "",
"x-typia-required": true,
"x-typia-optional": false,
type: "number",
},
zone: {
description: "",
"x-typia-required": true,
"x-typia-optional": false,
type: "number",
},
},
required: ["time", "zone"],
description: "",
"x-typia-jsDocTags": [],
},
"ArrayHierarchical.IDepartment": {
$id: "#/components/schemas/ArrayHierarchical.IDepartment",
type: "object",
properties: {
id: {
description: "",
"x-typia-required": true,
"x-typia-optional": false,
type: "number",
},
code: {
description: "",
"x-typia-required": true,
"x-typia-optional": false,
type: "string",
},
sales: {
description: "",
"x-typia-required": true,
"x-typia-optional": false,
type: "number",
},
created_at: {
$ref: "#/components/schemas/ArrayHierarchical.ITimestamp",
description: "",
"x-typia-required": true,
"x-typia-optional": false,
},
employees: {
description: "",
"x-typia-required": true,
"x-typia-optional": false,
type: "array",
items: {
$ref: "#/components/schemas/ArrayHierarchical.IEmployee",
description: "",
"x-typia-required": true,
"x-typia-optional": false,
},
Expand All @@ -135,46 +119,39 @@ export const test_application_ajv_ArrayHierarchical = _test_application("ajv")(
"created_at",
"employees",
],
description: "",
"x-typia-jsDocTags": [],
},
"ArrayHierarchical.IEmployee": {
$id: "#/components/schemas/ArrayHierarchical.IEmployee",
type: "object",
properties: {
id: {
description: "",
"x-typia-required": true,
"x-typia-optional": false,
type: "number",
},
name: {
description: "",
"x-typia-required": true,
"x-typia-optional": false,
type: "string",
},
age: {
description: "",
"x-typia-required": true,
"x-typia-optional": false,
type: "number",
},
grade: {
description: "",
"x-typia-required": true,
"x-typia-optional": false,
type: "number",
},
employeed_at: {
$ref: "#/components/schemas/ArrayHierarchical.ITimestamp",
description: "",
"x-typia-required": true,
"x-typia-optional": false,
},
},
required: ["id", "name", "age", "grade", "employeed_at"],
description: "",
"x-typia-jsDocTags": [],
},
},
Expand Down
Loading

0 comments on commit f168828

Please sign in to comment.