Documentation
¶
Index ¶
- func AppendErrorSchema(models *[]definitions.ModelMetadata, hasAnyErrorTypes bool)
- func AreJSONsIdentical(json1 []byte, json2 []byte) (bool, error)
- func FileExists(filename string) bool
- func GetArrayItemType(fieldType string) string
- func GetJsonNameFromTag(tag string, defaultName string) string
- func GetTagValue(tagStr string, tagName string, defaultValue string) string
- func HttpStatusCodeToString(httpStatusCode runtime.HttpStatusCode) string
- func IsDeprecated(deprecationOptions *definitions.DeprecationOptions) bool
- func IsFieldRequired(validationString string) bool
- func IsHiddenAsset(hideOptions *definitions.MethodHideOptions) bool
- func IsMapObject(typeName string) bool
- func IsPrimitiveType(typeName string) bool
- func IsSecurityNameInSecuritySchemes(securitySchemes []definitions.SecuritySchemeConfig, securityName string) bool
- func ParseBool(value string) *bool
- func ParseInteger(value string) *int64
- func ParseNumber(value string) *float64
- func ParseUInteger(value string) *uint64
- func ToOpenApiType(typeName string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendErrorSchema ¶
func AppendErrorSchema(models *[]definitions.ModelMetadata, hasAnyErrorTypes bool)
func FileExists ¶
func GetArrayItemType ¶
Helper function to determine the item type of an array
func GetJsonNameFromTag ¶
Since the json tag can have multiple values (e.g. `json: "name,omitempty"`), this function returns the first value as the name, only.
func GetTagValue ¶
GetTagValue extracts the value for a specific tag name from a struct tag string If the tag or value is not found, returns the default value Example usage:
tag := `json:"houseNumber" validate:"gte=1"` jsonValue := GetTagValue(tag, "json", "default") // returns "houseNumber" validateValue := GetTagValue(tag, "validate", "default") // returns "gte=1"
func HttpStatusCodeToString ¶
func HttpStatusCodeToString(httpStatusCode runtime.HttpStatusCode) string
func IsDeprecated ¶
func IsDeprecated(deprecationOptions *definitions.DeprecationOptions) bool
func IsFieldRequired ¶
func IsHiddenAsset ¶
func IsHiddenAsset(hideOptions *definitions.MethodHideOptions) bool
func IsMapObject ¶
func IsPrimitiveType ¶
func IsSecurityNameInSecuritySchemes ¶
func IsSecurityNameInSecuritySchemes(securitySchemes []definitions.SecuritySchemeConfig, securityName string) bool
func ParseInteger ¶
Helper function to parse integer validation values
func ParseNumber ¶
Helper function to parse numeric validation values
func ParseUInteger ¶
Helper function to parse integer validation values
func ToOpenApiType ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.