schemas

package
v0.0.0-...-643a650 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const AlertMessageSchema = `` /* 963-byte string literal not displayed */

AlertMessageSchema is the json schema for alert message

Variables

This section is empty.

Functions

func BuildErrorsString

func BuildErrorsString(resultsErrors []gojsonschema.ResultError) interface{}

BuildErrorsString concatenates errors and builds pretty error strings

func ValidateSchemaRequest

func ValidateSchemaRequest(jsonBody []byte, schema string) (*gojsonschema.Result, error)

ValidateSchemaRequest validates the api request body with the required json schema

Types

type ErrReport

type ErrReport struct {
	Field       string      `json:"field"`
	ErrorType   string      `json:"errortype"`
	Value       interface{} `json:"value"`
	Description string      `json:"description"`
}

ErrReport is used to wrap schema validation errors int json object

type ErrorList

type ErrorList struct {
	// The error list
	// in: body
	Errors []ErrReport `json:"errors"`
}

ErrorList provides a collection of errors for processing swagger:response schemaValidation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL