func JSONSpec(path string) (*Document, error) {
	data, err := JSONDoc(path)
	if err != nil {
		return nil, err
	}
	return Analyzed(json.RawMessage(data), "")
}
JSONSpec loads a spec from a json document
package loads
import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/url"
	"github.com/go-openapi/analysis"
	"github.com/go-openapi/spec"
	"github.com/go-openapi/swag"
)
func JSONDoc(path string) (json.RawMessage, error) {
	data, err := swag.LoadFromFileOrHTTP(path)
	if err != nil {
		return nil, err
	}
	return json.RawMessage(data), nil
}
type DocLoader func(string) (json.RawMessage, error)
type DocMatcher func(string) bool
var (
	loaders       *loader
	defaultLoader *loader
)
func init() {
	defaultLoader = &loader{Match: func(_ string) bool { return true }, Fn: JSONDoc}
	loaders = defaultLoader
	spec.PathLoader = loaders.Fn
	AddLoader(swag.YAMLMatcher, swag.YAMLDoc)
}
func AddLoader(predicate DocMatcher, load DocLoader) {
	prev := loaders
	loaders = &loader{
		Match: predicate,
		Fn:    load,
		Next:  prev,
	}
	spec.PathLoader = loaders.Fn
}
type loader struct {
	Fn    DocLoader
	Match DocMatcher
	Next  *loader
}