|
6 | 6 | const Ajv = require('ajv'); |
7 | 7 |
|
8 | 8 | const endpointDeclarationSchema = |
9 | | -{"$schema": "http://json-schema.org/draft-07/schema#", |
10 | | - "title": "MarkLogic Endpoint Function Declaration", |
11 | | - "$comment": "SIMPLIFIED TO THE STABLE DECLARATIONS USED FOR CODE GENERATION", |
12 | | - "type": "object", |
13 | | - "definitions": { |
14 | | - "desc": { |
15 | | - "type":"string", "description":"Documentation about the property" |
| 9 | +{'$schema': 'http://json-schema.org/draft-07/schema#', |
| 10 | + 'title': 'MarkLogic Endpoint Function Declaration', |
| 11 | + '$comment': 'SIMPLIFIED TO THE STABLE DECLARATIONS USED FOR CODE GENERATION', |
| 12 | + 'type': 'object', |
| 13 | + 'definitions': { |
| 14 | + 'desc': { |
| 15 | + 'type':'string', 'description':'Documentation about the property' |
16 | 16 | }, |
17 | | - "datatype": { |
18 | | - "type":"string", "description":"The type of the value", |
19 | | - "enum":[ |
20 | | - "boolean", "date", "dateTime", "dayTimeDuration", "decimal", "double", "float", |
21 | | - "int", "long", "string", "time", "unsignedInt", "unsignedLong", |
22 | | - "array", "object", |
23 | | - "binaryDocument", "jsonDocument", "textDocument", "xmlDocument", |
24 | | - "session" |
| 17 | + 'datatype': { |
| 18 | + 'type':'string', 'description':'The type of the value', |
| 19 | + 'enum':[ |
| 20 | + 'boolean', 'date', 'dateTime', 'dayTimeDuration', 'decimal', 'double', 'float', |
| 21 | + 'int', 'long', 'string', 'time', 'unsignedInt', 'unsignedLong', |
| 22 | + 'array', 'object', |
| 23 | + 'binaryDocument', 'jsonDocument', 'textDocument', 'xmlDocument', |
| 24 | + 'session' |
25 | 25 | ] |
26 | 26 | }, |
27 | | - "nullable": { |
28 | | - "type":"boolean", "description":"Whether a null value is allowed", |
29 | | - "default":false |
| 27 | + 'nullable': { |
| 28 | + 'type':'boolean', 'description':'Whether a null value is allowed', |
| 29 | + 'default':false |
30 | 30 | }, |
31 | | - "multiple": { |
32 | | - "type":"boolean", "description":"Whether multiple values are allowed", |
33 | | - "default":false |
| 31 | + 'multiple': { |
| 32 | + 'type':'boolean', 'description':'Whether multiple values are allowed', |
| 33 | + 'default':false |
34 | 34 | } |
35 | 35 | // "$comment": "SIMPLIFIED BY DELETING doubleMeter, doubleLiteral, ulMeter, AND unsignedLongLiteral" |
36 | 36 | }, |
37 | | - "propertyNames": { |
| 37 | + 'propertyNames': { |
38 | 38 | // "$comment": "MODIFIED TO ALLOW FOR PROPERTIES DELETED DURING SIMPLIFICATION OR ADDED IN LATER RELEASES", |
39 | | - "pattern": "^\\$?[A-Za-z_][\\w.-]*$" |
| 39 | + 'pattern': '^\\$?[A-Za-z_][\\w.-]*$' |
40 | 40 | }, |
41 | | - "properties": { |
42 | | - "functionName": { |
43 | | - "type":"string", "description":"The name of a database function provided by a service declared by service.json" |
| 41 | + 'properties': { |
| 42 | + 'functionName': { |
| 43 | + 'type':'string', 'description':'The name of a database function provided by a service declared by service.json' |
44 | 44 | }, |
45 | | - "endpoint": { |
46 | | - "type":"string", "description":"The full path name of a standalone bulk IO endpoint" |
| 45 | + 'endpoint': { |
| 46 | + 'type':'string', 'description':'The full path name of a standalone bulk IO endpoint' |
47 | 47 | }, |
48 | | - "desc": {"$ref":"#/definitions/desc"}, |
49 | | - "params": { |
50 | | - "type":"array", "description":"The parameters of the function", |
51 | | - "items": { |
52 | | - "type":"object", |
53 | | - "required": ["name", "datatype"], |
54 | | - "propertyNames": { |
55 | | - "pattern": "^(\\$[A-Za-z_][\\w.-]*|name|desc|datatype|nullable|multiple)$" |
| 48 | + 'desc': {'$ref':'#/definitions/desc'}, |
| 49 | + 'params': { |
| 50 | + 'type':'array', 'description':'The parameters of the function', |
| 51 | + 'items': { |
| 52 | + 'type':'object', |
| 53 | + 'required': ['name', 'datatype'], |
| 54 | + 'propertyNames': { |
| 55 | + 'pattern': '^(\\$[A-Za-z_][\\w.-]*|name|desc|datatype|nullable|multiple)$' |
56 | 56 | }, |
57 | | - "properties": { |
58 | | - "name": { |
59 | | - "type":"string", "description":"The name of the function parameter" |
| 57 | + 'properties': { |
| 58 | + 'name': { |
| 59 | + 'type':'string', 'description':'The name of the function parameter' |
60 | 60 | }, |
61 | | - "desc": {"$ref":"#/definitions/desc"}, |
62 | | - "datatype": {"$ref":"#/definitions/datatype"}, |
63 | | - "nullable": {"$ref":"#/definitions/nullable"}, |
64 | | - "multiple": {"$ref":"#/definitions/multiple"} |
| 61 | + 'desc': {'$ref':'#/definitions/desc'}, |
| 62 | + 'datatype': {'$ref':'#/definitions/datatype'}, |
| 63 | + 'nullable': {'$ref':'#/definitions/nullable'}, |
| 64 | + 'multiple': {'$ref':'#/definitions/multiple'} |
65 | 65 | } |
66 | 66 | } |
67 | 67 | }, |
68 | | - "return": { |
69 | | - "type":"object", "description":"The return value of the function", |
70 | | - "required": ["datatype"], |
71 | | - "propertyNames": { |
72 | | - "pattern": "^(\\$[A-Za-z_][\\w.-]*|desc|datatype|nullable|multiple)$" |
| 68 | + 'return': { |
| 69 | + 'type':'object', 'description':'The return value of the function', |
| 70 | + 'required': ['datatype'], |
| 71 | + 'propertyNames': { |
| 72 | + 'pattern': '^(\\$[A-Za-z_][\\w.-]*|desc|datatype|nullable|multiple)$' |
73 | 73 | }, |
74 | | - "properties": { |
75 | | - "desc": {"$ref":"#/definitions/desc"}, |
76 | | - "datatype": {"$ref":"#/definitions/datatype"}, |
77 | | - "nullable": {"$ref":"#/definitions/nullable"}, |
78 | | - "multiple": {"$ref":"#/definitions/multiple"} |
| 74 | + 'properties': { |
| 75 | + 'desc': {'$ref':'#/definitions/desc'}, |
| 76 | + 'datatype': {'$ref':'#/definitions/datatype'}, |
| 77 | + 'nullable': {'$ref':'#/definitions/nullable'}, |
| 78 | + 'multiple': {'$ref':'#/definitions/multiple'} |
79 | 79 | } |
80 | 80 | } |
81 | 81 | // "$comment": "SIMPLIFIED BY DELETING errorDetail AND monitoring" |
|
0 commit comments