mirror of
https://github.com/ditkrg/dit-json-schema-extended-specifications.git
synced 2026-01-22 22:36:40 +00:00
First commit
This commit is contained in:
commit
2f8c309b13
38
README.md
Normal file
38
README.md
Normal file
@ -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"]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user