github.com/emreu/go-swagger@v0.22.1/examples/task-tracker/restapi/embedded_spec.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package restapi 4 5 // This file was generated by the swagger tool. 6 // Editing this file might prove futile when you re-run the swagger generate command 7 8 import ( 9 "encoding/json" 10 ) 11 12 var ( 13 // SwaggerJSON embedded version of the swagger document used at generation time 14 SwaggerJSON json.RawMessage 15 // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time 16 FlatSwaggerJSON json.RawMessage 17 ) 18 19 func init() { 20 SwaggerJSON = json.RawMessage([]byte(`{ 21 "consumes": [ 22 "application/vnd.goswagger.examples.task-tracker.v1+json" 23 ], 24 "produces": [ 25 "application/vnd.goswagger.examples.task-tracker.v1+json" 26 ], 27 "schemes": [ 28 "http", 29 "https" 30 ], 31 "swagger": "2.0", 32 "info": { 33 "description": "This application implements a very simple issue tracker.\nIt's implemented as an API which is described by this swagger spec document.\n\nThe go-swagger project uses this specification to test the code generation.\nThis document contains all possible values for a swagger definition.\nThis means that it exercises the framework relatively well.\n", 34 "title": "Issue Tracker API", 35 "termsOfService": "/termsOfService.html", 36 "contact": { 37 "name": "Issue Tracker API Team", 38 "url": "https://task-tracker.goswagger.io", 39 "email": "nobody@nowhere.com" 40 }, 41 "license": { 42 "name": "Apache 2.0", 43 "url": "http://www.apache.org/licenses/LICENSE-2.0.html" 44 }, 45 "version": "1.0.0" 46 }, 47 "host": "localhost:8322", 48 "basePath": "/api", 49 "paths": { 50 "/tasks": { 51 "get": { 52 "description": "Allows for specifying a number of filter parameters to\nnarrow down the results.\nAlso allows for specifying a **sinceId** and **pageSize** parameter\nto page through large result sets.\n", 53 "tags": [ 54 "tasks" 55 ], 56 "summary": "Lists the tasks", 57 "operationId": "listTasks", 58 "parameters": [ 59 { 60 "type": "integer", 61 "format": "int64", 62 "description": "The last id that was seen.", 63 "name": "sinceId", 64 "in": "query" 65 }, 66 { 67 "uniqueItems": true, 68 "type": "array", 69 "items": { 70 "type": "string" 71 }, 72 "description": "the tags to filter by", 73 "name": "tags", 74 "in": "query" 75 }, 76 { 77 "uniqueItems": true, 78 "type": "array", 79 "items": { 80 "enum": [ 81 "open", 82 "closed", 83 "ignored", 84 "rejected" 85 ], 86 "type": "string" 87 }, 88 "collectionFormat": "pipes", 89 "description": "the status to filter by", 90 "name": "status", 91 "in": "query" 92 }, 93 { 94 "$ref": "#/parameters/pageSize" 95 } 96 ], 97 "responses": { 98 "200": { 99 "description": "Successful response", 100 "schema": { 101 "type": "array", 102 "title": "TaskList", 103 "items": { 104 "$ref": "#/definitions/TaskCard" 105 } 106 }, 107 "headers": { 108 "X-Last-Task-Id": { 109 "type": "integer", 110 "format": "int64", 111 "description": "the last task id known to the application" 112 } 113 } 114 }, 115 "422": { 116 "description": "Validation error", 117 "schema": { 118 "$ref": "#/definitions/ValidationError" 119 } 120 }, 121 "default": { 122 "$ref": "#/responses/ErrorResponse" 123 } 124 } 125 }, 126 "post": { 127 "security": [ 128 { 129 "api_key": [] 130 }, 131 { 132 "token_header": [] 133 } 134 ], 135 "description": "Allows for creating a task.\nThis operation requires authentication so that we know which user\ncreated the task.\n", 136 "tags": [ 137 "tasks" 138 ], 139 "summary": "Creates a 'Task' object.", 140 "operationId": "createTask", 141 "parameters": [ 142 { 143 "description": "The task to create", 144 "name": "body", 145 "in": "body", 146 "required": true, 147 "schema": { 148 "$ref": "#/definitions/Task" 149 } 150 } 151 ], 152 "responses": { 153 "201": { 154 "description": "Task created" 155 }, 156 "default": { 157 "$ref": "#/responses/ErrorResponse" 158 } 159 } 160 } 161 }, 162 "/tasks/{id}": { 163 "get": { 164 "description": "The details view has more information than the card view.\nYou can see who reported the issue and who last updated it when.\n\nThere are also comments for each issue.\n", 165 "tags": [ 166 "tasks" 167 ], 168 "summary": "Gets the details for a task.", 169 "operationId": "getTaskDetails", 170 "responses": { 171 "200": { 172 "description": "Task details", 173 "schema": { 174 "$ref": "#/definitions/Task" 175 } 176 }, 177 "422": { 178 "description": "Validation error", 179 "schema": { 180 "$ref": "#/definitions/ValidationError" 181 } 182 }, 183 "default": { 184 "$ref": "#/responses/ErrorResponse" 185 } 186 } 187 }, 188 "put": { 189 "security": [ 190 { 191 "api_key": [] 192 }, 193 { 194 "token_header": [] 195 } 196 ], 197 "description": "Allows for updating a task.\nThis operation requires authentication so that we know which user\nlast updated the task.\n", 198 "tags": [ 199 "tasks" 200 ], 201 "summary": "Updates the details for a task.", 202 "operationId": "updateTask", 203 "parameters": [ 204 { 205 "description": "The task to update", 206 "name": "body", 207 "in": "body", 208 "required": true, 209 "schema": { 210 "$ref": "#/definitions/Task" 211 } 212 } 213 ], 214 "responses": { 215 "200": { 216 "description": "Task details", 217 "schema": { 218 "$ref": "#/definitions/Task" 219 } 220 }, 221 "422": { 222 "description": "Validation error", 223 "schema": { 224 "$ref": "#/definitions/ValidationError" 225 } 226 }, 227 "default": { 228 "$ref": "#/responses/ErrorResponse" 229 } 230 } 231 }, 232 "delete": { 233 "security": [ 234 { 235 "api_key": [] 236 }, 237 { 238 "token_header": [] 239 } 240 ], 241 "description": "This is a soft delete and changes the task status to ignored.\n", 242 "tags": [ 243 "tasks" 244 ], 245 "summary": "Deletes a task.", 246 "operationId": "deleteTask", 247 "responses": { 248 "204": { 249 "description": "Task deleted" 250 }, 251 "default": { 252 "$ref": "#/responses/ErrorResponse" 253 } 254 } 255 }, 256 "parameters": [ 257 { 258 "$ref": "#/parameters/idPathParam" 259 } 260 ] 261 }, 262 "/tasks/{id}/comments": { 263 "get": { 264 "description": "The comments require a size parameter.\n", 265 "tags": [ 266 "tasks" 267 ], 268 "summary": "Gets the comments for a task", 269 "operationId": "getTaskComments", 270 "parameters": [ 271 { 272 "$ref": "#/parameters/pageSize" 273 }, 274 { 275 "type": "string", 276 "format": "date-time", 277 "description": "The created time of the oldest seen comment", 278 "name": "since", 279 "in": "query" 280 } 281 ], 282 "responses": { 283 "200": { 284 "description": "The list of comments", 285 "schema": { 286 "type": "array", 287 "items": { 288 "$ref": "#/definitions/Comment" 289 } 290 } 291 }, 292 "default": { 293 "$ref": "#/responses/ErrorResponse" 294 } 295 } 296 }, 297 "post": { 298 "security": [ 299 { 300 "api_key": [] 301 }, 302 { 303 "token_header": [] 304 } 305 ], 306 "description": "The comment can contain ___github markdown___ syntax.\nFenced codeblocks etc are supported through pygments.\n", 307 "tags": [ 308 "tasks" 309 ], 310 "summary": "Adds a comment to a task", 311 "operationId": "addCommentToTask", 312 "parameters": [ 313 { 314 "$ref": "#/parameters/idPathParam" 315 }, 316 { 317 "description": "The comment to add", 318 "name": "body", 319 "in": "body", 320 "schema": { 321 "description": "These values can have github flavored markdown.\n", 322 "type": "object", 323 "title": "A comment to create", 324 "required": [ 325 "content", 326 "userId" 327 ], 328 "properties": { 329 "content": { 330 "type": "string" 331 }, 332 "userId": { 333 "type": "integer", 334 "format": "int64" 335 } 336 } 337 } 338 } 339 ], 340 "responses": { 341 "201": { 342 "description": "Comment added" 343 }, 344 "default": { 345 "$ref": "#/responses/ErrorResponse" 346 } 347 } 348 }, 349 "parameters": [ 350 { 351 "$ref": "#/parameters/idPathParam" 352 } 353 ] 354 }, 355 "/tasks/{id}/files": { 356 "post": { 357 "security": [ 358 { 359 "api_key": [] 360 }, 361 { 362 "token_header": [] 363 } 364 ], 365 "description": "The file can't be larger than **5MB**", 366 "consumes": [ 367 "multipart/form-data" 368 ], 369 "tags": [ 370 "tasks" 371 ], 372 "summary": "Adds a file to a task.", 373 "operationId": "uploadTaskFile", 374 "parameters": [ 375 { 376 "type": "file", 377 "description": "The file to upload", 378 "name": "file", 379 "in": "formData" 380 }, 381 { 382 "type": "string", 383 "description": "Extra information describing the file", 384 "name": "description", 385 "in": "formData" 386 } 387 ], 388 "responses": { 389 "201": { 390 "description": "File added" 391 }, 392 "default": { 393 "$ref": "#/responses/ErrorResponse" 394 } 395 } 396 }, 397 "parameters": [ 398 { 399 "$ref": "#/parameters/idPathParam" 400 } 401 ] 402 } 403 }, 404 "definitions": { 405 "Comment": { 406 "description": "Users can comment on issues to discuss plans for resolution etc.\n", 407 "type": "object", 408 "title": "A comment for an issue.", 409 "required": [ 410 "user", 411 "content" 412 ], 413 "properties": { 414 "content": { 415 "description": "This is a free text field with support for github flavored markdown.\n", 416 "type": "string", 417 "title": "The content of the comment." 418 }, 419 "createdAt": { 420 "description": "This field is autogenerated when the content is posted.", 421 "type": "string", 422 "format": "date-time", 423 "title": "The time at which this comment was created.", 424 "readOnly": true 425 }, 426 "user": { 427 "$ref": "#/definitions/UserCard" 428 } 429 } 430 }, 431 "Error": { 432 "description": "Contains all the properties any error response from the API will contain.\nSome properties are optional so might be empty most of the time\n", 433 "type": "object", 434 "title": "Error Structure", 435 "required": [ 436 "code", 437 "message" 438 ], 439 "properties": { 440 "code": { 441 "description": "the error code, this is not necessarily the http status code", 442 "type": "integer", 443 "format": "int32" 444 }, 445 "helpUrl": { 446 "description": "an optional url for getting more help about this error", 447 "type": "string", 448 "format": "uri" 449 }, 450 "message": { 451 "description": "a human readable version of the error", 452 "type": "string" 453 } 454 } 455 }, 456 "Milestone": { 457 "description": "Milestones can have a escription and due date.\nThis can be useful for filters and such.\n", 458 "type": "object", 459 "title": "A milestone is a particular goal that is important to the project for this issue tracker.", 460 "required": [ 461 "name" 462 ], 463 "properties": { 464 "description": { 465 "description": "A description is a free text field that allows for a more detailed explanation of what the milestone is trying to achieve.\n", 466 "type": "string", 467 "title": "The description of the milestone." 468 }, 469 "dueDate": { 470 "description": "This property is optional, but when present it lets people know when they can expect this milestone to be completed.\n", 471 "type": "string", 472 "format": "date", 473 "title": "An optional due date for this milestone." 474 }, 475 "name": { 476 "description": "Each milestone should get a unique name.\n", 477 "type": "string", 478 "title": "The name of the milestone.", 479 "maxLength": 50, 480 "minLength": 3, 481 "pattern": "[A-Za-z][\\w- ]+" 482 }, 483 "stats": { 484 "description": "This object contains counts for the remaining open issues and the amount of issues that have been closed.\n", 485 "type": "object", 486 "title": "Some counters for this milestone.", 487 "properties": { 488 "closed": { 489 "type": "integer", 490 "format": "int32", 491 "title": "The closed issues." 492 }, 493 "open": { 494 "type": "integer", 495 "format": "int32", 496 "title": "The remaining open issues." 497 }, 498 "total": { 499 "type": "integer", 500 "format": "int32", 501 "title": "The total number of issues for this milestone." 502 } 503 } 504 } 505 } 506 }, 507 "Task": { 508 "description": "A Task is the main entity in this application. Everything revolves around tasks and managing them.\n", 509 "type": "object", 510 "title": "a structure describing a complete task.", 511 "allOf": [ 512 { 513 "$ref": "#/definitions/TaskCard" 514 }, 515 { 516 "type": "object", 517 "properties": { 518 "attachments": { 519 "description": "An issue can have at most 20 files attached to it.\n", 520 "type": "object", 521 "title": "The attached files.", 522 "additionalProperties": { 523 "type": "object", 524 "maxProperties": 20, 525 "properties": { 526 "contentType": { 527 "description": "The content type of the file is inferred from the upload request.\n", 528 "type": "string", 529 "title": "The content type of the file.", 530 "readOnly": true 531 }, 532 "description": { 533 "description": "This is a free form text field with support for github flavored markdown.\n", 534 "type": "string", 535 "title": "Extra information to attach to the file.", 536 "minLength": 3 537 }, 538 "name": { 539 "description": "This name is inferred from the upload request.\n", 540 "type": "string", 541 "title": "The name of the file.", 542 "readOnly": true 543 }, 544 "size": { 545 "description": "This property was generated during the upload request of the file.", 546 "type": "number", 547 "format": "float64", 548 "title": "The file size in bytes.", 549 "readOnly": true 550 }, 551 "url": { 552 "description": "This URL is generated on the server, based on where it was able to store the file when it was uploaded.\n", 553 "type": "string", 554 "format": "uri", 555 "title": "The url to download or view the file.", 556 "readOnly": true 557 } 558 } 559 } 560 }, 561 "comments": { 562 "description": "The detail view of an issue includes the 5 most recent comments.\nThis field is read only, comments are added through a separate process.\n", 563 "type": "array", 564 "title": "The 5 most recent items for this issue.", 565 "items": { 566 "$ref": "#/definitions/Comment" 567 }, 568 "readOnly": true 569 }, 570 "lastUpdated": { 571 "description": "This field is read only so it's only sent as part of the response.\n", 572 "type": "string", 573 "format": "date-time", 574 "title": "The time at which this issue was last updated.", 575 "readOnly": true 576 }, 577 "lastUpdatedBy": { 578 "$ref": "#/definitions/UserCard" 579 }, 580 "reportedBy": { 581 "$ref": "#/definitions/UserCard" 582 } 583 } 584 } 585 ] 586 }, 587 "TaskCard": { 588 "description": "A task card is a minimalistic representation of a task. Useful for display in list views, like a card list.\n", 589 "type": "object", 590 "title": "a card for a task", 591 "required": [ 592 "title", 593 "status" 594 ], 595 "properties": { 596 "assignedTo": { 597 "$ref": "#/definitions/UserCard" 598 }, 599 "description": { 600 "description": "The task description is a longer, more detailed description of the issue.\nPerhaps it even mentions steps to reproduce.\n", 601 "type": "string", 602 "title": "The description of the task." 603 }, 604 "effort": { 605 "description": "the level of effort required to get this task completed", 606 "type": "integer", 607 "format": "int32", 608 "maximum": 27, 609 "multipleOf": 3 610 }, 611 "id": { 612 "description": "A unique identifier for the task. These are created in ascending order.", 613 "type": "integer", 614 "format": "int64", 615 "title": "The id of the task.", 616 "readOnly": true 617 }, 618 "karma": { 619 "description": "Karma is a lot like voting. Users can donate a certain amount or karma to an issue.\nThis is used to determine the weight users place on an issue. Not that +1 comments aren't great.\n", 620 "type": "number", 621 "format": "float32", 622 "title": "the karma donated to this item.", 623 "exclusiveMinimum": true, 624 "multipleOf": 0.5 625 }, 626 "milestone": { 627 "$ref": "#/definitions/Milestone" 628 }, 629 "reportedAt": { 630 "description": "This field is read-only, so it's only sent as part of the response.\n", 631 "type": "string", 632 "format": "date-time", 633 "title": "The time at which this issue was reported.", 634 "readOnly": true 635 }, 636 "severity": { 637 "type": "integer", 638 "format": "int32", 639 "maximum": 5, 640 "minimum": 1 641 }, 642 "status": { 643 "description": "There are 4 possible values for a status.\nIgnored means as much as accepted but not now, perhaps later.\n", 644 "type": "string", 645 "title": "the status of the issue", 646 "enum": [ 647 "open", 648 "closed", 649 "ignored", 650 "rejected" 651 ] 652 }, 653 "tags": { 654 "description": "a task can be tagged with text blurbs.", 655 "type": "array", 656 "title": "task tags.", 657 "maxItems": 5, 658 "uniqueItems": true, 659 "items": { 660 "type": "string", 661 "minLength": 3, 662 "pattern": "\\w[\\w- ]+" 663 } 664 }, 665 "title": { 666 "description": "The title for a task, this needs to be at least 5 chars long.\nTitles don't allow any formatting, besides emoji.\n", 667 "type": "string", 668 "title": "The title of the task.", 669 "maxLength": 150, 670 "minLength": 5 671 } 672 } 673 }, 674 "UserCard": { 675 "description": "This representation of a user is mainly meant for inclusion in other models, or for list views.\n", 676 "type": "object", 677 "title": "A minimal representation of a user.", 678 "required": [ 679 "id", 680 "screenName" 681 ], 682 "properties": { 683 "admin": { 684 "description": "Only employees of the owning company can be admins.\nAdmins are like project owners but have access to all the projects in the application.\nThere aren't many admins, and it's only used for extremly critical issues with the application.\n", 685 "type": "boolean", 686 "title": "When true this user is an admin.", 687 "readOnly": true 688 }, 689 "availableKarma": { 690 "description": "In this application users get a cerain amount of karma alotted.\nThis karma can be donated to other users to show appreciation, or it can be used\nby a user to vote on issues.\nOnce an issue is closed or rejected, the user gets his karma back.\n", 691 "type": "number", 692 "format": "float32", 693 "title": "The amount of karma this user has available.", 694 "maximum": 1000, 695 "exclusiveMaximum": true, 696 "readOnly": true 697 }, 698 "id": { 699 "description": "This id is automatically generated on the server when a user is created.\n", 700 "type": "integer", 701 "format": "int64", 702 "title": "A unique identifier for a user.", 703 "readOnly": true 704 }, 705 "screenName": { 706 "description": "This is used for vanity type urls as well as login credentials.\n", 707 "type": "string", 708 "title": "The screen name for the user.", 709 "maxLength": 255, 710 "minLength": 3, 711 "pattern": "\\w[\\w_-]+" 712 } 713 } 714 }, 715 "ValidationError": { 716 "allOf": [ 717 { 718 "$ref": "#/definitions/Error" 719 }, 720 { 721 "type": "object", 722 "properties": { 723 "field": { 724 "description": "an optional field name to which this validation error applies", 725 "type": "string" 726 } 727 } 728 } 729 ] 730 } 731 }, 732 "parameters": { 733 "idPathParam": { 734 "type": "integer", 735 "format": "int64", 736 "description": "The id of the item", 737 "name": "id", 738 "in": "path", 739 "required": true 740 }, 741 "pageSize": { 742 "type": "integer", 743 "format": "int32", 744 "default": 20, 745 "description": "Amount of items to return in a single page", 746 "name": "pageSize", 747 "in": "query" 748 } 749 }, 750 "responses": { 751 "ErrorResponse": { 752 "description": "Error response", 753 "schema": { 754 "$ref": "#/definitions/Error" 755 }, 756 "headers": { 757 "X-Error-Code": { 758 "type": "string" 759 } 760 } 761 } 762 }, 763 "securityDefinitions": { 764 "api_key": { 765 "type": "apiKey", 766 "name": "token", 767 "in": "query" 768 }, 769 "token_header": { 770 "type": "apiKey", 771 "name": "X-Token", 772 "in": "header" 773 } 774 }, 775 "tags": [ 776 { 777 "description": "manages tasks", 778 "name": "tasks", 779 "externalDocs": { 780 "description": "An extensive explanation on what is possible can be found in the\nsupport site for this application.\n", 781 "url": "https://go-swagger.github.io/examples/tasklist/help/tasks.html" 782 } 783 }, 784 { 785 "description": "manages milestones", 786 "name": "milestones", 787 "externalDocs": { 788 "description": "An extensive explanation on what is possible can be found in the\nsupport site for this application.\n", 789 "url": "https://go-swagger.github.io/examples/tasklist/help/milestones.html" 790 } 791 } 792 ], 793 "externalDocs": { 794 "description": "A much more elaborate guide to this application is available at the support\nsite.\n", 795 "url": "https://go-swagger.github.io/examples/tasklist/help/tasks.html" 796 } 797 }`)) 798 FlatSwaggerJSON = json.RawMessage([]byte(`{ 799 "consumes": [ 800 "application/vnd.goswagger.examples.task-tracker.v1+json" 801 ], 802 "produces": [ 803 "application/vnd.goswagger.examples.task-tracker.v1+json" 804 ], 805 "schemes": [ 806 "http", 807 "https" 808 ], 809 "swagger": "2.0", 810 "info": { 811 "description": "This application implements a very simple issue tracker.\nIt's implemented as an API which is described by this swagger spec document.\n\nThe go-swagger project uses this specification to test the code generation.\nThis document contains all possible values for a swagger definition.\nThis means that it exercises the framework relatively well.\n", 812 "title": "Issue Tracker API", 813 "termsOfService": "/termsOfService.html", 814 "contact": { 815 "name": "Issue Tracker API Team", 816 "url": "https://task-tracker.goswagger.io", 817 "email": "nobody@nowhere.com" 818 }, 819 "license": { 820 "name": "Apache 2.0", 821 "url": "http://www.apache.org/licenses/LICENSE-2.0.html" 822 }, 823 "version": "1.0.0" 824 }, 825 "host": "localhost:8322", 826 "basePath": "/api", 827 "paths": { 828 "/tasks": { 829 "get": { 830 "description": "Allows for specifying a number of filter parameters to\nnarrow down the results.\nAlso allows for specifying a **sinceId** and **pageSize** parameter\nto page through large result sets.\n", 831 "tags": [ 832 "tasks" 833 ], 834 "summary": "Lists the tasks", 835 "operationId": "listTasks", 836 "parameters": [ 837 { 838 "type": "integer", 839 "format": "int64", 840 "description": "The last id that was seen.", 841 "name": "sinceId", 842 "in": "query" 843 }, 844 { 845 "uniqueItems": true, 846 "type": "array", 847 "items": { 848 "type": "string" 849 }, 850 "description": "the tags to filter by", 851 "name": "tags", 852 "in": "query" 853 }, 854 { 855 "uniqueItems": true, 856 "type": "array", 857 "items": { 858 "enum": [ 859 "open", 860 "closed", 861 "ignored", 862 "rejected" 863 ], 864 "type": "string" 865 }, 866 "collectionFormat": "pipes", 867 "description": "the status to filter by", 868 "name": "status", 869 "in": "query" 870 }, 871 { 872 "type": "integer", 873 "format": "int32", 874 "default": 20, 875 "description": "Amount of items to return in a single page", 876 "name": "pageSize", 877 "in": "query" 878 } 879 ], 880 "responses": { 881 "200": { 882 "description": "Successful response", 883 "schema": { 884 "type": "array", 885 "title": "TaskList", 886 "items": { 887 "$ref": "#/definitions/TaskCard" 888 } 889 }, 890 "headers": { 891 "X-Last-Task-Id": { 892 "type": "integer", 893 "format": "int64", 894 "description": "the last task id known to the application" 895 } 896 } 897 }, 898 "422": { 899 "description": "Validation error", 900 "schema": { 901 "$ref": "#/definitions/ValidationError" 902 } 903 }, 904 "default": { 905 "description": "Error response", 906 "schema": { 907 "$ref": "#/definitions/Error" 908 }, 909 "headers": { 910 "X-Error-Code": { 911 "type": "string" 912 } 913 } 914 } 915 } 916 }, 917 "post": { 918 "security": [ 919 { 920 "api_key": [] 921 }, 922 { 923 "token_header": [] 924 } 925 ], 926 "description": "Allows for creating a task.\nThis operation requires authentication so that we know which user\ncreated the task.\n", 927 "tags": [ 928 "tasks" 929 ], 930 "summary": "Creates a 'Task' object.", 931 "operationId": "createTask", 932 "parameters": [ 933 { 934 "description": "The task to create", 935 "name": "body", 936 "in": "body", 937 "required": true, 938 "schema": { 939 "$ref": "#/definitions/Task" 940 } 941 } 942 ], 943 "responses": { 944 "201": { 945 "description": "Task created" 946 }, 947 "default": { 948 "description": "Error response", 949 "schema": { 950 "$ref": "#/definitions/Error" 951 }, 952 "headers": { 953 "X-Error-Code": { 954 "type": "string" 955 } 956 } 957 } 958 } 959 } 960 }, 961 "/tasks/{id}": { 962 "get": { 963 "description": "The details view has more information than the card view.\nYou can see who reported the issue and who last updated it when.\n\nThere are also comments for each issue.\n", 964 "tags": [ 965 "tasks" 966 ], 967 "summary": "Gets the details for a task.", 968 "operationId": "getTaskDetails", 969 "responses": { 970 "200": { 971 "description": "Task details", 972 "schema": { 973 "$ref": "#/definitions/Task" 974 } 975 }, 976 "422": { 977 "description": "Validation error", 978 "schema": { 979 "$ref": "#/definitions/ValidationError" 980 } 981 }, 982 "default": { 983 "description": "Error response", 984 "schema": { 985 "$ref": "#/definitions/Error" 986 }, 987 "headers": { 988 "X-Error-Code": { 989 "type": "string" 990 } 991 } 992 } 993 } 994 }, 995 "put": { 996 "security": [ 997 { 998 "api_key": [] 999 }, 1000 { 1001 "token_header": [] 1002 } 1003 ], 1004 "description": "Allows for updating a task.\nThis operation requires authentication so that we know which user\nlast updated the task.\n", 1005 "tags": [ 1006 "tasks" 1007 ], 1008 "summary": "Updates the details for a task.", 1009 "operationId": "updateTask", 1010 "parameters": [ 1011 { 1012 "description": "The task to update", 1013 "name": "body", 1014 "in": "body", 1015 "required": true, 1016 "schema": { 1017 "$ref": "#/definitions/Task" 1018 } 1019 } 1020 ], 1021 "responses": { 1022 "200": { 1023 "description": "Task details", 1024 "schema": { 1025 "$ref": "#/definitions/Task" 1026 } 1027 }, 1028 "422": { 1029 "description": "Validation error", 1030 "schema": { 1031 "$ref": "#/definitions/ValidationError" 1032 } 1033 }, 1034 "default": { 1035 "description": "Error response", 1036 "schema": { 1037 "$ref": "#/definitions/Error" 1038 }, 1039 "headers": { 1040 "X-Error-Code": { 1041 "type": "string" 1042 } 1043 } 1044 } 1045 } 1046 }, 1047 "delete": { 1048 "security": [ 1049 { 1050 "api_key": [] 1051 }, 1052 { 1053 "token_header": [] 1054 } 1055 ], 1056 "description": "This is a soft delete and changes the task status to ignored.\n", 1057 "tags": [ 1058 "tasks" 1059 ], 1060 "summary": "Deletes a task.", 1061 "operationId": "deleteTask", 1062 "responses": { 1063 "204": { 1064 "description": "Task deleted" 1065 }, 1066 "default": { 1067 "description": "Error response", 1068 "schema": { 1069 "$ref": "#/definitions/Error" 1070 }, 1071 "headers": { 1072 "X-Error-Code": { 1073 "type": "string" 1074 } 1075 } 1076 } 1077 } 1078 }, 1079 "parameters": [ 1080 { 1081 "type": "integer", 1082 "format": "int64", 1083 "description": "The id of the item", 1084 "name": "id", 1085 "in": "path", 1086 "required": true 1087 } 1088 ] 1089 }, 1090 "/tasks/{id}/comments": { 1091 "get": { 1092 "description": "The comments require a size parameter.\n", 1093 "tags": [ 1094 "tasks" 1095 ], 1096 "summary": "Gets the comments for a task", 1097 "operationId": "getTaskComments", 1098 "parameters": [ 1099 { 1100 "type": "integer", 1101 "format": "int32", 1102 "default": 20, 1103 "description": "Amount of items to return in a single page", 1104 "name": "pageSize", 1105 "in": "query" 1106 }, 1107 { 1108 "type": "string", 1109 "format": "date-time", 1110 "description": "The created time of the oldest seen comment", 1111 "name": "since", 1112 "in": "query" 1113 } 1114 ], 1115 "responses": { 1116 "200": { 1117 "description": "The list of comments", 1118 "schema": { 1119 "type": "array", 1120 "items": { 1121 "$ref": "#/definitions/Comment" 1122 } 1123 } 1124 }, 1125 "default": { 1126 "description": "Error response", 1127 "schema": { 1128 "$ref": "#/definitions/Error" 1129 }, 1130 "headers": { 1131 "X-Error-Code": { 1132 "type": "string" 1133 } 1134 } 1135 } 1136 } 1137 }, 1138 "post": { 1139 "security": [ 1140 { 1141 "api_key": [] 1142 }, 1143 { 1144 "token_header": [] 1145 } 1146 ], 1147 "description": "The comment can contain ___github markdown___ syntax.\nFenced codeblocks etc are supported through pygments.\n", 1148 "tags": [ 1149 "tasks" 1150 ], 1151 "summary": "Adds a comment to a task", 1152 "operationId": "addCommentToTask", 1153 "parameters": [ 1154 { 1155 "type": "integer", 1156 "format": "int64", 1157 "description": "The id of the item", 1158 "name": "id", 1159 "in": "path", 1160 "required": true 1161 }, 1162 { 1163 "description": "The comment to add", 1164 "name": "body", 1165 "in": "body", 1166 "schema": { 1167 "description": "These values can have github flavored markdown.\n", 1168 "type": "object", 1169 "title": "A comment to create", 1170 "required": [ 1171 "content", 1172 "userId" 1173 ], 1174 "properties": { 1175 "content": { 1176 "type": "string" 1177 }, 1178 "userId": { 1179 "type": "integer", 1180 "format": "int64" 1181 } 1182 } 1183 } 1184 } 1185 ], 1186 "responses": { 1187 "201": { 1188 "description": "Comment added" 1189 }, 1190 "default": { 1191 "description": "Error response", 1192 "schema": { 1193 "$ref": "#/definitions/Error" 1194 }, 1195 "headers": { 1196 "X-Error-Code": { 1197 "type": "string" 1198 } 1199 } 1200 } 1201 } 1202 }, 1203 "parameters": [ 1204 { 1205 "type": "integer", 1206 "format": "int64", 1207 "description": "The id of the item", 1208 "name": "id", 1209 "in": "path", 1210 "required": true 1211 } 1212 ] 1213 }, 1214 "/tasks/{id}/files": { 1215 "post": { 1216 "security": [ 1217 { 1218 "api_key": [] 1219 }, 1220 { 1221 "token_header": [] 1222 } 1223 ], 1224 "description": "The file can't be larger than **5MB**", 1225 "consumes": [ 1226 "multipart/form-data" 1227 ], 1228 "tags": [ 1229 "tasks" 1230 ], 1231 "summary": "Adds a file to a task.", 1232 "operationId": "uploadTaskFile", 1233 "parameters": [ 1234 { 1235 "type": "file", 1236 "description": "The file to upload", 1237 "name": "file", 1238 "in": "formData" 1239 }, 1240 { 1241 "type": "string", 1242 "description": "Extra information describing the file", 1243 "name": "description", 1244 "in": "formData" 1245 } 1246 ], 1247 "responses": { 1248 "201": { 1249 "description": "File added" 1250 }, 1251 "default": { 1252 "description": "Error response", 1253 "schema": { 1254 "$ref": "#/definitions/Error" 1255 }, 1256 "headers": { 1257 "X-Error-Code": { 1258 "type": "string" 1259 } 1260 } 1261 } 1262 } 1263 }, 1264 "parameters": [ 1265 { 1266 "type": "integer", 1267 "format": "int64", 1268 "description": "The id of the item", 1269 "name": "id", 1270 "in": "path", 1271 "required": true 1272 } 1273 ] 1274 } 1275 }, 1276 "definitions": { 1277 "Comment": { 1278 "description": "Users can comment on issues to discuss plans for resolution etc.\n", 1279 "type": "object", 1280 "title": "A comment for an issue.", 1281 "required": [ 1282 "user", 1283 "content" 1284 ], 1285 "properties": { 1286 "content": { 1287 "description": "This is a free text field with support for github flavored markdown.\n", 1288 "type": "string", 1289 "title": "The content of the comment." 1290 }, 1291 "createdAt": { 1292 "description": "This field is autogenerated when the content is posted.", 1293 "type": "string", 1294 "format": "date-time", 1295 "title": "The time at which this comment was created.", 1296 "readOnly": true 1297 }, 1298 "user": { 1299 "$ref": "#/definitions/UserCard" 1300 } 1301 } 1302 }, 1303 "Error": { 1304 "description": "Contains all the properties any error response from the API will contain.\nSome properties are optional so might be empty most of the time\n", 1305 "type": "object", 1306 "title": "Error Structure", 1307 "required": [ 1308 "code", 1309 "message" 1310 ], 1311 "properties": { 1312 "code": { 1313 "description": "the error code, this is not necessarily the http status code", 1314 "type": "integer", 1315 "format": "int32" 1316 }, 1317 "helpUrl": { 1318 "description": "an optional url for getting more help about this error", 1319 "type": "string", 1320 "format": "uri" 1321 }, 1322 "message": { 1323 "description": "a human readable version of the error", 1324 "type": "string" 1325 } 1326 } 1327 }, 1328 "Milestone": { 1329 "description": "Milestones can have a escription and due date.\nThis can be useful for filters and such.\n", 1330 "type": "object", 1331 "title": "A milestone is a particular goal that is important to the project for this issue tracker.", 1332 "required": [ 1333 "name" 1334 ], 1335 "properties": { 1336 "description": { 1337 "description": "A description is a free text field that allows for a more detailed explanation of what the milestone is trying to achieve.\n", 1338 "type": "string", 1339 "title": "The description of the milestone." 1340 }, 1341 "dueDate": { 1342 "description": "This property is optional, but when present it lets people know when they can expect this milestone to be completed.\n", 1343 "type": "string", 1344 "format": "date", 1345 "title": "An optional due date for this milestone." 1346 }, 1347 "name": { 1348 "description": "Each milestone should get a unique name.\n", 1349 "type": "string", 1350 "title": "The name of the milestone.", 1351 "maxLength": 50, 1352 "minLength": 3, 1353 "pattern": "[A-Za-z][\\w- ]+" 1354 }, 1355 "stats": { 1356 "description": "This object contains counts for the remaining open issues and the amount of issues that have been closed.\n", 1357 "type": "object", 1358 "title": "Some counters for this milestone.", 1359 "properties": { 1360 "closed": { 1361 "type": "integer", 1362 "format": "int32", 1363 "title": "The closed issues." 1364 }, 1365 "open": { 1366 "type": "integer", 1367 "format": "int32", 1368 "title": "The remaining open issues." 1369 }, 1370 "total": { 1371 "type": "integer", 1372 "format": "int32", 1373 "title": "The total number of issues for this milestone." 1374 } 1375 } 1376 } 1377 } 1378 }, 1379 "Task": { 1380 "description": "A Task is the main entity in this application. Everything revolves around tasks and managing them.\n", 1381 "type": "object", 1382 "title": "a structure describing a complete task.", 1383 "allOf": [ 1384 { 1385 "$ref": "#/definitions/TaskCard" 1386 }, 1387 { 1388 "type": "object", 1389 "properties": { 1390 "attachments": { 1391 "description": "An issue can have at most 20 files attached to it.\n", 1392 "type": "object", 1393 "title": "The attached files.", 1394 "additionalProperties": { 1395 "type": "object", 1396 "maxProperties": 20, 1397 "properties": { 1398 "contentType": { 1399 "description": "The content type of the file is inferred from the upload request.\n", 1400 "type": "string", 1401 "title": "The content type of the file.", 1402 "readOnly": true 1403 }, 1404 "description": { 1405 "description": "This is a free form text field with support for github flavored markdown.\n", 1406 "type": "string", 1407 "title": "Extra information to attach to the file.", 1408 "minLength": 3 1409 }, 1410 "name": { 1411 "description": "This name is inferred from the upload request.\n", 1412 "type": "string", 1413 "title": "The name of the file.", 1414 "readOnly": true 1415 }, 1416 "size": { 1417 "description": "This property was generated during the upload request of the file.", 1418 "type": "number", 1419 "format": "float64", 1420 "title": "The file size in bytes.", 1421 "readOnly": true 1422 }, 1423 "url": { 1424 "description": "This URL is generated on the server, based on where it was able to store the file when it was uploaded.\n", 1425 "type": "string", 1426 "format": "uri", 1427 "title": "The url to download or view the file.", 1428 "readOnly": true 1429 } 1430 } 1431 } 1432 }, 1433 "comments": { 1434 "description": "The detail view of an issue includes the 5 most recent comments.\nThis field is read only, comments are added through a separate process.\n", 1435 "type": "array", 1436 "title": "The 5 most recent items for this issue.", 1437 "items": { 1438 "$ref": "#/definitions/Comment" 1439 }, 1440 "readOnly": true 1441 }, 1442 "lastUpdated": { 1443 "description": "This field is read only so it's only sent as part of the response.\n", 1444 "type": "string", 1445 "format": "date-time", 1446 "title": "The time at which this issue was last updated.", 1447 "readOnly": true 1448 }, 1449 "lastUpdatedBy": { 1450 "$ref": "#/definitions/UserCard" 1451 }, 1452 "reportedBy": { 1453 "$ref": "#/definitions/UserCard" 1454 } 1455 } 1456 } 1457 ] 1458 }, 1459 "TaskCard": { 1460 "description": "A task card is a minimalistic representation of a task. Useful for display in list views, like a card list.\n", 1461 "type": "object", 1462 "title": "a card for a task", 1463 "required": [ 1464 "title", 1465 "status" 1466 ], 1467 "properties": { 1468 "assignedTo": { 1469 "$ref": "#/definitions/UserCard" 1470 }, 1471 "description": { 1472 "description": "The task description is a longer, more detailed description of the issue.\nPerhaps it even mentions steps to reproduce.\n", 1473 "type": "string", 1474 "title": "The description of the task." 1475 }, 1476 "effort": { 1477 "description": "the level of effort required to get this task completed", 1478 "type": "integer", 1479 "format": "int32", 1480 "maximum": 27, 1481 "multipleOf": 3 1482 }, 1483 "id": { 1484 "description": "A unique identifier for the task. These are created in ascending order.", 1485 "type": "integer", 1486 "format": "int64", 1487 "title": "The id of the task.", 1488 "readOnly": true 1489 }, 1490 "karma": { 1491 "description": "Karma is a lot like voting. Users can donate a certain amount or karma to an issue.\nThis is used to determine the weight users place on an issue. Not that +1 comments aren't great.\n", 1492 "type": "number", 1493 "format": "float32", 1494 "title": "the karma donated to this item.", 1495 "minimum": 0, 1496 "exclusiveMinimum": true, 1497 "multipleOf": 0.5 1498 }, 1499 "milestone": { 1500 "$ref": "#/definitions/Milestone" 1501 }, 1502 "reportedAt": { 1503 "description": "This field is read-only, so it's only sent as part of the response.\n", 1504 "type": "string", 1505 "format": "date-time", 1506 "title": "The time at which this issue was reported.", 1507 "readOnly": true 1508 }, 1509 "severity": { 1510 "type": "integer", 1511 "format": "int32", 1512 "maximum": 5, 1513 "minimum": 1 1514 }, 1515 "status": { 1516 "description": "There are 4 possible values for a status.\nIgnored means as much as accepted but not now, perhaps later.\n", 1517 "type": "string", 1518 "title": "the status of the issue", 1519 "enum": [ 1520 "open", 1521 "closed", 1522 "ignored", 1523 "rejected" 1524 ] 1525 }, 1526 "tags": { 1527 "description": "a task can be tagged with text blurbs.", 1528 "type": "array", 1529 "title": "task tags.", 1530 "maxItems": 5, 1531 "uniqueItems": true, 1532 "items": { 1533 "type": "string", 1534 "minLength": 3, 1535 "pattern": "\\w[\\w- ]+" 1536 } 1537 }, 1538 "title": { 1539 "description": "The title for a task, this needs to be at least 5 chars long.\nTitles don't allow any formatting, besides emoji.\n", 1540 "type": "string", 1541 "title": "The title of the task.", 1542 "maxLength": 150, 1543 "minLength": 5 1544 } 1545 } 1546 }, 1547 "UserCard": { 1548 "description": "This representation of a user is mainly meant for inclusion in other models, or for list views.\n", 1549 "type": "object", 1550 "title": "A minimal representation of a user.", 1551 "required": [ 1552 "id", 1553 "screenName" 1554 ], 1555 "properties": { 1556 "admin": { 1557 "description": "Only employees of the owning company can be admins.\nAdmins are like project owners but have access to all the projects in the application.\nThere aren't many admins, and it's only used for extremly critical issues with the application.\n", 1558 "type": "boolean", 1559 "title": "When true this user is an admin.", 1560 "readOnly": true 1561 }, 1562 "availableKarma": { 1563 "description": "In this application users get a cerain amount of karma alotted.\nThis karma can be donated to other users to show appreciation, or it can be used\nby a user to vote on issues.\nOnce an issue is closed or rejected, the user gets his karma back.\n", 1564 "type": "number", 1565 "format": "float32", 1566 "title": "The amount of karma this user has available.", 1567 "maximum": 1000, 1568 "exclusiveMaximum": true, 1569 "readOnly": true 1570 }, 1571 "id": { 1572 "description": "This id is automatically generated on the server when a user is created.\n", 1573 "type": "integer", 1574 "format": "int64", 1575 "title": "A unique identifier for a user.", 1576 "readOnly": true 1577 }, 1578 "screenName": { 1579 "description": "This is used for vanity type urls as well as login credentials.\n", 1580 "type": "string", 1581 "title": "The screen name for the user.", 1582 "maxLength": 255, 1583 "minLength": 3, 1584 "pattern": "\\w[\\w_-]+" 1585 } 1586 } 1587 }, 1588 "ValidationError": { 1589 "allOf": [ 1590 { 1591 "$ref": "#/definitions/Error" 1592 }, 1593 { 1594 "type": "object", 1595 "properties": { 1596 "field": { 1597 "description": "an optional field name to which this validation error applies", 1598 "type": "string" 1599 } 1600 } 1601 } 1602 ] 1603 } 1604 }, 1605 "parameters": { 1606 "idPathParam": { 1607 "type": "integer", 1608 "format": "int64", 1609 "description": "The id of the item", 1610 "name": "id", 1611 "in": "path", 1612 "required": true 1613 }, 1614 "pageSize": { 1615 "type": "integer", 1616 "format": "int32", 1617 "default": 20, 1618 "description": "Amount of items to return in a single page", 1619 "name": "pageSize", 1620 "in": "query" 1621 } 1622 }, 1623 "responses": { 1624 "ErrorResponse": { 1625 "description": "Error response", 1626 "schema": { 1627 "$ref": "#/definitions/Error" 1628 }, 1629 "headers": { 1630 "X-Error-Code": { 1631 "type": "string" 1632 } 1633 } 1634 } 1635 }, 1636 "securityDefinitions": { 1637 "api_key": { 1638 "type": "apiKey", 1639 "name": "token", 1640 "in": "query" 1641 }, 1642 "token_header": { 1643 "type": "apiKey", 1644 "name": "X-Token", 1645 "in": "header" 1646 } 1647 }, 1648 "tags": [ 1649 { 1650 "description": "manages tasks", 1651 "name": "tasks", 1652 "externalDocs": { 1653 "description": "An extensive explanation on what is possible can be found in the\nsupport site for this application.\n", 1654 "url": "https://go-swagger.github.io/examples/tasklist/help/tasks.html" 1655 } 1656 }, 1657 { 1658 "description": "manages milestones", 1659 "name": "milestones", 1660 "externalDocs": { 1661 "description": "An extensive explanation on what is possible can be found in the\nsupport site for this application.\n", 1662 "url": "https://go-swagger.github.io/examples/tasklist/help/milestones.html" 1663 } 1664 } 1665 ], 1666 "externalDocs": { 1667 "description": "A much more elaborate guide to this application is available at the support\nsite.\n", 1668 "url": "https://go-swagger.github.io/examples/tasklist/help/tasks.html" 1669 } 1670 }`)) 1671 }