datareplacer

package
v0.101.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataReplacer added in v0.80.0

type DataReplacer struct {
	Definitions map[string]*spec.Schema
	Schema      *spec.Schema
}

DataReplacer takes a generated response and replaces values in it that share a name and type of parameters that were sent in with the request, as determined by the associated OpenAPI schema and the types of incoming values.

This is designed to have the effect of making returned fixtures more realistic while also staying a simple heuristic that doesn't require very much maintenance.

func (*DataReplacer) ReplaceData added in v0.80.0

func (r *DataReplacer) ReplaceData(requestData map[string]interface{}, responseData map[string]interface{}) map[string]interface{}

ReplaceData projects data from the incoming request into response data as appropriate.

Jump to

Keyboard shortcuts

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