github.com/unionj-cloud/go-doudou@v1.3.8-0.20221011095552-0088008e5b31/cmd/internal/openapi/v3/codegen/testdata/test2.json (about) 1 { 2 "openapi": "3.0.2", 3 "info": { 4 "title": "Swagger Petstore - OpenAPI 3.0", 5 "description": "This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about\nSwagger at [http://swagger.io](http://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!\nYou can now help us improve the API whether it's by making changes to the definition itself or to the code.\nThat way, with time, we can improve the API in general, and expose some of the new features in OAS3.\n\nSome useful links:\n- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)", 6 "termsOfService": "http://swagger.io/terms/", 7 "contact": { 8 "email": "apiteam@swagger.io" 9 }, 10 "license": { 11 "name": "Apache 2.0", 12 "url": "http://www.apache.org/licenses/LICENSE-2.0.html" 13 }, 14 "version": "1.0.5" 15 }, 16 "externalDocs": { 17 "description": "Find out more about Swagger", 18 "url": "http://swagger.io" 19 }, 20 "servers": [ 21 { 22 "url": "/api/v3" 23 } 24 ], 25 "tags": [ 26 { 27 "name": "pet", 28 "description": "Everything about your Pets", 29 "externalDocs": { 30 "description": "Find out more", 31 "url": "http://swagger.io" 32 } 33 }, 34 { 35 "name": "store", 36 "description": "Operations about user" 37 }, 38 { 39 "name": "user", 40 "description": "Access to Petstore orders", 41 "externalDocs": { 42 "description": "Find out more about our store", 43 "url": "http://swagger.io" 44 } 45 } 46 ], 47 "paths": { 48 "/user": { 49 "delete": { 50 "tags": [ 51 "user" 52 ], 53 "summary": "Delete user", 54 "description": "This can only be done by the logged in user.", 55 "requestBody": { 56 "description": "Delete user object", 57 "content": { 58 "application/json": { 59 "schema": { 60 "$ref": "#/components/schemas/User" 61 } 62 } 63 } 64 }, 65 "responses": { 66 "default": { 67 "description": "successful operation", 68 "content": { 69 "application/json": { 70 "schema": { 71 "$ref": "#/components/schemas/User" 72 } 73 } 74 } 75 } 76 } 77 }, 78 "post": { 79 "tags": [ 80 "user" 81 ], 82 "summary": "Create user", 83 "description": "This can only be done by the logged in user.", 84 "operationId": "createUser", 85 "requestBody": { 86 "description": "Created user object", 87 "content": { 88 "application/json": { 89 "schema": { 90 "$ref": "#/components/schemas/User" 91 } 92 }, 93 "application/xml": { 94 "schema": { 95 "$ref": "#/components/schemas/User" 96 } 97 }, 98 "application/x-www-form-urlencoded": { 99 "schema": { 100 "$ref": "#/components/schemas/User" 101 } 102 } 103 } 104 }, 105 "responses": { 106 "default": { 107 "description": "successful operation", 108 "content": { 109 "application/json": { 110 "schema": { 111 "$ref": "#/components/schemas/User" 112 } 113 }, 114 "application/xml": { 115 "schema": { 116 "$ref": "#/components/schemas/User" 117 } 118 } 119 } 120 } 121 } 122 } 123 }, 124 "/user/createWithList": { 125 "post": { 126 "tags": [ 127 "user" 128 ], 129 "summary": "Creates list of users with given input array", 130 "description": "Creates list of users with given input array", 131 "operationId": "createUsersWithListInput", 132 "requestBody": { 133 "content": { 134 "application/json": { 135 "schema": { 136 "type": "array", 137 "items": { 138 "$ref": "#/components/schemas/User" 139 } 140 } 141 } 142 } 143 }, 144 "responses": { 145 "200": { 146 "description": "Successful operation", 147 "content": { 148 "application/xml": { 149 "schema": { 150 "$ref": "#/components/schemas/User" 151 } 152 }, 153 "application/json": { 154 "schema": { 155 "$ref": "#/components/schemas/User" 156 } 157 } 158 } 159 }, 160 "default": { 161 "description": "successful operation" 162 } 163 } 164 } 165 }, 166 "/user/login": { 167 "get": { 168 "tags": [ 169 "user" 170 ], 171 "summary": "Logs user into the system", 172 "description": "", 173 "operationId": "loginUser", 174 "parameters": [ 175 { 176 "name": "username", 177 "in": "query", 178 "description": "The user name for login", 179 "required": false, 180 "schema": { 181 "type": "string" 182 } 183 }, 184 { 185 "name": "password", 186 "in": "query", 187 "description": "The password for login in clear text", 188 "required": false, 189 "schema": { 190 "type": "string" 191 } 192 } 193 ], 194 "responses": { 195 "200": { 196 "description": "successful operation", 197 "headers": { 198 "X-Rate-Limit": { 199 "description": "calls per hour allowed by the user", 200 "schema": { 201 "type": "integer", 202 "format": "int32" 203 } 204 }, 205 "X-Expires-After": { 206 "description": "date in UTC when toekn expires", 207 "schema": { 208 "type": "string", 209 "format": "date-time" 210 } 211 } 212 }, 213 "content": { 214 "application/xml": { 215 "schema": { 216 "type": "string" 217 } 218 }, 219 "application/json": { 220 "schema": { 221 "type": "string" 222 } 223 } 224 } 225 }, 226 "400": { 227 "description": "Invalid username/password supplied" 228 } 229 } 230 } 231 }, 232 "/user/logout": { 233 "get": { 234 "tags": [ 235 "user" 236 ], 237 "summary": "Logs out current logged in user session", 238 "description": "", 239 "operationId": "logoutUser", 240 "parameters": [], 241 "responses": { 242 "default": { 243 "description": "successful operation" 244 } 245 } 246 } 247 }, 248 "/user/{username}": { 249 "get": { 250 "tags": [ 251 "user" 252 ], 253 "summary": "Get user by user name", 254 "description": "", 255 "operationId": "getUserByName", 256 "parameters": [ 257 { 258 "name": "username", 259 "in": "path", 260 "description": "The name that needs to be fetched. Use user1 for testing. ", 261 "required": true, 262 "schema": { 263 "type": "string" 264 } 265 } 266 ], 267 "responses": { 268 "200": { 269 "description": "successful operation", 270 "content": { 271 "application/xml": { 272 "schema": { 273 "$ref": "#/components/schemas/User" 274 } 275 }, 276 "application/json": { 277 "schema": { 278 "$ref": "#/components/schemas/User" 279 } 280 } 281 } 282 }, 283 "400": { 284 "description": "Invalid username supplied" 285 }, 286 "404": { 287 "description": "User not found" 288 } 289 } 290 }, 291 "put": { 292 "tags": [ 293 "user" 294 ], 295 "summary": "Update user", 296 "description": "This can only be done by the logged in user.", 297 "operationId": "updateUser", 298 "parameters": [ 299 { 300 "name": "username", 301 "in": "path", 302 "description": "name that need to be deleted", 303 "required": true, 304 "schema": { 305 "type": "string" 306 } 307 } 308 ], 309 "requestBody": { 310 "description": "Update an existent user in the store", 311 "content": { 312 "application/json": { 313 "schema": { 314 "$ref": "#/components/schemas/User" 315 } 316 }, 317 "application/xml": { 318 "schema": { 319 "$ref": "#/components/schemas/User" 320 } 321 }, 322 "application/x-www-form-urlencoded": { 323 "schema": { 324 "$ref": "#/components/schemas/User" 325 } 326 } 327 } 328 }, 329 "responses": { 330 "default": { 331 "description": "successful operation" 332 } 333 } 334 }, 335 "delete": { 336 "tags": [ 337 "user" 338 ], 339 "summary": "Delete user", 340 "description": "This can only be done by the logged in user.", 341 "operationId": "deleteUser", 342 "parameters": [ 343 { 344 "name": "username", 345 "in": "path", 346 "description": "The name that needs to be deleted", 347 "required": true, 348 "schema": { 349 "type": "string" 350 } 351 } 352 ], 353 "responses": { 354 "400": { 355 "description": "Invalid username supplied" 356 }, 357 "404": { 358 "description": "User not found" 359 } 360 } 361 } 362 } 363 }, 364 "components": { 365 "schemas": { 366 "Order": { 367 "type": "object", 368 "properties": { 369 "id": { 370 "type": "integer", 371 "format": "int64", 372 "example": 10 373 }, 374 "petId": { 375 "type": "integer", 376 "format": "int64", 377 "example": 198772 378 }, 379 "quantity": { 380 "type": "integer", 381 "format": "int32", 382 "example": 7 383 }, 384 "shipDate": { 385 "type": "string", 386 "format": "date-time" 387 }, 388 "status": { 389 "type": "string", 390 "description": "Order Status", 391 "example": "approved", 392 "enum": [ 393 "placed", 394 "approved", 395 "delivered" 396 ] 397 }, 398 "complete": { 399 "type": "boolean" 400 }, 401 "customer": { 402 "type": "object", 403 "description": "客户信息结构体\n用于描述客户相关的信息", 404 "properties": { 405 "id": { 406 "type": "integer", 407 "format": "int64", 408 "example": 100000, 409 "description": "用户ID" 410 }, 411 "username": { 412 "type": "string", 413 "example": "fehguy", 414 "description": "用户名" 415 }, 416 "address": { 417 "type": "array", 418 "xml": { 419 "name": "addresses", 420 "wrapped": true 421 }, 422 "items": { 423 "$ref": "#/components/schemas/Address" 424 }, 425 "description": "用户地址\n例如:北京海淀区xxx街道\n某某小区" 426 } 427 }, 428 "xml": { 429 "name": "customer" 430 } 431 } 432 }, 433 "xml": { 434 "name": "order" 435 } 436 }, 437 "Customer": { 438 "type": "object", 439 "properties": { 440 "id": { 441 "type": "integer", 442 "format": "int64", 443 "example": 100000 444 }, 445 "username": { 446 "type": "string", 447 "example": "fehguy" 448 }, 449 "address": { 450 "type": "array", 451 "xml": { 452 "name": "addresses", 453 "wrapped": true 454 }, 455 "items": { 456 "$ref": "#/components/schemas/Address" 457 } 458 } 459 }, 460 "xml": { 461 "name": "customer" 462 } 463 }, 464 "Address": { 465 "type": "object", 466 "properties": { 467 "street": { 468 "type": "string", 469 "example": "437 Lytton" 470 }, 471 "city": { 472 "type": "string", 473 "example": "Palo Alto" 474 }, 475 "state": { 476 "type": "string", 477 "example": "CA" 478 }, 479 "zip": { 480 "type": "string", 481 "example": "94301" 482 } 483 }, 484 "xml": { 485 "name": "address" 486 } 487 }, 488 "Category": { 489 "type": "object", 490 "properties": { 491 "id": { 492 "type": "integer", 493 "format": "int64", 494 "example": 1 495 }, 496 "name": { 497 "type": "string", 498 "example": "Dogs" 499 } 500 }, 501 "xml": { 502 "name": "category" 503 } 504 }, 505 "User": { 506 "type": "object", 507 "properties": { 508 "id": { 509 "type": "integer", 510 "format": "int64", 511 "example": 10 512 }, 513 "username": { 514 "type": "string", 515 "example": "theUser" 516 }, 517 "firstName": { 518 "type": "string", 519 "example": "John" 520 }, 521 "lastName": { 522 "type": "string", 523 "example": "James" 524 }, 525 "email": { 526 "type": "string", 527 "example": "john@email.com" 528 }, 529 "password": { 530 "type": "string", 531 "example": "12345" 532 }, 533 "phone": { 534 "type": "string", 535 "example": "12345" 536 }, 537 "userStatus": { 538 "type": "integer", 539 "description": "User Status", 540 "format": "int32", 541 "example": 1 542 }, 543 "avatar": { 544 "type": "string", 545 "format": "binary" 546 }, 547 "additional1": { 548 "type": "object", 549 "additionalProperties": { 550 "type": "string", 551 "format": "int64" 552 } 553 }, 554 "additional2": { 555 "type": "object", 556 "additionalProperties": { 557 "$ref": "#/components/schemas/Tag" 558 } 559 } 560 }, 561 "xml": { 562 "name": "user" 563 } 564 }, 565 "Tag": { 566 "type": "object", 567 "properties": { 568 "id": { 569 "type": "integer", 570 "format": "int64" 571 }, 572 "name": { 573 "type": "string", 574 "format": "tag" 575 } 576 }, 577 "xml": { 578 "name": "tag" 579 } 580 }, 581 "Pet": { 582 "required": [ 583 "name", 584 "photoUrls" 585 ], 586 "type": "object", 587 "properties": { 588 "id": { 589 "type": "integer", 590 "format": "int64", 591 "example": 10 592 }, 593 "name": { 594 "type": "string", 595 "example": "doggie", 596 "format": "dog" 597 }, 598 "category": { 599 "$ref": "#/components/schemas/Category" 600 }, 601 "photoUrls": { 602 "type": "array", 603 "xml": { 604 "wrapped": true 605 }, 606 "items": { 607 "type": "string", 608 "xml": { 609 "name": "photoUrl" 610 }, 611 "format": "image" 612 } 613 }, 614 "tags": { 615 "type": "array", 616 "xml": { 617 "wrapped": true 618 }, 619 "items": { 620 "$ref": "#/components/schemas/Tag" 621 } 622 }, 623 "status": { 624 "type": "string", 625 "description": "pet status in the store\nthis is another line for test use", 626 "enum": [ 627 "available", 628 "pending", 629 "sold" 630 ] 631 } 632 }, 633 "xml": { 634 "name": "pet" 635 } 636 }, 637 "ApiResponse": { 638 "type": "object", 639 "properties": { 640 "code": { 641 "type": "integer", 642 "format": "int32" 643 }, 644 "type": { 645 "type": "string" 646 }, 647 "message": { 648 "type": "string" 649 } 650 }, 651 "xml": { 652 "name": "##default" 653 } 654 } 655 }, 656 "requestBodies": { 657 "Pet": { 658 "description": "Pet object that needs to be added to the store", 659 "content": { 660 "application/json": { 661 "schema": { 662 "$ref": "#/components/schemas/Pet" 663 } 664 }, 665 "application/xml": { 666 "schema": { 667 "$ref": "#/components/schemas/Pet" 668 } 669 } 670 } 671 }, 672 "UserArray": { 673 "description": "List of user object", 674 "content": { 675 "application/json": { 676 "schema": { 677 "type": "array", 678 "items": { 679 "$ref": "#/components/schemas/User" 680 } 681 } 682 } 683 } 684 } 685 }, 686 "securitySchemes": { 687 "petstore_auth": { 688 "type": "oauth2", 689 "flows": { 690 "implicit": { 691 "authorizationUrl": "https://petstore3.swagger.io/oauth/authorize", 692 "scopes": { 693 "write:pets": "modify pets in your account", 694 "read:pets": "read your pets" 695 } 696 } 697 } 698 }, 699 "api_key": { 700 "type": "apiKey", 701 "name": "api_key", 702 "in": "header" 703 } 704 } 705 } 706 }