🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[TOC] ## 概述 语法 ``` swagger:parameters [operationid1 operationid2] ``` 元素说明 | Annotation | Format | | --- | --- | | **In** | where to find the parameter | | **Collection Format** | when a slice the formatter for the collection when serialized on the request | | **Maximum** | specifies the maximum a number or integer value can have | | **Minimum** | specifies the minimum a number or integer value can have | | **Multiple of** | specifies a value a number or integer value must be a multiple of | | **Minimum length** | the minimum length for a string value | | **Maximum length** | the maximum length for a string value | | **Pattern** | a regular expression a string value needs to match | | **Minimum items** | the minimum number of items a slice needs to have | | **Maximum items** | the maximum number of items a slice can have | | **Unique** | when set to true the slice can only contain unique items | | **Required** | when set to true this value needs to be present in the request | | **Example** | an example value, parsed as the field's type (objects and slices are parsed as JSON) | 对切片的说明 | Annotation | Format | | --- | --- | | **Items.*n*.Maximum** | specifies the maximum a number or integer value can have at the level*n* | | **Items.*n*.Minimum** | specifies the minimum a number or integer value can have at the level*n* | | **Items.*n*.Multiple of** | specifies a value a number or integer value must be a multiple of | | **Items.*n*.Minimum length** | the minimum length for a string value at the level*n* | | **Items.*n*.Maximum length** | the maximum length for a string value at the level*n* | | **Items.*n*.Pattern** | a regular expression a string value needs to match at the level*n* | | **Items.*n*.Minimum items** | the minimum number of items a slice needs to have at the level*n* | | **Items.*n*.Maximum items** | the maximum number of items a slice can have at the level*n* | | **Items.*n*.Unique** | when set to true the slice can only contain unique items at the level*n* | ``` // swagger:parameters getSingleUser type chatParam struct { // an id of user info // // Required: true // unique: true // in: path // Example:"asdsad" Q string `form:"q" example:"a"` // aaaaaaaaaaa // // Required: true // in: Query A string `form:"11" exmaple:"aaa"` } ```