github.com/wangyougui/gf/v2@v2.6.5/net/goai/testdata/example.yaml (about) 1 openapi: 3.0.1 2 info: 3 title: Swagger Petstore 4 description: 'This is a sample server Petstore server. You can find out more about Swagger 5 at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For 6 this sample, you can use the api key `special-key` to test the authorization filters.' 7 termsOfService: http://swagger.io/terms/ 8 contact: 9 email: apiteam@swagger.io 10 license: 11 name: Apache 2.0 12 url: http://www.apache.org/licenses/LICENSE-2.0.html 13 version: 1.0.0 14 externalDocs: 15 description: Find out more about Swagger 16 url: http://swagger.io 17 servers: 18 - url: https://petstore.swagger.io/v2 19 - url: http://petstore.swagger.io/v2 20 tags: 21 - name: pet 22 description: Everything about your Pets 23 externalDocs: 24 description: Find out more 25 url: http://swagger.io 26 - name: store 27 description: Access to Petstore orders 28 - name: user 29 description: Operations about user 30 externalDocs: 31 description: Find out more about our store 32 url: http://swagger.io 33 paths: 34 /pet: 35 put: 36 tags: 37 - pet 38 summary: Update an existing pet 39 operationId: updatePet 40 requestBody: 41 description: Pet object that needs to be added to the store 42 content: 43 application/json: 44 schema: 45 $ref: '#/components/schemas/Pet' 46 application/xml: 47 schema: 48 $ref: '#/components/schemas/Pet' 49 required: true 50 responses: 51 400: 52 description: Invalid ID supplied 53 content: {} 54 404: 55 description: Pet not found 56 content: {} 57 405: 58 description: Validation exception 59 content: {} 60 security: 61 - petstore_auth: 62 - write:pets 63 - read:pets 64 x-codegen-request-body-name: body 65 post: 66 tags: 67 - pet 68 summary: Add a new pet to the store 69 operationId: addPet 70 requestBody: 71 description: Pet object that needs to be added to the store 72 content: 73 application/json: 74 schema: 75 $ref: '#/components/schemas/Pet' 76 application/xml: 77 schema: 78 $ref: '#/components/schemas/Pet' 79 required: true 80 responses: 81 405: 82 description: Invalid input 83 content: {} 84 security: 85 - petstore_auth: 86 - write:pets 87 - read:pets 88 x-codegen-request-body-name: body 89 /pet/findByStatus: 90 get: 91 tags: 92 - pet 93 summary: Finds Pets by status 94 description: Multiple status values can be provided with comma separated strings 95 operationId: findPetsByStatus 96 parameters: 97 - name: status 98 in: query 99 description: Status values that need to be considered for filter 100 required: true 101 style: form 102 explode: true 103 schema: 104 type: array 105 items: 106 type: string 107 default: available 108 enum: 109 - available 110 - pending 111 - sold 112 responses: 113 200: 114 description: successful operation 115 content: 116 application/xml: 117 schema: 118 type: array 119 items: 120 $ref: '#/components/schemas/Pet' 121 application/json: 122 schema: 123 type: array 124 items: 125 $ref: '#/components/schemas/Pet' 126 400: 127 description: Invalid status value 128 content: {} 129 security: 130 - petstore_auth: 131 - write:pets 132 - read:pets 133 /pet/findByTags: 134 get: 135 tags: 136 - pet 137 summary: Finds Pets by tags 138 description: Multiple tags can be provided with comma separated strings. Use tag1, 139 tag2, tag3 for testing. 140 operationId: findPetsByTags 141 parameters: 142 - name: tags 143 in: query 144 description: Tags to filter by 145 required: true 146 style: form 147 explode: true 148 schema: 149 type: array 150 items: 151 type: string 152 responses: 153 200: 154 description: successful operation 155 content: 156 application/xml: 157 schema: 158 type: array 159 items: 160 $ref: '#/components/schemas/Pet' 161 application/json: 162 schema: 163 type: array 164 items: 165 $ref: '#/components/schemas/Pet' 166 400: 167 description: Invalid tag value 168 content: {} 169 deprecated: true 170 security: 171 - petstore_auth: 172 - write:pets 173 - read:pets 174 /pet/{petId}: 175 get: 176 tags: 177 - pet 178 summary: Find pet by ID 179 description: Returns a single pet 180 operationId: getPetById 181 parameters: 182 - name: petId 183 in: path 184 description: ID of pet to return 185 required: true 186 schema: 187 type: integer 188 format: int64 189 responses: 190 200: 191 description: successful operation 192 content: 193 application/xml: 194 schema: 195 $ref: '#/components/schemas/Pet' 196 application/json: 197 schema: 198 $ref: '#/components/schemas/Pet' 199 400: 200 description: Invalid ID supplied 201 content: {} 202 404: 203 description: Pet not found 204 content: {} 205 security: 206 - api_key: [] 207 post: 208 tags: 209 - pet 210 summary: Updates a pet in the store with form data 211 operationId: updatePetWithForm 212 parameters: 213 - name: petId 214 in: path 215 description: ID of pet that needs to be updated 216 required: true 217 schema: 218 type: integer 219 format: int64 220 requestBody: 221 content: 222 application/x-www-form-urlencoded: 223 schema: 224 properties: 225 name: 226 type: string 227 description: Updated name of the pet 228 status: 229 type: string 230 description: Updated status of the pet 231 responses: 232 405: 233 description: Invalid input 234 content: {} 235 security: 236 - petstore_auth: 237 - write:pets 238 - read:pets 239 delete: 240 tags: 241 - pet 242 summary: Deletes a pet 243 operationId: deletePet 244 parameters: 245 - name: api_key 246 in: header 247 schema: 248 type: string 249 - name: petId 250 in: path 251 description: Pet id to delete 252 required: true 253 schema: 254 type: integer 255 format: int64 256 responses: 257 400: 258 description: Invalid ID supplied 259 content: {} 260 404: 261 description: Pet not found 262 content: {} 263 security: 264 - petstore_auth: 265 - write:pets 266 - read:pets 267 /pet/{petId}/uploadImage: 268 post: 269 tags: 270 - pet 271 summary: uploads an image 272 operationId: uploadFile 273 parameters: 274 - name: petId 275 in: path 276 description: ID of pet to update 277 required: true 278 schema: 279 type: integer 280 format: int64 281 requestBody: 282 content: 283 multipart/form-data: 284 schema: 285 properties: 286 additionalMetadata: 287 type: string 288 description: Additional data to pass to server 289 file: 290 type: string 291 description: file to upload 292 format: binary 293 responses: 294 200: 295 description: successful operation 296 content: 297 application/json: 298 schema: 299 $ref: '#/components/schemas/ApiResponse' 300 security: 301 - petstore_auth: 302 - write:pets 303 - read:pets 304 /store/inventory: 305 get: 306 tags: 307 - store 308 summary: Returns pet inventories by status 309 description: Returns a map of status codes to quantities 310 operationId: getInventory 311 responses: 312 200: 313 description: successful operation 314 content: 315 application/json: 316 schema: 317 type: object 318 additionalProperties: 319 type: integer 320 format: int32 321 security: 322 - api_key: [] 323 /store/order: 324 post: 325 tags: 326 - store 327 summary: Place an order for a pet 328 operationId: placeOrder 329 requestBody: 330 description: order placed for purchasing the pet 331 content: 332 '*/*': 333 schema: 334 $ref: '#/components/schemas/Order' 335 required: true 336 responses: 337 200: 338 description: successful operation 339 content: 340 application/xml: 341 schema: 342 $ref: '#/components/schemas/Order' 343 application/json: 344 schema: 345 $ref: '#/components/schemas/Order' 346 400: 347 description: Invalid Order 348 content: {} 349 x-codegen-request-body-name: body 350 /store/order/{orderId}: 351 get: 352 tags: 353 - store 354 summary: Find purchase order by ID 355 description: For valid response try integer IDs with value >= 1 and <= 10. Other 356 values will generated exceptions 357 operationId: getOrderById 358 parameters: 359 - name: orderId 360 in: path 361 description: ID of pet that needs to be fetched 362 required: true 363 schema: 364 maximum: 10.0 365 minimum: 1.0 366 type: integer 367 format: int64 368 responses: 369 200: 370 description: successful operation 371 content: 372 application/xml: 373 schema: 374 $ref: '#/components/schemas/Order' 375 application/json: 376 schema: 377 $ref: '#/components/schemas/Order' 378 400: 379 description: Invalid ID supplied 380 content: {} 381 404: 382 description: Order not found 383 content: {} 384 delete: 385 tags: 386 - store 387 summary: Delete purchase order by ID 388 description: For valid response try integer IDs with positive integer value. Negative 389 or non-integer values will generate API errors 390 operationId: deleteOrder 391 parameters: 392 - name: orderId 393 in: path 394 description: ID of the order that needs to be deleted 395 required: true 396 schema: 397 minimum: 1.0 398 type: integer 399 format: int64 400 responses: 401 400: 402 description: Invalid ID supplied 403 content: {} 404 404: 405 description: Order not found 406 content: {} 407 /user: 408 post: 409 tags: 410 - user 411 summary: Create user 412 description: This can only be done by the logged in user. 413 operationId: createUser 414 requestBody: 415 description: Created user object 416 content: 417 '*/*': 418 schema: 419 $ref: '#/components/schemas/User' 420 required: true 421 responses: 422 default: 423 description: successful operation 424 content: {} 425 x-codegen-request-body-name: body 426 /user/createWithArray: 427 post: 428 tags: 429 - user 430 summary: Creates list of users with given input array 431 operationId: createUsersWithArrayInput 432 requestBody: 433 description: List of user object 434 content: 435 '*/*': 436 schema: 437 type: array 438 items: 439 $ref: '#/components/schemas/User' 440 required: true 441 responses: 442 default: 443 description: successful operation 444 content: {} 445 x-codegen-request-body-name: body 446 /user/createWithList: 447 post: 448 tags: 449 - user 450 summary: Creates list of users with given input array 451 operationId: createUsersWithListInput 452 requestBody: 453 description: List of user object 454 content: 455 '*/*': 456 schema: 457 type: array 458 items: 459 $ref: '#/components/schemas/User' 460 required: true 461 responses: 462 default: 463 description: successful operation 464 content: {} 465 x-codegen-request-body-name: body 466 /user/login: 467 get: 468 tags: 469 - user 470 summary: Logs user into the system 471 operationId: loginUser 472 parameters: 473 - name: username 474 in: query 475 description: The user name for login 476 required: true 477 schema: 478 type: string 479 - name: password 480 in: query 481 description: The password for login in clear text 482 required: true 483 schema: 484 type: string 485 responses: 486 200: 487 description: successful operation 488 headers: 489 X-Rate-Limit: 490 description: calls per hour allowed by the user 491 schema: 492 type: integer 493 format: int32 494 X-Expires-After: 495 description: date in UTC when token expires 496 schema: 497 type: string 498 format: date-time 499 content: 500 application/xml: 501 schema: 502 type: string 503 application/json: 504 schema: 505 type: string 506 400: 507 description: Invalid username/password supplied 508 content: {} 509 /user/logout: 510 get: 511 tags: 512 - user 513 summary: Logs out current logged in user session 514 operationId: logoutUser 515 responses: 516 default: 517 description: successful operation 518 content: {} 519 /user/{username}: 520 get: 521 tags: 522 - user 523 summary: Get user by user name 524 operationId: getUserByName 525 parameters: 526 - name: username 527 in: path 528 description: 'The name that needs to be fetched. Use user1 for testing. ' 529 required: true 530 schema: 531 type: string 532 responses: 533 200: 534 description: successful operation 535 content: 536 application/xml: 537 schema: 538 $ref: '#/components/schemas/User' 539 application/json: 540 schema: 541 $ref: '#/components/schemas/User' 542 400: 543 description: Invalid username supplied 544 content: {} 545 404: 546 description: User not found 547 content: {} 548 put: 549 tags: 550 - user 551 summary: Updated user 552 description: This can only be done by the logged in user. 553 operationId: updateUser 554 parameters: 555 - name: username 556 in: path 557 description: name that need to be updated 558 required: true 559 schema: 560 type: string 561 requestBody: 562 description: Updated user object 563 content: 564 '*/*': 565 schema: 566 $ref: '#/components/schemas/User' 567 required: true 568 responses: 569 400: 570 description: Invalid user supplied 571 content: {} 572 404: 573 description: User not found 574 content: {} 575 x-codegen-request-body-name: body 576 delete: 577 tags: 578 - user 579 summary: Delete user 580 description: This can only be done by the logged in user. 581 operationId: deleteUser 582 parameters: 583 - name: username 584 in: path 585 description: The name that needs to be deleted 586 required: true 587 schema: 588 type: string 589 responses: 590 400: 591 description: Invalid username supplied 592 content: {} 593 404: 594 description: User not found 595 content: {} 596 components: 597 schemas: 598 Order: 599 type: object 600 properties: 601 id: 602 type: integer 603 format: int64 604 petId: 605 type: integer 606 format: int64 607 quantity: 608 type: integer 609 format: int32 610 shipDate: 611 type: string 612 format: date-time 613 status: 614 type: string 615 description: Order Status 616 enum: 617 - placed 618 - approved 619 - delivered 620 complete: 621 type: boolean 622 default: false 623 xml: 624 name: Order 625 Category: 626 type: object 627 properties: 628 id: 629 type: integer 630 format: int64 631 name: 632 type: string 633 xml: 634 name: Category 635 User: 636 type: object 637 properties: 638 id: 639 type: integer 640 format: int64 641 username: 642 type: string 643 firstName: 644 type: string 645 lastName: 646 type: string 647 email: 648 type: string 649 password: 650 type: string 651 phone: 652 type: string 653 userStatus: 654 type: integer 655 description: User Status 656 format: int32 657 xml: 658 name: User 659 Tag: 660 type: object 661 properties: 662 id: 663 type: integer 664 format: int64 665 name: 666 type: string 667 xml: 668 name: Tag 669 Pet: 670 required: 671 - name 672 - photoUrls 673 type: object 674 properties: 675 id: 676 type: integer 677 format: int64 678 category: 679 $ref: '#/components/schemas/Category' 680 name: 681 type: string 682 example: doggie 683 photoUrls: 684 type: array 685 xml: 686 name: photoUrl 687 wrapped: true 688 items: 689 type: string 690 tags: 691 type: array 692 xml: 693 name: tag 694 wrapped: true 695 items: 696 $ref: '#/components/schemas/Tag' 697 status: 698 type: string 699 description: pet status in the store 700 enum: 701 - available 702 - pending 703 - sold 704 xml: 705 name: Pet 706 ApiResponse: 707 type: object 708 properties: 709 code: 710 type: integer 711 format: int32 712 type: 713 type: string 714 message: 715 type: string 716 securitySchemes: 717 petstore_auth: 718 type: oauth2 719 flows: 720 implicit: 721 authorizationUrl: http://petstore.swagger.io/oauth/dialog 722 scopes: 723 write:pets: modify pets in your account 724 read:pets: read your pets 725 api_key: 726 type: apiKey 727 name: api_key 728 in: header