github.com/unionj-cloud/go-doudou@v1.3.8-0.20221011095552-0088008e5b31/cmd/internal/openapi/v3/codegen/testdata/test1.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      "/unipay/startUnionPay": {
    49        "get": {
    50          "description": "",
    51          "parameters": [
    52            {
    53              "name": "txnAmt",
    54              "in": "query",
    55              "required": true,
    56              "schema": {
    57                "type": "string"
    58              }
    59            },
    60            {
    61              "name": "token",
    62              "in": "query",
    63              "required": true,
    64              "description": "token",
    65              "schema": {
    66                "type": "string"
    67              }
    68            },
    69            {
    70              "name": "companyId",
    71              "in": "query",
    72              "required": true,
    73              "schema": {
    74                "type": "string"
    75              }
    76            },
    77            {
    78              "name": "frontUrl",
    79              "in": "query",
    80              "required": true,
    81              "schema": {
    82                "type": "string"
    83              }
    84            }
    85          ],
    86          "responses": {
    87            "200": {
    88              "description": "successful operation",
    89              "content": {
    90                "*/*": {
    91                  "schema": {
    92                    "type": "string",
    93                    "description": "html"
    94                  }
    95                }
    96              }
    97            }
    98          }
    99        }
   100      }
   101    },
   102    "components": {
   103      "schemas": {
   104        "Order": {
   105          "type": "object",
   106          "properties": {
   107            "id": {
   108              "type": "integer",
   109              "format": "int64",
   110              "example": 10
   111            },
   112            "petId": {
   113              "type": "integer",
   114              "format": "int64",
   115              "example": 198772
   116            },
   117            "quantity": {
   118              "type": "integer",
   119              "format": "int32",
   120              "example": 7
   121            },
   122            "shipDate": {
   123              "type": "string",
   124              "format": "date-time"
   125            },
   126            "status": {
   127              "type": "string",
   128              "description": "Order Status",
   129              "example": "approved",
   130              "enum": [
   131                "placed",
   132                "approved",
   133                "delivered"
   134              ]
   135            },
   136            "complete": {
   137              "type": "boolean"
   138            },
   139            "customer": {
   140              "type": "object",
   141              "description": "客户信息结构体\n用于描述客户相关的信息",
   142              "properties": {
   143                "id": {
   144                  "type": "integer",
   145                  "format": "int64",
   146                  "example": 100000,
   147                  "description": "用户ID"
   148                },
   149                "username": {
   150                  "type": "string",
   151                  "example": "fehguy",
   152                  "description": "用户名"
   153                },
   154                "address": {
   155                  "type": "array",
   156                  "xml": {
   157                    "name": "addresses",
   158                    "wrapped": true
   159                  },
   160                  "items": {
   161                    "$ref": "#/components/schemas/Address"
   162                  },
   163                  "description": "用户地址\n例如:北京海淀区xxx街道\n某某小区"
   164                }
   165              },
   166              "xml": {
   167                "name": "customer"
   168              }
   169            }
   170          },
   171          "xml": {
   172            "name": "order"
   173          }
   174        },
   175        "Customer": {
   176          "type": "object",
   177          "properties": {
   178            "id": {
   179              "type": "integer",
   180              "format": "int64",
   181              "example": 100000
   182            },
   183            "username": {
   184              "type": "string",
   185              "example": "fehguy"
   186            },
   187            "address": {
   188              "type": "array",
   189              "xml": {
   190                "name": "addresses",
   191                "wrapped": true
   192              },
   193              "items": {
   194                "$ref": "#/components/schemas/Address"
   195              }
   196            }
   197          },
   198          "xml": {
   199            "name": "customer"
   200          }
   201        },
   202        "Address": {
   203          "type": "object",
   204          "properties": {
   205            "street": {
   206              "type": "string",
   207              "example": "437 Lytton"
   208            },
   209            "city": {
   210              "type": "string",
   211              "example": "Palo Alto"
   212            },
   213            "state": {
   214              "type": "string",
   215              "example": "CA"
   216            },
   217            "zip": {
   218              "type": "string",
   219              "example": "94301"
   220            }
   221          },
   222          "xml": {
   223            "name": "address"
   224          }
   225        },
   226        "Category": {
   227          "type": "object",
   228          "properties": {
   229            "id": {
   230              "type": "integer",
   231              "format": "int64",
   232              "example": 1
   233            },
   234            "name": {
   235              "type": "string",
   236              "example": "Dogs"
   237            }
   238          },
   239          "xml": {
   240            "name": "category"
   241          }
   242        },
   243        "User": {
   244          "type": "object",
   245          "properties": {
   246            "id": {
   247              "type": "integer",
   248              "format": "int64",
   249              "example": 10
   250            },
   251            "username": {
   252              "type": "string",
   253              "example": "theUser"
   254            },
   255            "firstName": {
   256              "type": "string",
   257              "example": "John"
   258            },
   259            "lastName": {
   260              "type": "string",
   261              "example": "James"
   262            },
   263            "email": {
   264              "type": "string",
   265              "example": "john@email.com"
   266            },
   267            "password": {
   268              "type": "string",
   269              "example": "12345"
   270            },
   271            "phone": {
   272              "type": "string",
   273              "example": "12345"
   274            },
   275            "userStatus": {
   276              "type": "integer",
   277              "description": "User Status",
   278              "format": "int32",
   279              "example": 1
   280            },
   281            "avatar": {
   282              "type": "string",
   283              "format": "binary"
   284            },
   285            "additional1": {
   286              "type": "object",
   287              "additionalProperties": {
   288                "type": "string",
   289                "format": "int64"
   290              }
   291            },
   292            "additional2": {
   293              "type": "object",
   294              "additionalProperties": {
   295                "$ref": "#/components/schemas/Tag"
   296              }
   297            }
   298          },
   299          "xml": {
   300            "name": "user"
   301          }
   302        },
   303        "Tag": {
   304          "type": "object",
   305          "properties": {
   306            "id": {
   307              "type": "integer",
   308              "format": "int64"
   309            },
   310            "name": {
   311              "type": "string",
   312              "format": "tag"
   313            }
   314          },
   315          "xml": {
   316            "name": "tag"
   317          }
   318        },
   319        "Pet": {
   320          "required": [
   321            "name",
   322            "photoUrls"
   323          ],
   324          "type": "object",
   325          "properties": {
   326            "id": {
   327              "type": "integer",
   328              "format": "int64",
   329              "example": 10
   330            },
   331            "name": {
   332              "type": "string",
   333              "example": "doggie",
   334              "format": "dog"
   335            },
   336            "category": {
   337              "$ref": "#/components/schemas/Category"
   338            },
   339            "photoUrls": {
   340              "type": "array",
   341              "xml": {
   342                "wrapped": true
   343              },
   344              "items": {
   345                "type": "string",
   346                "xml": {
   347                  "name": "photoUrl"
   348                },
   349                "format": "image"
   350              }
   351            },
   352            "tags": {
   353              "type": "array",
   354              "xml": {
   355                "wrapped": true
   356              },
   357              "items": {
   358                "$ref": "#/components/schemas/Tag"
   359              }
   360            },
   361            "status": {
   362              "type": "string",
   363              "description": "pet status in the store\nthis is another line for test use",
   364              "enum": [
   365                "available",
   366                "pending",
   367                "sold"
   368              ]
   369            }
   370          },
   371          "xml": {
   372            "name": "pet"
   373          }
   374        },
   375        "ApiResponse": {
   376          "type": "object",
   377          "properties": {
   378            "code": {
   379              "type": "integer",
   380              "format": "int32"
   381            },
   382            "type": {
   383              "type": "string"
   384            },
   385            "message": {
   386              "type": "string"
   387            }
   388          },
   389          "xml": {
   390            "name": "##default"
   391          }
   392        }
   393      },
   394      "requestBodies": {
   395        "Pet": {
   396          "description": "Pet object that needs to be added to the store",
   397          "content": {
   398            "application/json": {
   399              "schema": {
   400                "$ref": "#/components/schemas/Pet"
   401              }
   402            },
   403            "application/xml": {
   404              "schema": {
   405                "$ref": "#/components/schemas/Pet"
   406              }
   407            }
   408          }
   409        },
   410        "UserArray": {
   411          "description": "List of user object",
   412          "content": {
   413            "application/json": {
   414              "schema": {
   415                "type": "array",
   416                "items": {
   417                  "$ref": "#/components/schemas/User"
   418                }
   419              }
   420            }
   421          }
   422        }
   423      },
   424      "securitySchemes": {
   425        "petstore_auth": {
   426          "type": "oauth2",
   427          "flows": {
   428            "implicit": {
   429              "authorizationUrl": "https://petstore3.swagger.io/oauth/authorize",
   430              "scopes": {
   431                "write:pets": "modify pets in your account",
   432                "read:pets": "read your pets"
   433              }
   434            }
   435          }
   436        },
   437        "api_key": {
   438          "type": "apiKey",
   439          "name": "api_key",
   440          "in": "header"
   441        }
   442      }
   443    }
   444  }