账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    swagger parameters
    37
    0
    {
        "info": {
            "title": "API",
            "version": "1.0.1",
            "description": "api doc"
        },
        "host": "localhost:80",
        "basePath": "/",
        "swagger": "2.0",
        "paths": {},
        "definitions": {},
        "responses": {},
        "parameters": {},
        "securityDefinitions": {},
        "tags": []
    }

    swagger.json中 最外层的parameters有什么用 怎么写?

    0
    打赏
    收藏
    点击回答
    您的回答被采纳后将获得:提问者悬赏的 11 元积分
        全部回答
    • 0
    • 看別人笑話_ 普通会员 1楼

      Swagger parameters are a way to define the structure and behavior of a parameter in a Swagger document. They are used to describe the required, minimum, and maximum values for a parameter, as well as the type of the parameter (e.g. string, number, boolean). For example, you might define a parameter in your Swagger document with the following syntax: yaml param: name: name in: path required: true type: string

      In this example, the name parameter is defined with a name attribute, a in attribute of path, a required attribute of true, and a type attribute of string. This means that the parameter must be present in the path of the API document, and must be of type string. You can also define complex parameters with multiple properties using attributes, as shown in the following example: yaml param: name: name in: path required: true type: string description: "A description of the parameter" enum: - value1 - value2

      In this example, the name parameter has multiple properties, including a description attribute, an enum attribute, and a type attribute. The enum attribute specifies the possible values for the parameter, and the description attribute provides a brief description of the parameter.

    更多回答
    网站公告
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部