Skip to content

Commit e3dc85b

Browse files
committed
Fixed spec file
1 parent 16a3629 commit e3dc85b

File tree

1 file changed

+108
-50
lines changed

1 file changed

+108
-50
lines changed

tests/resources/spec.json

Lines changed: 108 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,14 @@
4242
"summary": "Mock a get request for SDK tests",
4343
"operationId": "barGet",
4444
"consumes": ["application/json"],
45-
"produces": [],
45+
"produces": ["application/json"],
4646
"tags": ["bar"],
4747
"description": "",
4848
"responses": {
49-
"500": { "description": "File", "schema": { "type": "file" } }
49+
"200": {
50+
"description": "Mock",
51+
"schema": { "$ref": "#/definitions/mock" }
52+
}
5053
},
5154
"x-appwrite": {
5255
"method": "get",
@@ -95,11 +98,14 @@
9598
"summary": "Mock a post request for SDK tests",
9699
"operationId": "barPost",
97100
"consumes": ["application/json"],
98-
"produces": [],
101+
"produces": ["application/json"],
99102
"tags": ["bar"],
100103
"description": "",
101104
"responses": {
102-
"500": { "description": "File", "schema": { "type": "file" } }
105+
"200": {
106+
"description": "Mock",
107+
"schema": { "$ref": "#/definitions/mock" }
108+
}
103109
},
104110
"x-appwrite": {
105111
"method": "post",
@@ -152,11 +158,14 @@
152158
"summary": "Mock a put request for SDK tests",
153159
"operationId": "barPut",
154160
"consumes": ["application/json"],
155-
"produces": [],
161+
"produces": ["application/json"],
156162
"tags": ["bar"],
157163
"description": "",
158164
"responses": {
159-
"500": { "description": "File", "schema": { "type": "file" } }
165+
"200": {
166+
"description": "Mock",
167+
"schema": { "$ref": "#/definitions/mock" }
168+
}
160169
},
161170
"x-appwrite": {
162171
"method": "put",
@@ -209,11 +218,14 @@
209218
"summary": "Mock a patch request for SDK tests",
210219
"operationId": "barPatch",
211220
"consumes": ["application/json"],
212-
"produces": [],
221+
"produces": ["application/json"],
213222
"tags": ["bar"],
214223
"description": "",
215224
"responses": {
216-
"500": { "description": "File", "schema": { "type": "file" } }
225+
"200": {
226+
"description": "Mock",
227+
"schema": { "$ref": "#/definitions/mock" }
228+
}
217229
},
218230
"x-appwrite": {
219231
"method": "patch",
@@ -266,11 +278,14 @@
266278
"summary": "Mock a delete request for SDK tests",
267279
"operationId": "barDelete",
268280
"consumes": ["application/json"],
269-
"produces": [],
281+
"produces": ["application/json"],
270282
"tags": ["bar"],
271283
"description": "",
272284
"responses": {
273-
"500": { "description": "File", "schema": { "type": "file" } }
285+
"200": {
286+
"description": "Mock",
287+
"schema": { "$ref": "#/definitions/mock" }
288+
}
274289
},
275290
"x-appwrite": {
276291
"method": "delete",
@@ -325,11 +340,14 @@
325340
"summary": "Mock a get request for SDK tests",
326341
"operationId": "fooGet",
327342
"consumes": ["application/json"],
328-
"produces": [],
343+
"produces": ["application/json"],
329344
"tags": ["foo"],
330345
"description": "",
331346
"responses": {
332-
"500": { "description": "File", "schema": { "type": "file" } }
347+
"200": {
348+
"description": "Mock",
349+
"schema": { "$ref": "#/definitions/mock" }
350+
}
333351
},
334352
"x-appwrite": {
335353
"method": "get",
@@ -378,11 +396,14 @@
378396
"summary": "Mock a post request for SDK tests",
379397
"operationId": "fooPost",
380398
"consumes": ["application/json"],
381-
"produces": [],
399+
"produces": ["application/json"],
382400
"tags": ["foo"],
383401
"description": "",
384402
"responses": {
385-
"500": { "description": "File", "schema": { "type": "file" } }
403+
"200": {
404+
"description": "Mock",
405+
"schema": { "$ref": "#/definitions/mock" }
406+
}
386407
},
387408
"x-appwrite": {
388409
"method": "post",
@@ -435,11 +456,14 @@
435456
"summary": "Mock a put request for SDK tests",
436457
"operationId": "fooPut",
437458
"consumes": ["application/json"],
438-
"produces": [],
459+
"produces": ["application/json"],
439460
"tags": ["foo"],
440461
"description": "",
441462
"responses": {
442-
"500": { "description": "File", "schema": { "type": "file" } }
463+
"200": {
464+
"description": "Mock",
465+
"schema": { "$ref": "#/definitions/mock" }
466+
}
443467
},
444468
"x-appwrite": {
445469
"method": "put",
@@ -492,11 +516,14 @@
492516
"summary": "Mock a patch request for SDK tests",
493517
"operationId": "fooPatch",
494518
"consumes": ["application/json"],
495-
"produces": [],
519+
"produces": ["application/json"],
496520
"tags": ["foo"],
497521
"description": "",
498522
"responses": {
499-
"500": { "description": "File", "schema": { "type": "file" } }
523+
"200": {
524+
"description": "Mock",
525+
"schema": { "$ref": "#/definitions/mock" }
526+
}
500527
},
501528
"x-appwrite": {
502529
"method": "patch",
@@ -549,11 +576,14 @@
549576
"summary": "Mock a delete request for SDK tests",
550577
"operationId": "fooDelete",
551578
"consumes": ["application/json"],
552-
"produces": [],
579+
"produces": ["application/json"],
553580
"tags": ["foo"],
554581
"description": "",
555582
"responses": {
556-
"500": { "description": "File", "schema": { "type": "file" } }
583+
"200": {
584+
"description": "Mock",
585+
"schema": { "$ref": "#/definitions/mock" }
586+
}
557587
},
558588
"x-appwrite": {
559589
"method": "delete",
@@ -605,22 +635,25 @@
605635
},
606636
"/mock/tests/general/400-error": {
607637
"get": {
608-
"summary": "Mock a an 400 failed request",
638+
"summary": "400 Error",
609639
"operationId": "generalError400",
610640
"consumes": ["application/json"],
611-
"produces": [],
641+
"produces": ["application/json"],
612642
"tags": ["general"],
613643
"description": "",
614644
"responses": {
615-
"500": { "description": "File", "schema": { "type": "file" } }
645+
"400": {
646+
"description": "Error",
647+
"schema": { "$ref": "#/definitions/error" }
648+
}
616649
},
617650
"x-appwrite": {
618651
"method": "error400",
619652
"weight": 185,
620653
"cookies": false,
621654
"type": "",
622655
"demo": "general/error400.md",
623-
"edit": "https://github.com/appwrite/appwrite/edit/masterMock an 400 error",
656+
"edit": "https://github.com/appwrite/appwrite/edit/masterMock a an 400 failed request.",
624657
"rate-limit": 0,
625658
"rate-time": 3600,
626659
"rate-key": "url:{url},ip:{ip}",
@@ -633,22 +666,25 @@
633666
},
634667
"/mock/tests/general/500-error": {
635668
"get": {
636-
"summary": "Mock a an 500 failed request",
669+
"summary": "500 Error",
637670
"operationId": "generalError500",
638671
"consumes": ["application/json"],
639-
"produces": [],
672+
"produces": ["application/json"],
640673
"tags": ["general"],
641674
"description": "",
642675
"responses": {
643-
"500": { "description": "File", "schema": { "type": "file" } }
676+
"500": {
677+
"description": "Error",
678+
"schema": { "$ref": "#/definitions/error" }
679+
}
644680
},
645681
"x-appwrite": {
646682
"method": "error500",
647683
"weight": 186,
648684
"cookies": false,
649685
"type": "",
650686
"demo": "general/error500.md",
651-
"edit": "https://github.com/appwrite/appwrite/edit/masterMock an 500 error",
687+
"edit": "https://github.com/appwrite/appwrite/edit/masterMock a an 500 failed request.",
652688
"rate-limit": 0,
653689
"rate-time": 3600,
654690
"rate-key": "url:{url},ip:{ip}",
@@ -661,22 +697,20 @@
661697
},
662698
"/mock/tests/general/empty": {
663699
"get": {
664-
"summary": "Mock a post request for SDK tests",
700+
"summary": "Empty Response",
665701
"operationId": "generalEmpty",
666702
"consumes": ["application/json"],
667703
"produces": [],
668704
"tags": ["general"],
669705
"description": "",
670-
"responses": {
671-
"500": { "description": "File", "schema": { "type": "file" } }
672-
},
706+
"responses": { "204": { "description": "No content" } },
673707
"x-appwrite": {
674708
"method": "empty",
675709
"weight": 184,
676710
"cookies": false,
677711
"type": "",
678712
"demo": "general/empty.md",
679-
"edit": "https://github.com/appwrite/appwrite/edit/masterMock a redirected request for SDK tests",
713+
"edit": "https://github.com/appwrite/appwrite/edit/masterMock a an empty response body.",
680714
"rate-limit": 0,
681715
"rate-time": 3600,
682716
"rate-key": "url:{url},ip:{ip}",
@@ -689,22 +723,25 @@
689723
},
690724
"/mock/tests/general/get-cookie": {
691725
"get": {
692-
"summary": "Mock a cookie request for SDK tests",
726+
"summary": "Get Cookie",
693727
"operationId": "generalGetCookie",
694728
"consumes": ["application/json"],
695-
"produces": [],
729+
"produces": ["application/json"],
696730
"tags": ["general"],
697731
"description": "",
698732
"responses": {
699-
"500": { "description": "File", "schema": { "type": "file" } }
733+
"200": {
734+
"description": "Mock",
735+
"schema": { "$ref": "#/definitions/mock" }
736+
}
700737
},
701738
"x-appwrite": {
702739
"method": "getCookie",
703740
"weight": 183,
704741
"cookies": false,
705742
"type": "",
706743
"demo": "general/get-cookie.md",
707-
"edit": "https://github.com/appwrite/appwrite/edit/masterMock a get cookie request for SDK tests",
744+
"edit": "https://github.com/appwrite/appwrite/edit/masterMock a cookie response.",
708745
"rate-limit": 0,
709746
"rate-time": 3600,
710747
"rate-key": "url:{url},ip:{ip}",
@@ -717,14 +754,14 @@
717754
},
718755
"/mock/tests/general/redirect": {
719756
"get": {
720-
"summary": "Mock a post request for SDK tests",
757+
"summary": "Redirect",
721758
"operationId": "generalRedirect",
722759
"consumes": ["application/json"],
723-
"produces": [],
760+
"produces": ["text/html"],
724761
"tags": ["general"],
725762
"description": "",
726763
"responses": {
727-
"500": { "description": "File", "schema": { "type": "file" } }
764+
"301": { "description": "File", "schema": { "type": "file" } }
728765
},
729766
"x-appwrite": {
730767
"method": "redirect",
@@ -745,14 +782,17 @@
745782
},
746783
"/mock/tests/general/redirect/done": {
747784
"get": {
748-
"summary": "Mock a post request for SDK tests",
785+
"summary": "Redirect Target",
749786
"operationId": "generalRedirected",
750787
"consumes": ["application/json"],
751-
"produces": [],
788+
"produces": ["application/json"],
752789
"tags": ["general"],
753790
"description": "",
754791
"responses": {
755-
"500": { "description": "File", "schema": { "type": "file" } }
792+
"200": {
793+
"description": "Mock",
794+
"schema": { "$ref": "#/definitions/mock" }
795+
}
756796
},
757797
"x-appwrite": {
758798
"method": "redirected",
@@ -773,22 +813,25 @@
773813
},
774814
"/mock/tests/general/set-cookie": {
775815
"get": {
776-
"summary": "Mock a cookie request for SDK tests",
816+
"summary": "Set Cookie",
777817
"operationId": "generalSetCookie",
778818
"consumes": ["application/json"],
779-
"produces": [],
819+
"produces": ["application/json"],
780820
"tags": ["general"],
781821
"description": "",
782822
"responses": {
783-
"500": { "description": "File", "schema": { "type": "file" } }
823+
"200": {
824+
"description": "Mock",
825+
"schema": { "$ref": "#/definitions/mock" }
826+
}
784827
},
785828
"x-appwrite": {
786829
"method": "setCookie",
787830
"weight": 182,
788831
"cookies": false,
789832
"type": "",
790833
"demo": "general/set-cookie.md",
791-
"edit": "https://github.com/appwrite/appwrite/edit/masterMock a set cookie request for SDK tests",
834+
"edit": "https://github.com/appwrite/appwrite/edit/masterMock a set cookie request.",
792835
"rate-limit": 0,
793836
"rate-time": 3600,
794837
"rate-key": "url:{url},ip:{ip}",
@@ -801,14 +844,17 @@
801844
},
802845
"/mock/tests/general/upload": {
803846
"post": {
804-
"summary": "Mock a post request for SDK tests",
847+
"summary": "Upload File",
805848
"operationId": "generalUpload",
806849
"consumes": ["multipart/form-data"],
807-
"produces": [],
850+
"produces": ["application/json"],
808851
"tags": ["general"],
809852
"description": "",
810853
"responses": {
811-
"500": { "description": "File", "schema": { "type": "file" } }
854+
"200": {
855+
"description": "Mock",
856+
"schema": { "$ref": "#/definitions/mock" }
857+
}
812858
},
813859
"x-appwrite": {
814860
"method": "upload",
@@ -2210,6 +2256,18 @@
22102256
}
22112257
},
22122258
"required": ["code", "countryCode", "countryName"]
2259+
},
2260+
"mock": {
2261+
"description": "Mock",
2262+
"type": "object",
2263+
"properties": {
2264+
"result": {
2265+
"type": "string",
2266+
"description": "Result message.",
2267+
"x-example": "Success"
2268+
}
2269+
},
2270+
"required": ["result"]
22132271
}
22142272
},
22152273
"externalDocs": {

0 commit comments

Comments
 (0)