/
appng-openapi.yaml
984 lines (983 loc) · 27.9 KB
/
appng-openapi.yaml
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
openapi: 3.0.1
info:
version: 1.0.0
title: appNG REST API
description: The REST API for appNG
contact:
name: appNG developer team
email: matthias.mueller@appng.org
url: http://appng.org
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0
security:
- appNGCookie: []
paths:
"/service/{site}/{application}/rest/openapi/navigation":
get:
tags:
- appNG
operationId: getNavigation
parameters:
- in: path
name: site
description: the site to call
required: true
schema:
type: string
- in: path
name: application
description: the application to call
required: true
schema:
type: string
responses:
"200":
description: datasource response
content:
application/json:
schema:
$ref: "#/components/schemas/Navigation"
"/service/{site}/{application}/rest/openapi/page/{id}/{pageUrlParams}":
get:
tags:
- appNG
operationId: getPageWithUrlParams
parameters:
- in: path
name: site
description: the site to call
required: true
schema:
type: string
- in: path
name: application
description: the application to call
required: true
schema:
type: string
- in: path
name: id
description: the ID of the page
required: true
schema:
type: string
- in: path
name: pageUrlParams
description: the URL path to parametrize the page with.
required: true
schema:
type: string
- in: query
name: _sect
description: a list of section IDs to fill
required: false
schema:
type: array
items:
type: string
responses:
"200":
description: datasource response
content:
application/json:
schema:
$ref: "#/components/schemas/PageDefinition"
"/service/{site}/{application}/rest/openapi/datasource/{id}/{params}":
get:
tags:
- appNG
description: Returns a datasource by id
operationId: getDatasource
parameters:
- in: path
name: site
description: the site to call
required: true
schema:
type: string
- in: path
name: application
description: the application to call
required: true
schema:
type: string
- in: path
name: id
description: The id of the datasource.
schema:
type: string
required: true
- in: path
name: params
description: |
The id of the datasource.
Parameters (including sorting and filtering parameters) are passed as matrix style parameters.
Note that names and values of these matrix parameters must be URL-Encoded
schema:
type: string
style: matrix
explode: true
example: ;name=appng;host=localhost;sortSites=name%3Aasc%3Bhost%3Adesc%3Bpage%3A0%3BpageSize%3A10
required: true
responses:
"200":
description: datasource response
content:
application/json:
schema:
$ref: "#/components/schemas/Datasource"
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorModel"
"/service/{site}/{application}/rest/openapi/action/{event-id}/{id}/{params}":
get:
tags:
- appNG
description: Returns an action. To be used for initially retrieving the action.
operationId: getAction
parameters:
- in: path
name: site
description: the site to call
required: true
schema:
type: string
- in: path
name: application
description: the application to call
required: true
schema:
type: string
- in: path
name: event-id
description: event-id of the action
required: true
schema:
type: string
- in: path
name: id
description: The ID of the action.
required: true
schema:
type: string
- in: path
name: params
description:
Parameters (including sorting and filtering parameters) are passed as matrix style parameters.
Note that names and values of these matrix parameters must be URL-Encoded
schema:
type: string
style: matrix
explode: true
example: ;name=appng;host=localhost;sortSites=name%3Aasc%3Bhost%3Adesc%3Bpage%3A0%3BpageSize%3A10
required: true
responses:
"200":
description: action response
content:
application/json:
schema:
$ref: "#/components/schemas/Action"
"400":
description: action response, in case an recoverable error occurred
content:
application/json:
schema:
$ref: "#/components/schemas/Action"
default:
description: unexpected/unrecoverable error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorModel"
"/service/{site}/{application}/rest/openapi/action/multipart/{event-id}/{id}/{params}":
post:
tags:
- appNG
description: Performs an action.
operationId: performActionMultiPart
parameters:
- in: path
name: site
description: the site to call
required: true
schema:
type: string
- in: path
name: application
description: the application to call
required: true
schema:
type: string
- in: path
name: event-id
description: event-id of the action
required: true
schema:
type: string
- in: path
name: id
description: The ID of the action.
required: true
schema:
type: string
- in: path
name: params
description:
Parameters (including sorting and filtering parameters) are passed as matrix style parameters.
Note that names and values of these matrix parameters must be URL-Encoded
schema:
type: string
style: matrix
explode: true
example: ;name=appng;host=localhost;sortSites=name%3Aasc%3Bhost%3Adesc%3Bpage%3A0%3BpageSize%3A10
required: true
requestBody:
description: For each field of an action, a multipart parameter must be present .
content:
multipart/form-data:
schema:
type: object
responses:
"200":
description: action response
content:
application/json:
schema:
$ref: "#/components/schemas/Action"
"400":
description: action response, in case an recoverable error occurred
content:
application/json:
schema:
$ref: "#/components/schemas/Action"
default:
description: unexpected/unrecoverable error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorModel"
components:
securitySchemes:
appNGCookie:
type: apiKey
in: cookie
name: JSESSIONID
schemas:
PageDefinition:
type: object
required:
- id
- _self
properties:
_self:
type: string
description: The URL of the page
_userUrl:
type: string
description: The URL of the page represented to the user
user:
$ref: "#/components/schemas/User"
id:
type: string
messages:
type: array
items:
$ref: "#/components/schemas/Message"
urlPath:
type: string
description: the current URL path
urlParameters:
type: array
items:
$ref: "#/components/schemas/Parameter"
urlTemplate:
type: string
description: A complete template for teh full path this page can handle
getParameters:
type: object
additionalProperties:
type: string
sessionParameters:
type: object
additionalProperties:
type: string
title:
$ref: "#/components/schemas/Label"
links:
type: array
items:
$ref: "#/components/schemas/Link"
sections:
type: array
items:
$ref: "#/components/schemas/Section"
appNGVersion:
type: String
description: The version of appNG
appVersion:
type: String
description: The version of the application
Section:
type: object
required:
- id
- _self
properties:
_self:
type: string
description: the API path to this section
id:
type: string
title:
$ref: "#/components/schemas/Label"
hidden:
type: boolean
description: Whether the section is hidden or not
elements:
type: array
items:
$ref: "#/components/schemas/SectionElement"
SectionElement:
type: object
properties:
title:
type: string
collapsed:
type: boolean
description: Whether the element is collapsed
datasource:
$ref: "#/components/schemas/Datasource"
action:
$ref: "#/components/schemas/Action"
Action:
type: object
description: An action, representing an executable operation.
required:
- _self
- id
- event-id
properties:
_self:
type: string
description: The URL of the action
_execute:
type: string
description: The URL to execute the action
id:
type: string
description: The Id of the action.
event-id:
type: string
description: The event-Id of the action.
title:
type: string
description: The title of the datasource.
parameters:
type: object
description: A list of parameters for the action
additionalProperties:
type: string
user:
$ref: "#/components/schemas/User"
messages:
type: array
description: A list of messages.
items:
$ref: "#/components/schemas/Message"
fields:
type: array
description: A list of action-fields.
items:
$ref: "#/components/schemas/ActionField"
permissions:
type: array
description: The permissions for this action.
items:
$ref: "#/components/schemas/Permission"
onSuccess:
type: string
appNGVersion:
type: String
description: The version of appNG
appVersion:
type: String
description: The version of the application
Datasource:
type: object
description: A datasource, represented by either a page (of elements) or a single
element.
required:
- id
- _self
properties:
_self:
type: string
description: The URL of the datasource
id:
type: string
description: The unique ID of the datasource.
title:
type: string
description: The title of the datasource.
parameters:
type: object
description: The parameters for the datasource.
additionalProperties:
type: string
user:
$ref: "#/components/schemas/User"
links:
type: array
description: A list of links.
items:
$ref: "#/components/schemas/Link"
messages:
type: array
description: A list of messages.
items:
$ref: "#/components/schemas/Message"
fields:
type: array
description: A list of fields.
items:
$ref: "#/components/schemas/Field"
filters:
type: array
description: A list of filters.
items:
$ref: "#/components/schemas/Filter"
filterResetPath:
type: string
description: the path to be called to reset the filter
page:
$ref: "#/components/schemas/Page"
item:
$ref: "#/components/schemas/Item"
items:
type: array
description: The items of this page.
items:
$ref: "#/components/schemas/Item"
permissions:
type: array
description: The permissions for this datasource.
items:
$ref: "#/components/schemas/Permission"
appNGVersion:
type: String
description: The version of appNG
appVersion:
type: String
description: The version of the application
ErrorModel:
type: object
description: ""
required:
- code
- message
properties:
code:
type: integer
format: int32
description: ""
message:
type: string
description: ""
Field:
type: object
description: A field that is part of a datasource.
required:
- name
- fieldType
properties:
name:
type: string
description: The name for this field.
label:
type: string
description: The label for this field.
fieldType:
$ref: "#/components/schemas/FieldType"
sort:
$ref: "#/components/schemas/Sort"
format:
type: string
description: The format for this field, depending on its type.
rules:
type: array
description: The validation rules that should be applied for this field.
items:
$ref: "#/components/schemas/ValidationRule"
fields:
type: object
description: The child fields of this field.
additionalProperties:
$ref: "#/components/schemas/Field"
Icon:
type: object
description: an icon
properties:
name:
type: string
label:
type: string
FieldValue:
type: object
description: The value of a field within a datasource.
required:
- name
properties:
name:
type: string
description: The name of the field.
value:
type: object
description: |
The value of the field.
This can be a simple string,integer,number or boolean value (for simple FieldTypes),
or an object (namely: an associative array of FieldValues for FieldType.OBJECT)
or an array of objects (namely: an array of associative arrays of FieldValues for for FieldType.LIST_OBJECT).
formattedValue:
type: string
description: The formatted value of the field (only applies for "simple" FieldTypes).
icons:
type: array
items:
$ref: "#/components/schemas/Icon"
Page:
type: object
description: A page that contains paging information an a list of elements.
required:
- _first
- _previous
- _next
- _last
- number
- size
- totalPages
- totalItems
- isFirst
- isLast
properties:
_first:
type: string
description: path to the first page
_previous:
type: string
description: path to the previous page
_next:
type: string
description: path to the next page
_last:
type: string
description: path to the last page
number:
type: integer
format: int32
description: The 0-based number of the current page.
size:
type: integer
format: int32
description: The number of items per page.
totalPages:
type: integer
format: int32
description: The number of total pages.
totalItems:
type: integer
format: int32
description: The total number of items.
isFirst:
type: boolean
description: If this is the first page.
isLast:
type: boolean
description: If this is the last page.
pageSizes:
type: array
items:
$ref: "#/components/schemas/PageSize"
PageSize:
type: object
description: describes the size and path for setting a page size
properties:
size:
type: integer
format: int32
description: the number of items to show
path:
type: string
description: the path
Sort:
type: object
description: Marks a field as sortable, properties are filled only when sorting has
been applied.
properties:
prio:
type: integer
description: The priority for this sort, important when a multi-field sort is
applied.
order:
type: string
enum:
- asc
- desc
description: The order for this sort (ascending or descending).
pathAsc:
type: string
description: the path to sort ascending
pathDesc:
type: string
description: the path to sort descending
Item:
type: object
description: A single item of a page.
properties:
fields:
type: object
description: The list of field-values of the item.
additionalProperties:
$ref: "#/components/schemas/FieldValue"
selected:
type: boolean
description: Whether this item is selected/active.
links:
type: array
description: A list of links.
items:
$ref: "#/components/schemas/Link"
Link:
type: object
description: A link.
required:
- type
discriminator:
propertyName: linkType
properties:
type:
type: string
description: |
* page - Links to a page.
* extern - Links to an external resource.
* intern - Links to an internal resource.
* action - Links to an action.
* datasource - Links to a datasource
enum:
- page
- extern
- intern
- action
- datasource
id:
type: string
description: The ID for this link.
label:
type: string
description: The label for the link.
target:
type: string
description: The target for the link.
icon:
type: string
description: A descriptive name for an icon that should be used for this link.
default:
type: boolean
description: Whether or not this link should be considered as default.
confirmation:
type: string
description: A confirmation message that should be displayed to the user before
following this link.
ActionLink:
allOf:
- $ref: '#/components/schemas/Link'
- type: object
properties:
id:
type: string
description: ID of the action
event-id:
type: string
description: Event-ID of the action
interactive:
type: boolean
description: Wether or not this action requires additional user-input
parameters:
type: array
items:
$ref: "#/components/schemas/Parameter"
Filter:
type: object
description: A filter that applies to a datasource.
properties:
name:
type: string
description: The name of the filter.
label:
type: string
description: The label iof the filter.
type:
$ref: "#/components/schemas/OptionType"
options:
$ref: "#/components/schemas/Options"
Options:
type: object
description: A set of selectable options
properties:
multiple:
type: boolean
description: Whether or not this filter allows multiple options to be selected.
entries:
type: array
description: A list of options for this filter.
items:
$ref: "#/components/schemas/Option"
Option:
type: object
description: A single option, used in a filter or an action-field.
properties:
value:
type: string
description: The value for this option.
label:
type: string
description: The label for this option.
selected:
type: boolean
description: Whether or not this option is selected.
hits:
type: integer
description: Tells how many hits there are for this option.
options:
type: array
description: An option can act as a group and thus can itself own a list of
options.
items:
$ref: "#/components/schemas/Option"
FieldType:
type: string
description: The possible types for a field/action-field.
enum:
- text
- longtext
- richtext
- password
- url
- int
- long
- decimal
- checkbox
- coordinate
- date
- file
- file_multiple
- image
- linkpanel
- list_checkbox
- list_radio
- list_select
- list_text
- object
- list_object
OptionType:
type: string
description: The possible types for an option.
enum:
- select
- select_multiple
- radio
- checkbox
- text
- date
ActionField:
type: object
description: A single field as a part of an action.
properties:
name:
type: string
description: The name of the field.
value:
type: object
description: The value of the field. The concrete type of that object depends on
the fieldType of this field.
label:
type: string
description: The label for the field.
fieldType:
$ref: "#/components/schemas/FieldType"
readonly:
type: boolean
description: Whether or not this field is read-only.
visible:
type: boolean
description: Whether or not this field should be visible.
format:
type: string
description: The format for this field, depending on its type.
formattedValue:
type: string
description: The formatted value for this field.
options:
$ref: "#/components/schemas/Options"
rules:
type: array
description: The validation rules that should be applied for this field.
items:
$ref: "#/components/schemas/ValidationRule"
messages:
type: array
description: The messages related to this field.
items:
$ref: "#/components/schemas/Message"
fields:
type: array
description: The child fields of this fieldValue.
items:
$ref: "#/components/schemas/ActionField"
ValidationRule:
type: object
description: A validation rule that can be bound to an action-field.
properties:
type:
type: string
description: The type of the rule.
message:
type: string
description: The error message displayed when the rule isn't fulfilled.
active:
type: boolean
description: Whether or not this rule is active, meaning it should be applied.
messageKey:
type: string
description: The message key for this rule
options:
type: object
description: An array defining the custom parameters for this rule.
additionalProperties:
type: string
User:
type: object
description: ""
properties:
name:
type: string
description: "the user's real name"
nickName:
type: string
description: "the user's nickname"
authenticated:
type: boolean
email:
type: string
description: The email address of the user.
example: john@example.com
locale:
type: string
description: The IETF BCP 47 language tag for the user.
example: en_US
timezone:
type: string
description: The name of the IANA time zone the user is located at.
example: Europe/Berlin
decimalSeparator:
type: string
description: The charactor used as a decimal separator.
example: .
groupingSeparator:
type: string
description: The charactor used when grouping numbers.
example: ","
Message:
type: object
description: A textual message with a certain level.
properties:
level:
type: string
description: The level of the message.
enum:
- OK
- NOTICE
- INVALID
- ERROR
text:
type: string
description: The actual message.
key:
type: string
description: A key for this message
Permission:
type: object
description: A permission.
properties:
mode:
type: string
description: The mode
enum:
- READ
- SET
ref:
type: string
description: The reference id of the permission.
value:
type: boolean
description: The value, true if the permission is present.
Parameter:
type: object
description: A single parameter.
required:
- name
properties:
name:
type: string
description: The name of the parameter.
value:
type: string
description: The value of the parameter.
Label:
type: object
properties:
value:
type: string
Navigation:
type: object
properties:
user:
$ref: "#/components/schemas/User"
items:
type: array
items:
$ref: "#/components/schemas/NavigationItem"
loginAction:
$ref: "#/components/schemas/Action"
appNGVersion:
type: String
description: The version of appNG
NavigationItem:
type: object
properties:
_self:
type: string
description: the API path (type PAGE only)
name:
type: string
default:
type: boolean
description: if this is the default page? (type PAGE only)
path:
type: string
active:
type: boolean
type:
type: string
enum:
- SITE
- APP
- PAGE
items:
type: array
items:
$ref: "#/components/schemas/NavigationItem"