-
Notifications
You must be signed in to change notification settings - Fork 3
/
function_schema.yml
185 lines (185 loc) · 3.97 KB
/
function_schema.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
---
$schema: 'https://json-schema.org/draft/2020-12/schema'
$id: 'https://jmespath.site/function_schema.yml'
title: JMESPath function
description: JMESPath function definition and tests
$defs:
unnamed_arg: &unnamed_arg
type: object
properties:
type: &type
description: ""
oneOf:
- enum: &types
- any
- number
- string
- boolean
- array
- object
- "null"
- expression
- "array[number]"
- "array[string]"
- "array[boolean]"
- "array[object]"
- "array[any]"
- "array[array[any]]"
- expression->any
- expression->number
- expression->string
- type: array
items:
enum: *types
desc:
type: string
description: ""
type: object
required:
- name
- topic
- args
- returns
- desc
- examples
properties:
name:
type: string
description: function identifier
topic:
$ref: '#/definitions/topics'
description: related function topic
args:
type: object
additionalProperties: false
properties:
required:
$ref: '#/definitions/arguments'
description: required function arguments
optional:
$ref: '#/definitions/arguments'
description: optional function arguments
variadic:
$ref: '#/definitions/signature'
description: variadic arguments type
returns:
$ref: '#/definitions/returnValue'
description: function return type
desc:
type: string
description: description
examples:
$ref: '#/definitions/example'
definitions:
argument:
allOf:
- $ref: '#/definitions/signature'
- type: object
required:
- name
properties:
name:
type: string
unevaluatedProperties: false
arguments:
type: array
items:
$ref: '#/definitions/argument'
dataTypes:
type: string
enum:
- any
- number
- string
- boolean
- array
- object
- 'null'
- expression
- 'array[number]'
- 'array[string]'
- 'array[boolean]'
- 'array[object]'
- 'array[any]'
- 'array[array[any]]'
- expression->any
- expression->number
- expression->string
errors:
type: string
enum:
- invalid-arity
- invalid-value
- invalid-type
- not-a-number
- syntax
- unknown-function
example:
type: object
description: example
minProperties: 1
patternProperties:
^\w.*$:
description: example
oneOf:
- $ref: '#/definitions/exampleFailure'
- $ref: '#/definitions/exampleSuccess'
unevaluatedProperties: false
exampleInput:
type: object
required:
- args
- context
properties:
context:
description: given input JSON document
args:
type: array
description: function arguments
items:
description: ''
comment:
description: comment
exampleFailure:
allOf:
- $ref: '#/definitions/exampleInput'
- type: object
required:
- error
properties:
error:
$ref: '#/definitions/errors'
exampleSuccess:
allOf:
- $ref: '#/definitions/exampleInput'
- type: object
required:
- returns
properties:
returns: {}
returnValue:
$ref: '#/definitions/signature'
unevaluatedProperties: false
signature:
type: object
required:
- type
properties:
type:
description: ''
oneOf:
- $ref: '#/definitions/dataTypes'
- type: array
items:
$ref: '#/definitions/dataTypes'
desc:
type: string
description: ''
topics:
type: string
enum:
- math
- strings
- collections
- conversion
- misc