· 6 years ago · Nov 15, 2019, 04:02 PM
1paths:
2 '/Items/{id}/reviews/{fk}':
3 get:
4 tags:
5 - Item
6 summary: 'Find a related item by id for reviews.'
7 operationId: Item.prototype.__findById__reviews
8 parameters:
9 -
10 name: fk
11 in: path
12 description: 'Foreign key for reviews'
13 required: true
14 type: string
15 format: JSON
16 -
17 name: id
18 in: path
19 description: 'Item id'
20 required: true
21 type: string
22 format: JSON
23 responses:
24 '200':
25 description: 'Request was successful'
26 schema:
27 $ref: '#/definitions/review'
28 deprecated: false
29 delete:
30 tags:
31 - Item
32 summary: 'Delete a related item by id for reviews.'
33 operationId: Item.prototype.__destroyById__reviews
34 parameters:
35 -
36 name: fk
37 in: path
38 description: 'Foreign key for reviews'
39 required: true
40 type: string
41 format: JSON
42 -
43 name: id
44 in: path
45 description: 'Item id'
46 required: true
47 type: string
48 format: JSON
49 responses:
50 '204':
51 description: 'Request was successful'
52 deprecated: false
53 put:
54 tags:
55 - Item
56 summary: 'Update a related item by id for reviews.'
57 operationId: Item.prototype.__updateById__reviews
58 parameters:
59 -
60 name: fk
61 in: path
62 description: 'Foreign key for reviews'
63 required: true
64 type: string
65 format: JSON
66 -
67 name: data
68 in: body
69 required: false
70 schema:
71 $ref: '#/definitions/review'
72 -
73 name: id
74 in: path
75 description: 'Item id'
76 required: true
77 type: string
78 format: JSON
79 responses:
80 '200':
81 description: 'Request was successful'
82 schema:
83 $ref: '#/definitions/review'
84 deprecated: false
85 '/Items/{id}/reviews':
86 get:
87 tags:
88 - Item
89 summary: 'Queries reviews of Item.'
90 operationId: Item.prototype.__get__reviews
91 parameters:
92 -
93 name: filter
94 in: query
95 required: false
96 type: string
97 format: JSON
98 -
99 name: id
100 in: path
101 description: 'Item id'
102 required: true
103 type: string
104 format: JSON
105 responses:
106 '200':
107 description: 'Request was successful'
108 schema:
109 type: array
110 items:
111 $ref: '#/definitions/review'
112 deprecated: false
113 post:
114 tags:
115 - Item
116 summary: 'Creates a new instance in reviews of this model.'
117 operationId: Item.prototype.__create__reviews
118 parameters:
119 -
120 name: data
121 in: body
122 required: false
123 schema:
124 $ref: '#/definitions/review'
125 -
126 name: id
127 in: path
128 description: 'Item id'
129 required: true
130 type: string
131 format: JSON
132 responses:
133 '200':
134 description: 'Request was successful'
135 schema:
136 $ref: '#/definitions/review'
137 deprecated: false
138 delete:
139 tags:
140 - Item
141 summary: 'Deletes all reviews of this model.'
142 operationId: Item.prototype.__delete__reviews
143 parameters:
144 -
145 name: id
146 in: path
147 description: 'Item id'
148 required: true
149 type: string
150 format: JSON
151 responses:
152 '204':
153 description: 'Request was successful'
154 deprecated: false
155 '/Items/{id}/reviews/count':
156 get:
157 tags:
158 - Item
159 summary: 'Counts reviews of Item.'
160 operationId: Item.prototype.__count__reviews
161 parameters:
162 -
163 name: where
164 in: query
165 description: 'Criteria to match model instances'
166 required: false
167 type: string
168 format: JSON
169 -
170 name: id
171 in: path
172 description: 'Item id'
173 required: true
174 type: string
175 format: JSON
176 responses:
177 '200':
178 description: 'Request was successful'
179 schema:
180 type: object
181 properties:
182 count:
183 type: number
184 format: double
185 deprecated: false
186 /Items:
187 post:
188 tags:
189 - Item
190 summary: 'Create a new instance of the model and persist it into the data source.'
191 operationId: Item.create
192 parameters:
193 -
194 name: data
195 in: body
196 description: 'Model instance data'
197 required: false
198 schema:
199 description: 'Model instance data'
200 $ref: '#/definitions/Item'
201 responses:
202 '200':
203 description: 'Request was successful'
204 schema:
205 $ref: '#/definitions/Item'
206 deprecated: false
207 patch:
208 tags:
209 - Item
210 summary: 'Patch an existing model instance or insert a new one into the data source.'
211 operationId: Item.patchOrCreate
212 parameters:
213 -
214 name: data
215 in: body
216 description: 'Model instance data'
217 required: false
218 schema:
219 description: 'Model instance data'
220 $ref: '#/definitions/Item'
221 responses:
222 '200':
223 description: 'Request was successful'
224 schema:
225 $ref: '#/definitions/Item'
226 deprecated: false
227 put:
228 tags:
229 - Item
230 summary: 'Replace an existing model instance or insert a new one into the data source.'
231 operationId: Item.replaceOrCreate__put_Items
232 parameters:
233 -
234 name: data
235 in: body
236 description: 'Model instance data'
237 required: false
238 schema:
239 description: 'Model instance data'
240 $ref: '#/definitions/Item'
241 responses:
242 '200':
243 description: 'Request was successful'
244 schema:
245 $ref: '#/definitions/Item'
246 deprecated: false
247 get:
248 tags:
249 - Item
250 summary: 'Find all instances of the model matched by filter from the data source.'
251 operationId: Item.find
252 parameters:
253 -
254 name: filter
255 in: query
256 description: 'Filter defining fields, where, include, order, offset, and limit - must be a JSON-encoded string (`{"where":{"something":"value"}}`). See https://loopback.io/doc/en/lb3/Querying-data.html#using-stringified-json-in-rest-queries for more details.'
257 required: false
258 type: string
259 format: JSON
260 responses:
261 '200':
262 description: 'Request was successful'
263 schema:
264 type: array
265 items:
266 $ref: '#/definitions/Item'
267 deprecated: false
268 /Items/replaceOrCreate:
269 post:
270 tags:
271 - Item
272 summary: 'Replace an existing model instance or insert a new one into the data source.'
273 operationId: Item.replaceOrCreate__post_Items_replaceOrCreate
274 parameters:
275 -
276 name: data
277 in: body
278 description: 'Model instance data'
279 required: false
280 schema:
281 description: 'Model instance data'
282 $ref: '#/definitions/Item'
283 responses:
284 '200':
285 description: 'Request was successful'
286 schema:
287 $ref: '#/definitions/Item'
288 deprecated: false
289 /Items/upsertWithWhere:
290 post:
291 tags:
292 - Item
293 summary: 'Update an existing model instance or insert a new one into the data source based on the where criteria.'
294 operationId: Item.upsertWithWhere
295 parameters:
296 -
297 name: where
298 in: query
299 description: 'Criteria to match model instances'
300 required: false
301 type: string
302 format: JSON
303 -
304 name: data
305 in: body
306 description: 'An object of model property name/value pairs'
307 required: false
308 schema:
309 description: 'An object of model property name/value pairs'
310 $ref: '#/definitions/Item'
311 responses:
312 '200':
313 description: 'Request was successful'
314 schema:
315 $ref: '#/definitions/Item'
316 deprecated: false
317 '/Items/{id}/exists':
318 get:
319 tags:
320 - Item
321 summary: 'Check whether a model instance exists in the data source.'
322 operationId: 'Item.exists__get_Items_{id}_exists'
323 parameters:
324 -
325 name: id
326 in: path
327 description: 'Model id'
328 required: true
329 type: string
330 format: JSON
331 responses:
332 '200':
333 description: 'Request was successful'
334 schema:
335 type: object
336 properties:
337 exists:
338 type: boolean
339 deprecated: false
340 '/Items/{id}':
341 head:
342 tags:
343 - Item
344 summary: 'Check whether a model instance exists in the data source.'
345 operationId: 'Item.exists__head_Items_{id}'
346 parameters:
347 -
348 name: id
349 in: path
350 description: 'Model id'
351 required: true
352 type: string
353 format: JSON
354 responses:
355 '200':
356 description: 'Request was successful'
357 schema:
358 type: object
359 properties:
360 exists:
361 type: boolean
362 deprecated: false
363 get:
364 tags:
365 - Item
366 summary: 'Find a model instance by {{id}} from the data source.'
367 operationId: Item.findById
368 parameters:
369 -
370 name: id
371 in: path
372 description: 'Model id'
373 required: true
374 type: string
375 format: JSON
376 -
377 name: filter
378 in: query
379 description: 'Filter defining fields and include - must be a JSON-encoded string ({"something":"value"})'
380 required: false
381 type: string
382 format: JSON
383 responses:
384 '200':
385 description: 'Request was successful'
386 schema:
387 $ref: '#/definitions/Item'
388 deprecated: false
389 put:
390 tags:
391 - Item
392 summary: 'Replace attributes for a model instance and persist it into the data source.'
393 operationId: 'Item.replaceById__put_Items_{id}'
394 parameters:
395 -
396 name: id
397 in: path
398 description: 'Model id'
399 required: true
400 type: string
401 format: JSON
402 -
403 name: data
404 in: body
405 description: 'Model instance data'
406 required: false
407 schema:
408 description: 'Model instance data'
409 $ref: '#/definitions/Item'
410 responses:
411 '200':
412 description: 'Request was successful'
413 schema:
414 $ref: '#/definitions/Item'
415 deprecated: false
416 delete:
417 tags:
418 - Item
419 summary: 'Delete a model instance by {{id}} from the data source.'
420 operationId: Item.deleteById
421 parameters:
422 -
423 name: id
424 in: path
425 description: 'Model id'
426 required: true
427 type: string
428 format: JSON
429 responses:
430 '200':
431 description: 'Request was successful'
432 schema:
433 type: object
434 deprecated: false
435 patch:
436 tags:
437 - Item
438 summary: 'Patch attributes for a model instance and persist it into the data source.'
439 operationId: Item.prototype.patchAttributes
440 parameters:
441 -
442 name: data
443 in: body
444 description: 'An object of model property name/value pairs'
445 required: false
446 schema:
447 description: 'An object of model property name/value pairs'
448 $ref: '#/definitions/Item'
449 -
450 name: id
451 in: path
452 description: 'Item id'
453 required: true
454 type: string
455 format: JSON
456 responses:
457 '200':
458 description: 'Request was successful'
459 schema:
460 $ref: '#/definitions/Item'
461 deprecated: false
462 '/Items/{id}/replace':
463 post:
464 tags:
465 - Item
466 summary: 'Replace attributes for a model instance and persist it into the data source.'
467 operationId: 'Item.replaceById__post_Items_{id}_replace'
468 parameters:
469 -
470 name: id
471 in: path
472 description: 'Model id'
473 required: true
474 type: string
475 format: JSON
476 -
477 name: data
478 in: body
479 description: 'Model instance data'
480 required: false
481 schema:
482 description: 'Model instance data'
483 $ref: '#/definitions/Item'
484 responses:
485 '200':
486 description: 'Request was successful'
487 schema:
488 $ref: '#/definitions/Item'
489 deprecated: false
490 /Items/findOne:
491 get:
492 tags:
493 - Item
494 summary: 'Find first instance of the model matched by filter from the data source.'
495 operationId: Item.findOne
496 parameters:
497 -
498 name: filter
499 in: query
500 description: 'Filter defining fields, where, include, order, offset, and limit - must be a JSON-encoded string (`{"where":{"something":"value"}}`). See https://loopback.io/doc/en/lb3/Querying-data.html#using-stringified-json-in-rest-queries for more details.'
501 required: false
502 type: string
503 format: JSON
504 responses:
505 '200':
506 description: 'Request was successful'
507 schema:
508 $ref: '#/definitions/Item'
509 deprecated: false
510 /Items/update:
511 post:
512 tags:
513 - Item
514 summary: 'Update instances of the model matched by {{where}} from the data source.'
515 operationId: Item.updateAll
516 parameters:
517 -
518 name: where
519 in: query
520 description: 'Criteria to match model instances'
521 required: false
522 type: string
523 format: JSON
524 -
525 name: data
526 in: body
527 description: 'An object of model property name/value pairs'
528 required: false
529 schema:
530 description: 'An object of model property name/value pairs'
531 $ref: '#/definitions/Item'
532 responses:
533 '200':
534 description: 'Request was successful'
535 schema:
536 description: 'Information related to the outcome of the operation'
537 type: object
538 properties:
539 count:
540 description: 'The number of instances updated'
541 type: number
542 format: double
543 deprecated: false
544 /Items/count:
545 get:
546 tags:
547 - Item
548 summary: 'Count instances of the model matched by where from the data source.'
549 operationId: Item.count
550 parameters:
551 -
552 name: where
553 in: query
554 description: 'Criteria to match model instances'
555 required: false
556 type: string
557 format: JSON
558 responses:
559 '200':
560 description: 'Request was successful'
561 schema:
562 type: object
563 properties:
564 count:
565 type: number
566 format: double
567 deprecated: false
568 /reviews:
569 post:
570 tags:
571 - review
572 summary: 'Create a new instance of the model and persist it into the data source.'
573 operationId: review.create
574 parameters:
575 -
576 name: data
577 in: body
578 description: 'Model instance data'
579 required: false
580 schema:
581 description: 'Model instance data'
582 $ref: '#/definitions/review'
583 responses:
584 '200':
585 description: 'Request was successful'
586 schema:
587 $ref: '#/definitions/review'
588 deprecated: false
589 patch:
590 tags:
591 - review
592 summary: 'Patch an existing model instance or insert a new one into the data source.'
593 operationId: review.patchOrCreate
594 parameters:
595 -
596 name: data
597 in: body
598 description: 'Model instance data'
599 required: false
600 schema:
601 description: 'Model instance data'
602 $ref: '#/definitions/review'
603 responses:
604 '200':
605 description: 'Request was successful'
606 schema:
607 $ref: '#/definitions/review'
608 deprecated: false
609 put:
610 tags:
611 - review
612 summary: 'Replace an existing model instance or insert a new one into the data source.'
613 operationId: review.replaceOrCreate__put_reviews
614 parameters:
615 -
616 name: data
617 in: body
618 description: 'Model instance data'
619 required: false
620 schema:
621 description: 'Model instance data'
622 $ref: '#/definitions/review'
623 responses:
624 '200':
625 description: 'Request was successful'
626 schema:
627 $ref: '#/definitions/review'
628 deprecated: false
629 get:
630 tags:
631 - review
632 summary: 'Find all instances of the model matched by filter from the data source.'
633 operationId: review.find
634 parameters:
635 -
636 name: filter
637 in: query
638 description: 'Filter defining fields, where, include, order, offset, and limit - must be a JSON-encoded string (`{"where":{"something":"value"}}`). See https://loopback.io/doc/en/lb3/Querying-data.html#using-stringified-json-in-rest-queries for more details.'
639 required: false
640 type: string
641 format: JSON
642 responses:
643 '200':
644 description: 'Request was successful'
645 schema:
646 type: array
647 items:
648 $ref: '#/definitions/review'
649 deprecated: false
650 /reviews/replaceOrCreate:
651 post:
652 tags:
653 - review
654 summary: 'Replace an existing model instance or insert a new one into the data source.'
655 operationId: review.replaceOrCreate__post_reviews_replaceOrCreate
656 parameters:
657 -
658 name: data
659 in: body
660 description: 'Model instance data'
661 required: false
662 schema:
663 description: 'Model instance data'
664 $ref: '#/definitions/review'
665 responses:
666 '200':
667 description: 'Request was successful'
668 schema:
669 $ref: '#/definitions/review'
670 deprecated: false
671 /reviews/upsertWithWhere:
672 post:
673 tags:
674 - review
675 summary: 'Update an existing model instance or insert a new one into the data source based on the where criteria.'
676 operationId: review.upsertWithWhere
677 parameters:
678 -
679 name: where
680 in: query
681 description: 'Criteria to match model instances'
682 required: false
683 type: string
684 format: JSON
685 -
686 name: data
687 in: body
688 description: 'An object of model property name/value pairs'
689 required: false
690 schema:
691 description: 'An object of model property name/value pairs'
692 $ref: '#/definitions/review'
693 responses:
694 '200':
695 description: 'Request was successful'
696 schema:
697 $ref: '#/definitions/review'
698 deprecated: false
699 '/reviews/{id}/exists':
700 get:
701 tags:
702 - review
703 summary: 'Check whether a model instance exists in the data source.'
704 operationId: 'review.exists__get_reviews_{id}_exists'
705 parameters:
706 -
707 name: id
708 in: path
709 description: 'Model id'
710 required: true
711 type: string
712 format: JSON
713 responses:
714 '200':
715 description: 'Request was successful'
716 schema:
717 type: object
718 properties:
719 exists:
720 type: boolean
721 deprecated: false
722 '/reviews/{id}':
723 head:
724 tags:
725 - review
726 summary: 'Check whether a model instance exists in the data source.'
727 operationId: 'review.exists__head_reviews_{id}'
728 parameters:
729 -
730 name: id
731 in: path
732 description: 'Model id'
733 required: true
734 type: string
735 format: JSON
736 responses:
737 '200':
738 description: 'Request was successful'
739 schema:
740 type: object
741 properties:
742 exists:
743 type: boolean
744 deprecated: false
745 get:
746 tags:
747 - review
748 summary: 'Find a model instance by {{id}} from the data source.'
749 operationId: review.findById
750 parameters:
751 -
752 name: id
753 in: path
754 description: 'Model id'
755 required: true
756 type: string
757 format: JSON
758 -
759 name: filter
760 in: query
761 description: 'Filter defining fields and include - must be a JSON-encoded string ({"something":"value"})'
762 required: false
763 type: string
764 format: JSON
765 responses:
766 '200':
767 description: 'Request was successful'
768 schema:
769 $ref: '#/definitions/review'
770 deprecated: false
771 put:
772 tags:
773 - review
774 summary: 'Replace attributes for a model instance and persist it into the data source.'
775 operationId: 'review.replaceById__put_reviews_{id}'
776 parameters:
777 -
778 name: id
779 in: path
780 description: 'Model id'
781 required: true
782 type: string
783 format: JSON
784 -
785 name: data
786 in: body
787 description: 'Model instance data'
788 required: false
789 schema:
790 description: 'Model instance data'
791 $ref: '#/definitions/review'
792 responses:
793 '200':
794 description: 'Request was successful'
795 schema:
796 $ref: '#/definitions/review'
797 deprecated: false
798 delete:
799 tags:
800 - review
801 summary: 'Delete a model instance by {{id}} from the data source.'
802 operationId: review.deleteById
803 parameters:
804 -
805 name: id
806 in: path
807 description: 'Model id'
808 required: true
809 type: string
810 format: JSON
811 responses:
812 '200':
813 description: 'Request was successful'
814 schema:
815 type: object
816 deprecated: false
817 patch:
818 tags:
819 - review
820 summary: 'Patch attributes for a model instance and persist it into the data source.'
821 operationId: review.prototype.patchAttributes
822 parameters:
823 -
824 name: data
825 in: body
826 description: 'An object of model property name/value pairs'
827 required: false
828 schema:
829 description: 'An object of model property name/value pairs'
830 $ref: '#/definitions/review'
831 -
832 name: id
833 in: path
834 description: 'review id'
835 required: true
836 type: string
837 format: JSON
838 responses:
839 '200':
840 description: 'Request was successful'
841 schema:
842 $ref: '#/definitions/review'
843 deprecated: false
844 '/reviews/{id}/replace':
845 post:
846 tags:
847 - review
848 summary: 'Replace attributes for a model instance and persist it into the data source.'
849 operationId: 'review.replaceById__post_reviews_{id}_replace'
850 parameters:
851 -
852 name: id
853 in: path
854 description: 'Model id'
855 required: true
856 type: string
857 format: JSON
858 -
859 name: data
860 in: body
861 description: 'Model instance data'
862 required: false
863 schema:
864 description: 'Model instance data'
865 $ref: '#/definitions/review'
866 responses:
867 '200':
868 description: 'Request was successful'
869 schema:
870 $ref: '#/definitions/review'
871 deprecated: false
872 /reviews/findOne:
873 get:
874 tags:
875 - review
876 summary: 'Find first instance of the model matched by filter from the data source.'
877 operationId: review.findOne
878 parameters:
879 -
880 name: filter
881 in: query
882 description: 'Filter defining fields, where, include, order, offset, and limit - must be a JSON-encoded string (`{"where":{"something":"value"}}`). See https://loopback.io/doc/en/lb3/Querying-data.html#using-stringified-json-in-rest-queries for more details.'
883 required: false
884 type: string
885 format: JSON
886 responses:
887 '200':
888 description: 'Request was successful'
889 schema:
890 $ref: '#/definitions/review'
891 deprecated: false
892 /reviews/update:
893 post:
894 tags:
895 - review
896 summary: 'Update instances of the model matched by {{where}} from the data source.'
897 operationId: review.updateAll
898 parameters:
899 -
900 name: where
901 in: query
902 description: 'Criteria to match model instances'
903 required: false
904 type: string
905 format: JSON
906 -
907 name: data
908 in: body
909 description: 'An object of model property name/value pairs'
910 required: false
911 schema:
912 description: 'An object of model property name/value pairs'
913 $ref: '#/definitions/review'
914 responses:
915 '200':
916 description: 'Request was successful'
917 schema:
918 description: 'Information related to the outcome of the operation'
919 type: object
920 properties:
921 count:
922 description: 'The number of instances updated'
923 type: number
924 format: double
925 deprecated: false
926 /reviews/count:
927 get:
928 tags:
929 - review
930 summary: 'Count instances of the model matched by where from the data source.'
931 operationId: review.count
932 parameters:
933 -
934 name: where
935 in: query
936 description: 'Criteria to match model instances'
937 required: false
938 type: string
939 format: JSON
940 responses:
941 '200':
942 description: 'Request was successful'
943 schema:
944 type: object
945 properties:
946 count:
947 type: number
948 format: double
949 deprecated: false
950definitions:
951 x-any:
952 properties: {}
953 review:
954 properties:
955 comment:
956 type: string
957 date:
958 type: string
959 format: date-time
960 id:
961 type: number
962 format: double
963 rating:
964 type: number
965 format: double
966 reviewer_email:
967 type: string
968 reviewer_name:
969 type: string
970 itemId:
971 type: number
972 format: double
973 required:
974 - date
975 - id
976 - rating
977 additionalProperties: false
978 Item:
979 properties:
980 id:
981 type: number
982 format: double
983 name:
984 maxLength: 255
985 type: string
986 descripcion:
987 maxLength: 255
988 type: string
989 img:
990 maxLength: 45
991 type: string
992 imgalt:
993 maxLength: 45
994 type: string
995 price:
996 type: number
997 format: double
998 rating:
999 type: number
1000 format: double
1001 required:
1002 - id
1003 - name
1004 - descripcion
1005 - img
1006 - imgalt
1007 - price
1008 additionalProperties: false
1009basePath: /api
1010swagger: '2.0'
1011info:
1012 x-ibm-name: inventory
1013 version: 1.0.0
1014 title: Inventory
1015schemes:
1016 - https
1017host: $(catalog.host)
1018consumes:
1019 - application/json
1020produces:
1021 - application/json
1022securityDefinitions:
1023 clientIdHeader:
1024 type: apiKey
1025 in: header
1026 name: X-IBM-Client-Id
1027 clientSecretHeader:
1028 in: header
1029 name: X-IBM-Client-Secret
1030 type: apiKey
1031security:
1032 -
1033 clientIdHeader: []
1034 clientSecretHeader: []
1035x-ibm-configuration:
1036 testable: true
1037 enforced: true
1038 cors:
1039 enabled: true
1040 catalogs:
1041 apic-dev:
1042 properties:
1043 runtime-url: $(TARGET_URL)
1044 sb:
1045 properties:
1046 runtime-url: 'http://localhost:4001'
1047 assembly:
1048 execute:
1049 -
1050 invoke:
1051 target-url: $(runtime-url)$(request.path)$(request.search)