1{
2 "consumes": [
3 "application/json"
4 ],
5 "produces": [
6 "application/json"
7 ],
8 "schemes": [
9 "http"
10 ],
11 "swagger": "2.0",
12 "info": {
13 "description": "This OAS2 (Swagger 2) file represents a real API that lives at http://todos.stoplight.io.\n\nFor authentication information, click the apikey security scheme in the editor sidebar.",
14 "title": "To-do Demo",
15 "contact": {
16 "name": "Stoplight",
17 "url": "https://stoplight.io"
18 },
19 "license": {
20 "name": "MIT"
21 },
22 "version": "1.0"
23 },
24 "host": "todos.stoplight.io",
25 "paths": {
26 "/todos": {
27 "get": {
28 "description": "",
29 "tags": [
30 "Todos"
31 ],
32 "summary": "List Todos",
33 "operationId": "GET_todos",
34 "parameters": [
35 {
36 "maximum": 100,
37 "type": "integer",
38 "description": "This is how it works.",
39 "name": "limit",
40 "in": "query"
41 },
42 {
43 "type": "string",
44 "name": "skip",
45 "in": "query"
46 }
47 ],
48 "responses": {
49 "200": {
50 "description": "",
51 "schema": {
52 "type": "array",
53 "items": {
54 "title": "Todo Full",
55 "allOf": [
56 {
57 "type": "object",
58 "title": "Todo Partial",
59 "required": [
60 "name",
61 "completed"
62 ],
63 "properties": {
64 "completed": {
65 "type": [
66 "boolean",
67 "null"
68 ]
69 },
70 "name": {
71 "type": "string"
72 }
73 }
74 },
75 {
76 "type": "object",
77 "required": [
78 "id",
79 "user"
80 ],
81 "properties": {
82 "completed_at": {
83 "type": [
84 "string",
85 "null"
86 ],
87 "format": "date-time"
88 },
89 "created_at": {
90 "type": "string",
91 "format": "date-time"
92 },
93 "id": {
94 "type": "integer",
95 "maximum": 1000000,
96 "minimum": 0
97 },
98 "updated_at": {
99 "type": "string",
100 "format": "date-time"
101 },
102 "user": {
103 "type": "object",
104 "title": "User",
105 "required": [
106 "name",
107 "age"
108 ],
109 "properties": {
110 "age": {
111 "type": "number",
112 "maximum": 150,
113 "minimum": 0
114 },
115 "error": {
116 "type": "object",
117 "title": "Error Response",
118 "required": [
119 "status",
120 "error"
121 ],
122 "properties": {
123 "error": {
124 "type": "string"
125 },
126 "status": {
127 "type": "string"
128 }
129 }
130 },
131 "name": {
132 "description": "The user's full name.",
133 "type": "string"
134 }
135 }
136 }
137 }
138 }
139 ]
140 }
141 },
142 "headers": {
143 "foo": {
144 "type": "string",
145 "default": "bar"
146 }
147 },
148 "examples": {
149 "application/json": [
150 {
151 "completed": true,
152 "id": 1,
153 "name": "design the thingz"
154 },
155 {
156 "completed": true,
157 "id": 2,
158 "name": "mock the thingz"
159 },
160 {
161 "completed": false,
162 "id": 3,
163 "name": "code the thingz"
164 }
165 ],
166 "empty": []
167 }
168 },
169 "500": {
170 "description": "",
171 "schema": {
172 "type": "object",
173 "title": "Error Response",
174 "required": [
175 "status",
176 "error"
177 ],
178 "properties": {
179 "error": {
180 "type": "string"
181 },
182 "status": {
183 "type": "string"
184 }
185 }
186 },
187 "examples": {
188 "application/json": {
189 "error": "Server Error",
190 "status": "500"
191 }
192 }
193 }
194 }
195 },
196 "post": {
197 "security": [
198 {
199 "API Key": []
200 },
201 {
202 "Basic": []
203 }
204 ],
205 "description": "This creates a Todo object.\n\nTesting `inline code`.",
206 "tags": [
207 "Todos"
208 ],
209 "summary": "Create Todo",
210 "operationId": "POST_todos",
211 "parameters": [
212 {
213 "name": "body",
214 "in": "body",
215 "schema": {
216 "type": "object",
217 "title": "Todo Partial",
218 "required": [
219 "name",
220 "completed"
221 ],
222 "properties": {
223 "completed": {
224 "type": [
225 "boolean",
226 "null"
227 ]
228 },
229 "name": {
230 "type": "string"
231 }
232 }
233 }
234 }
235 ],
236 "responses": {
237 "201": {
238 "description": "",
239 "schema": {
240 "title": "Todo Full",
241 "allOf": [
242 {
243 "type": "object",
244 "title": "Todo Partial",
245 "required": [
246 "name",
247 "completed"
248 ],
249 "properties": {
250 "completed": {
251 "type": [
252 "boolean",
253 "null"
254 ]
255 },
256 "name": {
257 "type": "string"
258 }
259 }
260 },
261 {
262 "type": "object",
263 "required": [
264 "id",
265 "user"
266 ],
267 "properties": {
268 "completed_at": {
269 "type": [
270 "string",
271 "null"
272 ],
273 "format": "date-time"
274 },
275 "created_at": {
276 "type": "string",
277 "format": "date-time"
278 },
279 "id": {
280 "type": "integer",
281 "maximum": 1000000,
282 "minimum": 0
283 },
284 "updated_at": {
285 "type": "string",
286 "format": "date-time"
287 },
288 "user": {
289 "type": "object",
290 "title": "User",
291 "required": [
292 "name",
293 "age"
294 ],
295 "properties": {
296 "age": {
297 "type": "number",
298 "maximum": 150,
299 "minimum": 0
300 },
301 "error": {
302 "type": "object",
303 "title": "Error Response",
304 "required": [
305 "status",
306 "error"
307 ],
308 "properties": {
309 "error": {
310 "type": "string"
311 },
312 "status": {
313 "type": "string"
314 }
315 }
316 },
317 "name": {
318 "description": "The user's full name.",
319 "type": "string"
320 }
321 }
322 }
323 }
324 }
325 ]
326 },
327 "examples": {
328 "/todos/chores": {
329 "completed": false,
330 "created_at": "2014-08-28T14:14:28.494Z",
331 "id": 9000,
332 "name": "Do Chores",
333 "updated_at": "2014-08-28T14:14:28.494Z"
334 },
335 "application/json": {
336 "completed": null,
337 "completed_at": null,
338 "created_at": "2014-08-28T14:14:28.494Z",
339 "id": 9000,
340 "name": "It's Over 9000!!!",
341 "updated_at": "2014-08-28T14:14:28.494Z"
342 }
343 }
344 },
345 "401": {
346 "description": "",
347 "schema": {
348 "type": "object",
349 "title": "Error Response",
350 "required": [
351 "status",
352 "error"
353 ],
354 "properties": {
355 "error": {
356 "type": "string"
357 },
358 "status": {
359 "type": "string"
360 }
361 }
362 },
363 "examples": {
364 "application/json": {
365 "error": "Not Authorized",
366 "status": "401"
367 }
368 }
369 },
370 "500": {
371 "description": "",
372 "schema": {
373 "type": "object",
374 "title": "Error Response",
375 "required": [
376 "status",
377 "error"
378 ],
379 "properties": {
380 "error": {
381 "type": "string"
382 },
383 "status": {
384 "type": "string"
385 }
386 }
387 },
388 "examples": {
389 "application/json": {
390 "error": "Server Error",
391 "status": "500"
392 }
393 }
394 }
395 }
396 }
397 },
398 "/todos/{todoId}": {
399 "get": {
400 "tags": [
401 "Todos"
402 ],
403 "summary": "Get Todo",
404 "operationId": "GET_todo",
405 "parameters": [
406 {
407 "name": "todoId",
408 "type": "string",
409 "in": "query",
410 "required": true
411 }
412 ],
413 "responses": {
414 "200": {
415 "description": "",
416 "schema": {
417 "title": "Todo Full",
418 "allOf": [
419 {
420 "type": "object",
421 "title": "Todo Partial",
422 "required": [
423 "name",
424 "completed"
425 ],
426 "properties": {
427 "completed": {
428 "type": [
429 "boolean",
430 "null"
431 ]
432 },
433 "name": {
434 "type": "string"
435 }
436 }
437 },
438 {
439 "type": "object",
440 "required": [
441 "id",
442 "user"
443 ],
444 "properties": {
445 "completed_at": {
446 "type": [
447 "string",
448 "null"
449 ],
450 "format": "date-time"
451 },
452 "created_at": {
453 "type": "string",
454 "format": "date-time"
455 },
456 "id": {
457 "type": "integer",
458 "maximum": 1000000,
459 "minimum": 0
460 },
461 "updated_at": {
462 "type": "string",
463 "format": "date-time"
464 },
465 "user": {
466 "type": "object",
467 "title": "User",
468 "required": [
469 "name",
470 "age"
471 ],
472 "properties": {
473 "age": {
474 "type": "number",
475 "maximum": 150,
476 "minimum": 0
477 },
478 "error": {
479 "type": "object",
480 "title": "Error Response",
481 "required": [
482 "status",
483 "error"
484 ],
485 "properties": {
486 "error": {
487 "type": "string"
488 },
489 "status": {
490 "type": "string"
491 }
492 }
493 },
494 "name": {
495 "description": "The user's full name.",
496 "type": "string"
497 }
498 }
499 }
500 }
501 }
502 ]
503 },
504 "examples": {
505 "/todos/chores": {
506 "completed": false,
507 "created_at": "2014-08-28T14:14:28.494Z",
508 "id": 9000,
509 "name": "Do Chores",
510 "updated_at": "2014-08-28T14:14:28.494Z"
511 },
512 "/todos/foobar": "{\n\t\"foo\": \"bar\"\n}\n",
513 "application/json": {
514 "completed": false,
515 "completed_at": "1955-04-23T13:22:52.685Z",
516 "created_at": "1994-11-05T03:26:51.471Z",
517 "id": 1,
518 "name": "get food",
519 "updated_at": "1989-07-29T11:30:06.701Z"
520 },
521 "new": {
522 "completed": null,
523 "completed_at": "2014-01-07T07:49:55.123Z",
524 "created_at": "1948-04-21T12:04:21.282Z",
525 "float": -47990796.228164576,
526 "id": 920778,
527 "name": "esse qui proident labore",
528 "updated_at": "1951-12-19T11:10:34.039Z",
529 "user": {
530 "age": 121.45395681110494,
531 "name": "irure deserunt fugiat"
532 }
533 }
534 }
535 },
536 "404": {
537 "description": "",
538 "schema": {
539 "type": "object",
540 "title": "Error Response",
541 "required": [
542 "status",
543 "error"
544 ],
545 "properties": {
546 "error": {
547 "type": "string"
548 },
549 "status": {
550 "type": "string"
551 }
552 }
553 },
554 "examples": {
555 "application/json": {
556 "error": "Not Found",
557 "status": "404"
558 }
559 }
560 },
561 "500": {
562 "description": "",
563 "schema": {
564 "type": "object",
565 "title": "Error Response",
566 "required": [
567 "status",
568 "error"
569 ],
570 "properties": {
571 "error": {
572 "type": "string"
573 },
574 "status": {
575 "type": "string"
576 }
577 }
578 },
579 "examples": {
580 "application/json": {
581 "error": "Server Error",
582 "status": "500"
583 }
584 }
585 }
586 }
587 },
588 "put": {
589 "security": [
590 {
591 "Basic": []
592 },
593 {
594 "API Key": []
595 }
596 ],
597 "tags": [
598 "Todos"
599 ],
600 "summary": "Update Todo",
601 "operationId": "PUT_todos",
602 "parameters": [
603 {
604 "name": "body",
605 "in": "body",
606 "schema": {
607 "type": "object",
608 "title": "Todo Partial",
609 "required": [
610 "name",
611 "completed"
612 ],
613 "properties": {
614 "completed": {
615 "type": [
616 "boolean",
617 "null"
618 ]
619 },
620 "name": {
621 "type": "string"
622 }
623 }
624 }
625 }
626 ],
627 "responses": {
628 "200": {
629 "description": "",
630 "schema": {
631 "title": "Todo Full",
632 "allOf": [
633 {
634 "type": "object",
635 "title": "Todo Partial",
636 "required": [
637 "name",
638 "completed"
639 ],
640 "properties": {
641 "completed": {
642 "type": [
643 "boolean",
644 "null"
645 ]
646 },
647 "name": {
648 "type": "string"
649 }
650 }
651 },
652 {
653 "type": "object",
654 "required": [
655 "id",
656 "user"
657 ],
658 "properties": {
659 "completed_at": {
660 "type": [
661 "string",
662 "null"
663 ],
664 "format": "date-time"
665 },
666 "created_at": {
667 "type": "string",
668 "format": "date-time"
669 },
670 "id": {
671 "type": "integer",
672 "maximum": 1000000,
673 "minimum": 0
674 },
675 "updated_at": {
676 "type": "string",
677 "format": "date-time"
678 },
679 "user": {
680 "type": "object",
681 "title": "User",
682 "required": [
683 "name",
684 "age"
685 ],
686 "properties": {
687 "age": {
688 "type": "number",
689 "maximum": 150,
690 "minimum": 0
691 },
692 "error": {
693 "type": "object",
694 "title": "Error Response",
695 "required": [
696 "status",
697 "error"
698 ],
699 "properties": {
700 "error": {
701 "type": "string"
702 },
703 "status": {
704 "type": "string"
705 }
706 }
707 },
708 "name": {
709 "description": "The user's full name.",
710 "type": "string"
711 }
712 }
713 }
714 }
715 }
716 ]
717 },
718 "examples": {
719 "application/json": {
720 "completed": true,
721 "completed_at": null,
722 "created_at": "2014-08-28T14:14:28.494Z",
723 "id": 9000,
724 "name": "It's Over 9000!!!",
725 "updated_at": "2015-08-28T14:14:28.494Z"
726 }
727 }
728 },
729 "401": {
730 "description": "",
731 "schema": {
732 "type": "object",
733 "title": "Error Response",
734 "required": [
735 "status",
736 "error"
737 ],
738 "properties": {
739 "error": {
740 "type": "string"
741 },
742 "status": {
743 "type": "string"
744 }
745 }
746 },
747 "examples": {
748 "application/json": {
749 "error": "Not Authorized",
750 "status": "401"
751 }
752 }
753 },
754 "404": {
755 "description": "",
756 "schema": {
757 "type": "object",
758 "title": "Error Response",
759 "required": [
760 "status",
761 "error"
762 ],
763 "properties": {
764 "error": {
765 "type": "string"
766 },
767 "status": {
768 "type": "string"
769 }
770 }
771 },
772 "examples": {
773 "application/json": {
774 "error": "Not Found",
775 "status": "404"
776 }
777 }
778 },
779 "500": {
780 "description": "",
781 "schema": {
782 "type": "object",
783 "title": "Error Response",
784 "required": [
785 "status",
786 "error"
787 ],
788 "properties": {
789 "error": {
790 "type": "string"
791 },
792 "status": {
793 "type": "string"
794 }
795 }
796 },
797 "examples": {
798 "application/json": {
799 "error": "Server Error",
800 "status": "500"
801 }
802 }
803 }
804 }
805 },
806 "delete": {
807 "security": [
808 {
809 "Basic": []
810 },
811 {
812 "API Key": []
813 }
814 ],
815 "tags": [
816 "Todos"
817 ],
818 "summary": "Delete Todo",
819 "operationId": "DELETE_todo",
820 "responses": {
821 "204": {
822 "description": ""
823 },
824 "401": {
825 "description": "",
826 "schema": {
827 "type": "object",
828 "title": "Error Response",
829 "required": [
830 "status",
831 "error"
832 ],
833 "properties": {
834 "error": {
835 "type": "string"
836 },
837 "status": {
838 "type": "string"
839 }
840 }
841 },
842 "examples": {
843 "application/json": {
844 "error": "Not Authorized",
845 "status": "401"
846 }
847 }
848 },
849 "404": {
850 "description": "",
851 "schema": {
852 "type": "object",
853 "title": "Error Response",
854 "required": [
855 "status",
856 "error"
857 ],
858 "properties": {
859 "error": {
860 "type": "string"
861 },
862 "status": {
863 "type": "string"
864 }
865 }
866 },
867 "examples": {
868 "application/json": {
869 "error": "Not Found",
870 "status": "404"
871 }
872 }
873 },
874 "500": {
875 "description": "",
876 "schema": {
877 "type": "object",
878 "title": "Error Response",
879 "required": [
880 "status",
881 "error"
882 ],
883 "properties": {
884 "error": {
885 "type": "string"
886 },
887 "status": {
888 "type": "string"
889 }
890 }
891 },
892 "examples": {
893 "application/json": {
894 "error": "Server Error",
895 "status": "500"
896 }
897 }
898 }
899 }
900 },
901 "parameters": [
902 {
903 "type": "string",
904 "name": "todoId",
905 "in": "path",
906 "required": true
907 }
908 ]
909 }
910 },
911 "definitions": {
912 "todo-full": {
913 "title": "Todo Full",
914 "allOf": [
915 {
916 "type": "object",
917 "title": "Todo Partial",
918 "required": [
919 "name",
920 "completed"
921 ],
922 "properties": {
923 "completed": {
924 "type": [
925 "boolean",
926 "null"
927 ]
928 },
929 "name": {
930 "type": "string"
931 }
932 }
933 },
934 {
935 "type": "object",
936 "required": [
937 "id",
938 "user"
939 ],
940 "properties": {
941 "completed_at": {
942 "type": [
943 "string",
944 "null"
945 ],
946 "format": "date-time"
947 },
948 "created_at": {
949 "type": "string",
950 "format": "date-time"
951 },
952 "id": {
953 "type": "integer",
954 "maximum": 1000000,
955 "minimum": 0
956 },
957 "updated_at": {
958 "type": "string",
959 "format": "date-time"
960 },
961 "user": {
962 "type": "object",
963 "title": "User",
964 "required": [
965 "name",
966 "age"
967 ],
968 "properties": {
969 "age": {
970 "type": "number",
971 "maximum": 150,
972 "minimum": 0
973 },
974 "error": {
975 "type": "object",
976 "title": "Error Response",
977 "required": [
978 "status",
979 "error"
980 ],
981 "properties": {
982 "error": {
983 "type": "string"
984 },
985 "status": {
986 "type": "string"
987 }
988 }
989 },
990 "name": {
991 "description": "The user's full name.",
992 "type": "string"
993 }
994 }
995 }
996 }
997 }
998 ]
999 },
1000 "todo-partial": {
1001 "type": "object",
1002 "title": "Todo Partial",
1003 "required": [
1004 "name",
1005 "completed"
1006 ],
1007 "properties": {
1008 "completed": {
1009 "type": [
1010 "boolean",
1011 "null"
1012 ]
1013 },
1014 "name": {
1015 "type": "string"
1016 }
1017 }
1018 }
1019 },
1020 "parameters": {
1021 "limit": {
1022 "maximum": 100,
1023 "type": "integer",
1024 "description": "This is how it works.",
1025 "name": "limit",
1026 "in": "query"
1027 },
1028 "skip": {
1029 "type": "string",
1030 "name": "skip",
1031 "in": "query"
1032 }
1033 },
1034 "securityDefinitions": {
1035 "API Key": {
1036 "type": "apiKey",
1037 "name": "apikey",
1038 "in": "query"
1039 },
1040 "Basic": {
1041 "type": "basic"
1042 }
1043 },
1044 "tags": [
1045 {
1046 "name": "Todos"
1047 }
1048 ]
1049}
View as plain text