File tree Expand file tree Collapse file tree 12 files changed +226
-28
lines changed Expand file tree Collapse file tree 12 files changed +226
-28
lines changed Original file line number Diff line number Diff line change 28
28
, APP_ROOT
29
29
, $ s_name
30
30
);
31
+ echo "Output: $ output_file \n" ;
31
32
32
33
$ output_data = $ s_data ;
33
34
foreach ($ output_data ['properties ' ] as $ pk => $ pv ) {
34
35
if ('ulid ' == $ pv ['type ' ]) {
35
36
$ output_data ['properties ' ][$ pk ]['type ' ] = 'string ' ;
36
37
}
38
+ if (isset ($ pv ['$ref ' ])) {
39
+ // var_dump($pv);
40
+ $ c = basename ($ pv ['$ref ' ]);
41
+ // var_dump($c);
42
+ $ obj = $ yaml_data ['components ' ]['schemas ' ][$ c ];
43
+ $ output_data ['properties ' ][$ pk ] = $ obj ;
44
+ // $path = trim($pv['$ref'], '#/');
45
+ // $path_list = explode('/', $path);
46
+ // var_dump($path_list);
47
+ // echo "Resolve\n";
48
+ // exit;
49
+ }
37
50
}
51
+
38
52
$ output_data ['$schema ' ] = 'http://json-schema.org/schema# ' ;
39
53
_ksort_r ($ output_data );
40
54
45
59
46
60
$ yaml_text = yaml_emit ($ yaml_data , YAML_UTF8_ENCODING , YAML_LN_BREAK );
47
61
48
- echo "# \n# Generated File \n# \n\n" ;
49
- echo $ yaml_text ;
62
+ $ data = "# \n# Generated File \n# \n\n$ yaml_text " ;
63
+ $ file = sprintf ('%s/webroot/openapi.yaml ' , APP_ROOT );
64
+
65
+ file_put_contents ($ file , $ data );
66
+
50
67
51
68
/**
52
69
* Helper on YAML Processor
Original file line number Diff line number Diff line change @@ -134,11 +134,26 @@ Inventory:
134
134
description : Freeform name of the Inventory, if desired
135
135
type : string
136
136
section :
137
- $ref : ' #/components/schemas/Section'
137
+ # $ref: '#/components/schemas/Section'
138
+ type : object
139
+ properties :
140
+ id :
141
+ description : " The Section Identifier"
142
+ type : string
138
143
variety :
139
- $ref : ' #/components/schemas/Variety'
144
+ # $ref: '#/components/schemas/Variety'
145
+ type : object
146
+ properties :
147
+ id :
148
+ description : " The Variety Identifier"
149
+ type : string
140
150
product :
141
- $ref : ' #/components/schemas/Product'
151
+ # $ref: '#/components/schemas/Product'
152
+ type : object
153
+ properties :
154
+ id :
155
+ description : " The Product Identifier"
156
+ type : string
142
157
qty :
143
158
description : Current Quantity of the Product on Hand
144
159
type : number
@@ -214,8 +229,8 @@ B2B_File:
214
229
description : " ID"
215
230
type : string
216
231
data :
217
- description : " The File Contents"
218
- type : binary
232
+ description : " The File Contents, Base64-URL Encoded "
233
+ type : string
219
234
link :
220
235
description : " A Link to the File Contents"
221
236
type : string
Original file line number Diff line number Diff line change @@ -19,5 +19,5 @@ properties:
19
19
code :
20
20
description : A Unique Identifier Code; typically a Government issued ID
21
21
type : string
22
- type :
23
- $ref : ' #/components/schemas/Company_Type'
22
+ # type:
23
+ # $ref: '#/components/schemas/Company_Type'
Original file line number Diff line number Diff line change @@ -23,18 +23,26 @@ type: object
23
23
properties :
24
24
id :
25
25
type : string
26
- company :
27
- description : The Company Object of the Laboratory Submitting Results
28
- type : object
29
- $ref : ' #/components/schemas/Company'
26
+ # company:
27
+ # description: The Company Object of the Laboratory Submitting Results
28
+ # type: object
29
+ # # $ref: '#/components/schemas/Company'
30
30
license :
31
+ # $ref: '#/components/schemas/License'
31
32
description : The License Object of the Laboratory Submitting Results
32
33
type : object
33
- $ref : ' #/components/schemas/License'
34
+ properties :
35
+ id :
36
+ description : " The License Identifier"
37
+ type : string
34
38
lab_sample :
35
39
description : The Lab Sample this Result is for
36
40
type : object
37
- $ref : ' #/components/schemas/Lab_Sample'
41
+ # $ref: '#/components/schemas/Lab_Sample'
42
+ properties :
43
+ id :
44
+ description : " The Lab Sample Identifier"
45
+ type : string
38
46
contact :
39
47
description : The Contact Object of the Laboratory Technician Submitting Results
40
48
type : object
Original file line number Diff line number Diff line change 8
8
9
9
description : " A Special type of Inventory Lot that becomes a Laboratory Sample"
10
10
type : object
11
- required : [ "id", "license" ]
11
+ required : [ "id", "license", "origin" ]
12
12
properties :
13
13
id :
14
14
description : ID of this specific Lab Sample
@@ -29,9 +29,33 @@ properties:
29
29
description : DateTime when deleted -- null indicates NOT deleted
30
30
type : string
31
31
format : dateTime
32
- license_origin :
32
+ license :
33
33
description : The License of the Owner of the Sample
34
- $ref : ' #/components/schemas/License'
34
+ # $ref: '#/components/schemas/License'
35
+ type : object
36
+ properties :
37
+ id :
38
+ description : " The License Identifier"
39
+ type : string
40
+ origin :
41
+ description : Origin Details of the Lab Sample
42
+ # $ref: '#/components/schemas/License'
43
+ type : object
44
+ properties :
45
+ inventory :
46
+ type : object
47
+ properties :
48
+ id :
49
+ description : " The Origin/Source Inventory Identifier"
50
+ type : string
51
+ license :
52
+ description : " The Origin/Source License Identifier"
53
+ type : object
54
+ properties :
55
+ id :
56
+ description : " The Origin/Source Inventory Identifier"
57
+ type : string
58
+
35
59
36
60
# laboratory:
37
61
# description: Laboratory Details, object with id and name properties
Original file line number Diff line number Diff line change @@ -20,7 +20,19 @@ properties:
20
20
description : A Unique Identifier Code; typically a Government issued ID
21
21
type : string
22
22
type :
23
- $ref : ' #/components/schemas/License_Type'
23
+ # $ref: '#/components/schemas/License_Type'
24
+ description : " Identifier of the License Type"
25
+ type : object
26
+ properties :
27
+ id :
28
+ description : " The License Type Identifier"
29
+ type : string
24
30
company :
25
- $ref : ' #/components/schemas/Company'
26
31
description : Company Object which owns this license
32
+ type : object
33
+ properties :
34
+ id :
35
+ description : " The Company Identifier"
36
+ type : string
37
+
38
+ # $ref: '#/components/schemas/Company'
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ properties:
15
15
name :
16
16
description : Free-form name of the Product
17
17
type : string
18
- type :
19
- $ref : ' #/components/schemas/Product_Type'
18
+ # type:
19
+ # $ref: '#/components/schemas/Product_Type'
20
20
package :
21
21
type : object
22
22
properties :
Original file line number Diff line number Diff line change 218
218
/b2b/outgoing/{id}/item :
219
219
$ref : ' ./b2b/single-item-create.yaml'
220
220
221
- /b2b/outgoing/{id}/item/{iid } :
221
+ /b2b/outgoing/{id}/item/{item_id } :
222
222
$ref : ' ./b2b/single-item-single.yaml'
223
223
224
224
/b2b/outgoing/{id}/file :
236
236
/b2b/incoming/{id} :
237
237
$ref : ' ./b2b/single.yaml'
238
238
239
- /b2b/outgoing/{id}/item :
240
- $ref : ' ./b2b/single-item-create.yaml'
241
-
242
- /b2b/outgoing/{id}/item/{iid} :
243
- $ref : ' ./b2b/single-item-single.yaml'
239
+ /b2b/incoming/{id}/item :
240
+ get :
241
+ $ref : ' ./b2b/incoming/item/search.yaml'
242
+ post :
243
+ $ref : ' ./b2b/incoming/item/create.yaml'
244
+
245
+ /b2b/incoming/{id}/item/{item_id} :
246
+ get :
247
+ $ref : ' ./b2b/incoming/item/detail.yaml'
248
+ patch :
249
+ $ref : ' ./b2b/incoming/item/update.yaml'
250
+ post :
251
+ $ref : ' ./b2b/incoming/item/update.yaml'
252
+ put :
253
+ $ref : ' ./b2b/incoming/item/update.yaml'
244
254
245
255
/b2b/incoming/{id}/commit :
246
256
$ref : ' ./b2b/commit.yaml'
Original file line number Diff line number Diff line change
1
+ #
2
+ # B2B Incoming Item Create
3
+ #
4
+
5
+ summary : B2B Incoming Transaction Item Create
6
+ tags :
7
+ - B2B Transaction
8
+ parameters :
9
+ - name : id
10
+ description : The B2B Transaction ID
11
+ in : path
12
+ required : true
13
+ schema :
14
+ type : string
15
+ responses :
16
+ ' 201 ' :
17
+ description : Success
18
+ content :
19
+ application/json :
20
+ schema :
21
+ type : array
22
+ items :
23
+ $ref : ' #/components/schemas/B2B_Sale'
24
+ ' 401 ' :
25
+ description : " Not Authorized"
Original file line number Diff line number Diff line change
1
+ #
2
+ # B2B Incoming Item Detail
3
+ #
4
+
5
+ summary : B2B Incoming Transaction Item Detail
6
+ tags :
7
+ - B2B Transaction
8
+ parameters :
9
+ - name : id
10
+ description : The B2B Transaction ID
11
+ in : path
12
+ required : true
13
+ schema :
14
+ type : string
15
+ - name : item_id
16
+ description : Item ID
17
+ in : path
18
+ required : true
19
+ schema :
20
+ type : string
21
+ responses :
22
+ ' 201 ' :
23
+ description : Success
24
+ content :
25
+ application/json :
26
+ schema :
27
+ type : array
28
+ items :
29
+ $ref : ' #/components/schemas/B2B_Sale'
30
+ ' 401 ' :
31
+ description : " Not Authorized"
You can’t perform that action at this time.
0 commit comments