|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 2 weeks ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
474 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | module.exports = function defFunc(ajv) {
|
|---|
| 4 | defFunc.definition = {
|
|---|
| 5 | type: 'object',
|
|---|
| 6 | macro: function (schema, parentSchema) {
|
|---|
| 7 | if (!schema) return true;
|
|---|
| 8 | var properties = Object.keys(parentSchema.properties);
|
|---|
| 9 | if (properties.length == 0) return true;
|
|---|
| 10 | return {required: properties};
|
|---|
| 11 | },
|
|---|
| 12 | metaSchema: {type: 'boolean'},
|
|---|
| 13 | dependencies: ['properties']
|
|---|
| 14 | };
|
|---|
| 15 |
|
|---|
| 16 | ajv.addKeyword('allRequired', defFunc.definition);
|
|---|
| 17 | return ajv;
|
|---|
| 18 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.