-
Notifications
You must be signed in to change notification settings - Fork 0
/
APIContract.yml
171 lines (161 loc) · 5.4 KB
/
APIContract.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
openapi: 3.0.0
servers:
- url: 'https://localhost:5000/'
description: todo server
info:
title: External process communication
description: Specification of communication between external process and CobiGen
version: 1.0.0
x-rootpackage: com.devonfw.poc
paths:
/processmanagement/todoplugin/isConnectionReady/:
get:
description: Needed for CobiGen to know that the server is ready to receive requests. Also we need it to differentiate plug-ins.
responses:
'200':
description: OK
/processmanagement/todoplugin/isValidInput/:
post:
description: Returns true or false whether it is a valid input for generation. It can be a simple file extension check or more complex logic.
requestBody:
$ref: '#/components/requestBodies/InputFile'
operationId: isValidInput
responses:
'200':
description: Returns true or false whether it is a valid input for generation
content:
text/plain:
schema:
type: boolean
'404':
description: Not found
/processmanagement/todoplugin/getInputModel/:
post:
description: Requesting a key-value model of the input file in JSON format.
requestBody:
$ref: '#/components/requestBodies/InputFile'
operationId: getInputObjects
responses:
'200':
description: Returns a model in JSON format
content:
application/json:
schema:
$ref: '#/components/schemas/Model'
'404':
description: Not found
/processmanagement/todoplugin/merge/:
post:
description: Merges two files and returns the result
requestBody:
$ref: '#/components/requestBodies/Merger'
operationId: merge
responses:
'200':
description: Returns merge file as a string
content:
text/plain:
schema:
type: string
'404':
description: Not found
components:
schemas:
Model:
x-component: processmanagement
description: Data model of the input file
type: object
properties:
path:
type: string
description: Input file path. It can also be just the file name.
uniqueItems: true
inputObject:
$ref: '#/components/schemas/InputObject'
InputObject:
x-component: processmanagement
description: Input object containing needed information for the templates
type: object
properties:
Fields:
$ref: '#/components/schemas/Fields'
Imports:
$ref: '#/components/schemas/Imports'
Fields:
x-component: processmanagement
description: Not really needed, just used as an example for the model.
type: array
items:
type: object
properties:
Field:
$ref: '#/components/schemas/Field'
Field:
x-component: processmanagement
description: Not really needed, just used as an example for the model.
type: object
properties:
fieldName:
type: string
fieldType:
type: string
Imports:
x-component: processmanagement
description: Not really needed, just used as an example for the model.
type: array
items:
type: object
properties:
Import:
$ref: '#/components/schemas/Import'
Import:
x-component: processmanagement
description: Not really needed, just used as an example for the model.
type: object
properties:
importValue:
type: string
InputFile:
x-component: processmanagement
description: Input file
type: object
properties:
filename:
type: string
content:
type: string
charset:
type: string
Merger:
x-component: processmanagement
description: Merger properties. baseContent is the current user's file. patchContent is CobiGen freshly generated file. patchOverrides is set to true when in case of conflict, we want to override using patch.
type: object
properties:
baseContent:
type: string
patchContent:
type: string
patchOverrides:
type: boolean
requestBodies:
Model:
description: Data model of the file in JSON format
content:
application/json:
schema:
$ref: '#/components/schemas/Model'
required: true
InputFile:
description: Input file for CobiGen to parse
content:
application/json:
schema:
$ref: '#/components/schemas/InputFile'
required: true
Merger:
description: baseContent is the current user's file. patchContent is CobiGen freshly generated file. patchOverrides is set to true when in case of conflict, we want to override using patch.
content:
application/json:
schema:
$ref: '#/components/schemas/Merger'
required: true