Skip to content

Commit

Permalink
add jsdoc to json schema relation type
Browse files Browse the repository at this point in the history
  • Loading branch information
foyarash committed Oct 3, 2024
1 parent 31d768a commit 3386985
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion packages/json-schema/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { JSONSchema7Definition, JSONSchema7 } from "json-schema";
import type { JSONSchema7 } from "json-schema";

export type NextAdminJsonSchemaDataType =
| "BigInt"
Expand All @@ -13,9 +13,29 @@ export type NextAdminJsonSchemaDataType =

export type NextAdminJsonSchemaRelation = {
$ref: string;
/**
* The relation field name in the distant object
*
* Example: posts
*/
fromField: string;
/**
* The db relation field name in the current object
*
* Example: author_id
*/
fromFieldDbName?: string;
/**
* The relation field name in the current object
*
* Example: posts
*/
toField: string;
/**
* The db relation field name in the distant object
*
* Example: id
*/
toFieldDbName?: string;
};

Expand Down

0 comments on commit 3386985

Please sign in to comment.