-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.yaml
1484 lines (1482 loc) · 34 KB
/
swagger.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
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
title: E-commerce Api
contact: {}
version: "1.0"
servers:
- url: https://ecommerce-api-production-d621.up.railway.app/api/v1
variables: {}
- url: https://api.stripe.com/v1
variables: {}
paths:
/users/register:
post:
tags:
- Auth
summary: signUp
operationId: signUp
parameters: []
requestBody:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/signUpRequest"
- example:
name: mary
email: [email protected]
password: mary123
example:
name: mary
email: [email protected]
password: mary123
required: true
responses:
"200":
description: ""
headers: {}
deprecated: false
security: []
/users/login:
post:
tags:
- Auth
summary: login
operationId: login
parameters: []
requestBody:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/loginrequest"
- example:
email: [email protected]
password: abubaker123
example:
email: [email protected]
password: abubaker123
required: true
responses:
"200":
description: ""
headers: {}
deprecated: false
security: []
/users/resetpassword/{token}:
put:
tags:
- Auth
summary: Reset Password
operationId: ResetPassword
parameters:
- name: token
in: path
description: ""
required: true
style: simple
schema:
type: string
requestBody:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/ResetPasswordRequest"
- example:
password: "123456"
example:
password: "123456"
required: true
responses:
"200":
description: ""
headers: {}
deprecated: false
security: []
/users/forgotpassword:
post:
tags:
- Auth
summary: Forgot password
operationId: Forgotpassword
parameters: []
requestBody:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/ForgotpasswordRequest"
- example:
email: [email protected]
example:
email: [email protected]
required: true
responses:
"200":
description: ""
headers: {}
deprecated: false
security: []
/users:
get:
tags:
- Users
summary: Get All User
operationId: GetAllUser
parameters: []
responses:
"200":
description: ""
headers: {}
deprecated: false
/users/{id}:
get:
tags:
- Users
summary: One User
operationId: OneUser
parameters:
- name: id
in: path
description: ""
required: true
style: simple
schema:
type: string
responses:
"200":
description: ""
headers: {}
deprecated: false
patch:
tags:
- Users
summary: Update User
operationId: UpdateUser
parameters:
- name: id
in: path
description: ""
required: true
style: simple
schema:
type: string
requestBody:
content:
application/x-www-form-urlencoded:
encoding: {}
schema:
required:
- profileImage
type: object
properties:
profileImage:
type: string
required: false
responses:
"200":
description: ""
headers: {}
deprecated: false
delete:
tags:
- Users
summary: Delete User
operationId: DeleteUser
parameters:
- name: id
in: path
description: ""
required: true
style: simple
schema:
type: string
responses:
"200":
description: ""
headers: {}
deprecated: false
/users/cart:
get:
tags:
- Cart
summary: User Cart
operationId: UserCart
parameters: []
responses:
"200":
description: ""
headers: {}
deprecated: false
/users/profile:
get:
tags:
- Users
summary: User Profile
operationId: UserProfile
parameters: []
responses:
"200":
description: ""
headers: {}
deprecated: false
/users/addtocart:
post:
tags:
- Cart
summary: Add To Cart
operationId: AddToCart
parameters: []
requestBody:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/AddToCartRequest"
- example:
productId: 6304c1a727d822e2086928d9
quantity: 2
color: red
size: "41"
example:
productId: 6304c1a727d822e2086928d9
quantity: 2
color: red
size: "41"
required: true
responses:
"200":
description: ""
headers: {}
deprecated: false
/users/deletefromCart:
post:
tags:
- Cart
summary: Delete From Cart
operationId: DeleteFromCart
parameters: []
requestBody:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/DeleteFromCartRequest"
- example:
productId: 6307625fa0b7e3c126cc73f0
example:
productId: 6307625fa0b7e3c126cc73f0
required: true
responses:
"200":
description: ""
headers: {}
deprecated: false
/brands:
get:
tags:
- Brands
summary: All Brands
operationId: AllBrands
parameters: []
responses:
"200":
description: ""
headers: {}
deprecated: false
post:
tags:
- Brands
summary: Create Brand
operationId: CreateBrand
parameters: []
requestBody:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/CreateBrandRequest"
- example:
name: Brand 1
example:
name: Brand 1
required: true
responses:
"200":
description: ""
headers: {}
deprecated: false
/brands/{id}:
get:
tags:
- Brands
summary: One Brand
operationId: OneBrand
parameters:
- name: id
in: path
description: ""
required: true
style: simple
schema:
type: string
responses:
"200":
description: ""
headers: {}
deprecated: false
put:
tags:
- Brands
summary: Update Brand
operationId: UpdateBrand
parameters:
- name: id
in: path
description: ""
required: true
style: simple
schema:
type: string
requestBody:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/UpdateBrandRequest"
- example:
name: H&M
example:
name: H&M
required: true
responses:
"200":
description: ""
headers: {}
deprecated: false
/{id}:
delete:
tags:
- Brands
summary: Delete Brand
operationId: DeleteBrand
parameters:
- name: id
in: path
description: ""
required: true
style: simple
schema:
type: string
responses:
"200":
description: ""
headers: {}
deprecated: false
/categories:
get:
tags:
- Categories
summary: Get All Categories
operationId: GetAllCategories
parameters: []
responses:
"200":
description: ""
headers: {}
deprecated: false
security: []
post:
tags:
- Categories
summary: Create Category
operationId: CreateCategory
parameters: []
requestBody:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/CreateCategoryRequest"
- example:
name: Kids
example:
name: Kids
required: true
responses:
"200":
description: ""
headers: {}
deprecated: false
/categories/{id}:
get:
tags:
- Categories
summary: One Category
operationId: OneCategory
parameters:
- name: id
in: path
description: ""
required: true
style: simple
schema:
type: string
responses:
"200":
description: ""
headers: {}
deprecated: false
put:
tags:
- Categories
summary: Update Category
operationId: UpdateCategory
parameters:
- name: id
in: path
description: ""
required: true
style: simple
schema:
type: string
requestBody:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/UpdateCategoryRequest"
- example:
name: Women
example:
name: Women
required: true
responses:
"200":
description: ""
headers: {}
deprecated: false
delete:
tags:
- Categories
summary: Delete Category
operationId: DeleteCategory
parameters:
- name: id
in: path
description: ""
required: true
style: simple
schema:
type: string
responses:
"200":
description: ""
headers: {}
deprecated: false
/products:
get:
tags:
- Products
summary: Get All Products
operationId: GetAllProducts
parameters: []
responses:
"200":
description: ""
headers: {}
deprecated: false
security: []
post:
tags:
- Products
summary: Create Product
operationId: CreateProduct
parameters: []
requestBody:
content:
multipart/form-data:
encoding: {}
schema:
required:
- title
- brandId
- categoryId
- genreId
- typeId
- numberInStock
- price
- description
- sizes[0][sizeItem]
- sizes[1][sizeItem]
- sizes[2][sizeItem]
- colors[0][colorItem]
- colors[1][colorItem]
- colors[2][colorItem]
- images
type: object
properties:
title:
type: string
example: product tow
brandId:
type: string
example: 63023799758683a6a444b034
categoryId:
type: string
example: 63023db4850f8d413c0f1ba8
genreId:
type: string
example: 63023db4850f8d413c0f1ba8
typeId:
type: string
example: 63023db4850f8d413c0f1ba8
numberInStock:
type: integer
format: int32
example: 25
price:
type: integer
format: int32
example: 29
description:
type: string
example: "this is socend product "
sizes[0][sizeItem]:
type: integer
description: first size
format: int32
example: 42
sizes[1][sizeItem]:
type: integer
description: second size
format: int32
example: 40
sizes[2][sizeItem]:
type: integer
description: third size
format: int32
example: 41
colors[0][colorItem]:
type: string
description: first color
example: yellow
colors[1][colorItem]:
type: string
description: second color
example: red
colors[2][colorItem]:
type: string
description: third color
example: gray
images:
type: string
format: binary
required: false
responses:
"200":
description: ""
headers: {}
deprecated: false
/products/{id}:
get:
tags:
- Products
summary: One Product
operationId: OneProduct
parameters:
- name: id
in: path
description: ""
required: true
style: simple
schema:
type: string
responses:
"200":
description: ""
headers: {}
deprecated: false
patch:
tags:
- Products
summary: Update Product
operationId: UpdateProduct
parameters:
- name: id
in: path
description: ""
required: true
style: simple
schema:
type: string
requestBody:
content:
multipart/form-data:
encoding: {}
schema:
required:
- title
- Price
- Description
- brandId
- typeId
- categoryId
- genreId
- numberInStock
- sizes[0][sizeItem]
- sizes[1][sizeItem]
- sizes[2][sizeItem]
- colors[0][colorItem]
- colors[1][colorItem]
- colors[2][colorItem]
- images
type: object
properties:
title:
type: string
Price:
type: integer
format: int32
Description:
type: string
brandId:
type: string
typeId:
type: string
categoryId:
type: string
genreId:
type: string
numberInStock:
type: integer
format: int32
sizes[0][sizeItem]:
type: integer
description: first size
format: int32
example: 45
sizes[1][sizeItem]:
type: integer
description: second size
format: int32
example: 43
sizes[2][sizeItem]:
type: integer
description: third size
format: int32
example: 40
colors[0][colorItem]:
type: integer
description: first color
format: int32
colors[1][colorItem]:
type: integer
description: second color
format: int32
colors[2][colorItem]:
type: integer
description: third color
format: int32
images:
type: string
description: one or more
format: binary
required: false
responses:
"200":
description: ""
headers: {}
deprecated: false
delete:
tags:
- Products
summary: Delete Product
operationId: DeleteProduct
parameters:
- name: id
in: path
description: ""
required: true
style: simple
schema:
type: string
responses:
"200":
description: ""
headers: {}
deprecated: false
/products/{id}/like:
patch:
tags:
- Products
summary: Like / Dislike Product
operationId: Like/DislikeProduct
parameters:
- name: id
in: path
description: ""
required: true
style: simple
schema:
type: string
responses:
"200":
description: ""
headers: {}
deprecated: false
/orders:
get:
tags:
- Orders
summary: All Order Admin
operationId: AllOrderAdmin
parameters: []
responses:
"200":
description: ""
headers: {}
deprecated: false
post:
tags:
- Orders
summary: Create Order
operationId: CreateOrder
parameters: []
requestBody:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/CreateOrderRequest"
- example:
shippingAddress:
fullName: mary adam
phone: 0115-235-487
address: my adress
city: my city
postalCode: "11112"
country: my country
paymentMethod: paypal
shippingPrice: 10
taxPrice: 1.56
totalPrice: 81.56
itemsPrice: 70
example:
shippingAddress:
fullName: mary adam
phone: 0115-235-487
address: my adress
city: my city
postalCode: "11112"
country: my country
paymentMethod: paypal
shippingPrice: 10
taxPrice: 1.56
totalPrice: 81.56
itemsPrice: 70
required: true
responses:
"200":
description: ""
headers: {}
deprecated: false
/orders/me:
get:
tags:
- Orders
summary: User Orders
operationId: UserOrders
parameters: []
responses:
"200":
description: ""
headers: {}
deprecated: false
/orders/{id}:
get:
tags:
- Orders
summary: Get One Order Admin
operationId: GetOneOrderAdmin
parameters:
- name: id
in: path
description: ""
required: true
style: simple
schema:
type: string
responses:
"200":
description: ""
headers: {}
deprecated: false
delete:
tags:
- Orders
summary: Delete Order
operationId: DeleteOrder
parameters:
- name: id
in: path
description: ""
required: true
style: simple
schema:
type: string
responses:
"200":
description: ""
headers: {}
deprecated: false
/orders/{id}/pay:
put:
tags:
- Orders
summary: Pay Order
operationId: PayOrder
parameters:
- name: id
in: path
description: ""
required: true
style: simple
schema:
type: string
requestBody:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/PayOrderRequest"
- example:
source: tok_1Lc83GD9AuVai1xVmNSyOpYk
amount: 10000
currency: USD
example:
source: tok_1Lc83GD9AuVai1xVmNSyOpYk
amount: 10000
currency: USD
required: true
responses:
"200":
description: ""
headers: {}
deprecated: false
/orders/{id}/deliver:
put:
tags:
- Orders
summary: Deliver Order
operationId: DeliverOrder
parameters:
- name: id
in: path
description: ""
required: true
style: simple
schema:
type: string
responses:
"200":
description: ""
headers: {}
deprecated: false
/types:
get:
tags:
- Types
summary: Get All types
operationId: GetAlltypes
parameters: []
responses:
"200":
description: ""
headers: {}
deprecated: false
security: []
post:
tags:
- Types
summary: Create type
operationId: Createtype
parameters: []
requestBody:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/CreatetypeRequest"
- example:
name: Makeup
example:
name: Makeup
required: true
responses:
"200":
description: ""
headers: {}
deprecated: false
/types/{id}:
get:
tags:
- Types
summary: Get One Type
operationId: GetOneType
parameters:
- name: id
in: path
description: ""
required: true
style: simple
schema:
type: string
responses:
"200":
description: ""
headers: {}
deprecated: false
patch:
tags:
- Types
summary: Update Type
operationId: UpdateType
parameters:
- name: id
in: path
description: ""
required: true
style: simple
schema:
type: string
requestBody:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/UpdateTypeRequest"
- example:
name: Makeup
example:
name: Makeup
required: true
responses:
"200":
description: ""
headers: {}
deprecated: false
delete:
tags:
- Types
summary: Delete Type
operationId: DeleteType
parameters:
- name: id
in: path
description: ""
required: true
style: simple
schema:
type: string
responses:
"200":