jsonschema

package module
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

README

krakend-jsonschema

A JSON schema validator for the KrakenD API Gateway

Usage

Include in your krakend.json the JSON Schema configuration associated to every endpoint needing it. For instance:

{
	"version": "2",
	"endpoints": [
		{
			"endpoint": "/foo",
			"extra_config": {
				"github.com/devopsfaith/krakend-jsonschema": {
					YOUR SCHEMA HERE
				}
			}
		}  
	]
}

The configuration key "github.com/devopsfaith/krakend-jsonschema" takes directly as value the schema definition. Examples of schema can be found here

Documentation

Index

Constants

View Source
const Namespace = "github.com/davron112/krakend-jsonschema"

Variables

View Source
var ErrEmptyBody = &malformedError{err: errors.New("could not validate an empty body")}

Functions

func ProxyFactory

func ProxyFactory(logger logging.Logger, pf proxy.Factory) proxy.FactoryFunc

ProxyFactory creates an proxy factory over the injected one adding a JSON Schema validator middleware to the pipe when required

Types

This section is empty.

Jump to

Keyboard shortcuts

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