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