From 2f8c309b1391a2ecf498ed79916c8e3b9d15862e Mon Sep 17 00:00:00 2001 From: Brusk Awat Date: Wed, 15 Jun 2022 15:41:13 +0300 Subject: [PATCH] First commit --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..49377e7 --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +# JSON Schema Extended Directives: + +The DIT extension for JSON Schema is an effort to make more JSON Schema-based forms even more dynamic. These specifications are tailored for DIT's needs and will be extended even further as the development team sees fit. + +## Baseline + +1. Custom directives goes into the field ***__metadata*** +2. The field ***__metadata*** sits next to the standard JSON Schema field definitions such as *type* and *enum* +3. All custom directives names start with double underdashes, including the field ***__metadata*** + +## List of Directives + +| Directive Name | Data Type | Description | Consumed by | Complementary Directive | +| --------------- | ------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ----------------------- | +| __isUpload | boolean | Used to indicate that a field is an upload field | **API** for pre-signature. Client for loading the upload aread | | +| __labels | Object (Appendix 1) | Used to hold localization data | **Client** uses to display | | +| __enumFrom | String | Used to indicate where enum data comes from | **Client** to create an enum for the specified field in real-time while the other fields with the selector of "enumFrom"are being filled out. | __enumFor | +| __enumFor | String | Used to indicate where enum data goes to | **Client** as a source of enum data for any field that has the selector "enumFor". Used in conjunction with __enumFrom | __enumFrom | +| __validationApi | String | Used to indicate that the field needs to be validated by an external API. The value of the field is the URL to the API. | **APIs** to make HTTP calls to the external APIs. | | + + + + + +## Appendices + +### Appendix 1 + +```json +{ + ckb: { type: "string" }, + ar: { type: "string" }, + en: { type: "string" }, + nkb: { type: "string" }, + required: ["ckb", "ar", "en"] +} +``` +