consts/swagger.go

61 lines
2.2 KiB
Go
Raw Normal View History

2024-04-25 16:08:06 +08:00
// Package consts ...
//
// Description : consts ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2024-04-25 16:03
package consts
const (
2024-07-19 14:43:07 +08:00
SwaggerDataTypeInteger = "integer" // 32 位有符号
SwaggerDataTypeLong = "long" // 64 位有符号
SwaggerDataTypeFloat = "number"
SwaggerDataTypeDouble = "number"
SwaggerDataTypeNumber = "number"
SwaggerDataTypeByte = "string"
SwaggerDataTypeBinary = "binary" // 任意 8 进制序列
SwaggerDataTypeString = "string"
SwaggerDataTypeDate = "string"
SwaggerDataTypePassword = "password"
SwaggerDataTypeBoolean = "boolean"
SwaggerDataTypeArray = "array"
SwaggerDataTypeObject = "object"
2024-04-25 16:08:06 +08:00
)
const (
SwaggerDocVersion1 = "1.0"
SwaggerDocVersion2 = "2.0"
SwaggerDocVersion3 = "3.0"
)
const (
SwaggerRefKey = "$ref"
SwaggerRefValPrefix = "#/definitions/"
)
2024-04-25 16:53:43 +08:00
const (
SwaggerTypeKey = "type"
)
2024-04-25 17:16:16 +08:00
const (
SwaggerBaseObjectDefinitionName = "object_map"
)
const (
SwaggerParameterInQuery = "query" // 参数位置 : query
SwaggerParameterInHeader = "header" // 参数位置 : header
SwaggerParameterInPath = "path" // 参数位置 : path
SwaggerParameterInCookie = "cookie" // 参数位置 : cookie
)
2024-07-19 15:42:12 +08:00
const (
2024-07-19 15:56:38 +08:00
SwaggerParameterStyleForm = "form" // in = query / cookie , type = primitive, array, object
SwaggerParameterStyleSimple = "simple" // in = path / header , type = array , Simple 样式的参数,参见 RFC6570. 此选项替换定义于OpenAPI 2.0 中 collectionFormat等于csv的情况。
SwaggerParameterStyleMatrix = "matrix" // in = path type = primitive, array, object
SwaggerParameterStyleLabel = "label" // in = path , type = primitive, array, object
SwaggerParameterStyleSpaceDelimited = "spaceDelimited" // in = query , type = array, 空格分隔的数组值。此选项替换定义于OpenAPI 2.0 中 collectionFormat equal to ssv的情况。
SwaggerParameterStylePipeDelimited = "pipeDelimited" // in = query , type = array, 管道符`
SwaggerParameterStyleDeepObject = "deepObject" // in = query , type = object, 提供一种简单的方法来表示参数中的嵌套对象值.`
2024-07-19 15:42:12 +08:00
)