Repository: getkin/kin-openapi
Pull request #351 (2021-04-26 18:11:26)

Clean APIs from trademarked name "Swagger"


Patch:
diff --git a/README.md b/README.md
index 0f3f35a..f147fe1 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ Here's some projects that depend on _kin-openapi_:
   * [https://github.com/Tufin/oasdiff](https://github.com/Tufin/oasdiff) - "A diff tool for OpenAPI Specification 3"
   * [github.com/getkin/kin](https://github.com/getkin/kin) - "A configurable backend"
   * [github.com/danielgtaylor/apisprout](https://github.com/danielgtaylor/apisprout) - "Lightweight, blazing fast, cross-platform OpenAPI 3 mock server with validation"
-  * [github.com/deepmap/oapi-codegen](https://github.com/deepmap/oapi-codegen) - Generate Go server boilerplate from an OpenAPI 3 spec
+  * [github.com/deepmap/oapi-codegen](https://github.com/deepmap/oapi-codegen) - Generate Go server boilerplate from an OpenAPIv3 spec document
   * [github.com/dunglas/vulcain](https://github.com/dunglas/vulcain) - "Use HTTP/2 Server Push to create fast and idiomatic client-driven REST APIs"
   * [github.com/danielgtaylor/restish](https://github.com/danielgtaylor/restish) - "...a CLI for interacting with REST-ish HTTP APIs with some nice features built-in"
   * [github.com/goadesign/goa](https://github.com/goadesign/goa) - "Goa is a framework for building micro-services and APIs in Go using a unique design-first approach."
@@ -44,15 +44,15 @@ Here's some projects that depend on _kin-openapi_:
 
 # Some recipes
 ## Loading OpenAPI document
-Use `SwaggerLoader`, which resolves all references:
+Use `openapi3.Loader`, which resolves all references:
 ```go
-swagger, err := openapi3.NewSwaggerLoader().LoadSwaggerFromFile("swagger.json")
+doc, err := openapi3.NewLoader().LoadFromFile("swagger.json")
 ```
 
 ## Getting OpenAPI operation that matches request
 ```go
-loader := openapi3.NewSwaggerLoader()
-doc, _ := loader.LoadSwaggerFromData([]byte(`...`))
+loader := openapi3.NewLoader()
+doc, _ := loader.LoadFromData([]byte(`...`))
 _ := doc.Validate(loader.Context)
 router, _ := gorillamux.NewRouter(doc)
 route, pathParams, _ := router.FindRoute(httpRequest)
@@ -76,8 +76,8 @@ import (
 
 func main() {
 	ctx := context.Background()
-	loader := &openapi3.SwaggerLoader{Context: ctx}
-	doc, _ := loader.LoadSwaggerFromFile("openapi3_spec.json")
+	loader := &openapi3.Loader{Context: ctx}
+	doc, _ := loader.LoadFromFile("openapi3_spec.json")
 	_ := doc.Validate(ctx)
 	router, _ := legacyrouter.NewRouter(doc)
 	httpReq, _ := http.NewRequest(http.MethodGet, "/items", nil)
@@ -193,6 +193,20 @@ func arrayUniqueItemsChecker(items []interface{}) bool {
 
 ## Sub-v0 breaking API changes
 
+### v0.61.0
+* Renamed `openapi2.Swagger` to `openapi2.T`.
+* Renamed `openapi2conv.FromV3Swagger` to `openapi2conv.FromV3`.
+* Renamed `openapi2conv.ToV3Swagger` to `openapi2conv.ToV3`.
+* Renamed `openapi3.LoadSwaggerFromData` to `openapi3.LoadFromData`.
+* Renamed `openapi3.LoadSwaggerFromDataWithPath` to `openapi3.LoadFromDataWithPath`.
+* Renamed `openapi3.LoadSwaggerFromFile` to `openapi3.LoadFromFile`.
+* Renamed `openapi3.LoadSwaggerFromURI` to `openapi3.LoadFromURI`.
+* Renamed `openapi3.NewSwaggerLoader` to `openapi3.NewLoader`.
+* Renamed `openapi3.Swagger` to `openapi3.T`.
+* Renamed `openapi3.SwaggerLoader` to `openapi3.Loader`.
+* Renamed `openapi3filter.ValidationHandler.SwaggerFile` to `openapi3filter.ValidationHandler.File`.
+* Renamed `routers.Route.Swagger` to `routers.Route.Spec`.
+
 ### v0.51.0
 * Type `openapi3filter.Route` moved to `routers` (and `Route.Handler` was dropped. See https://github.com/getkin/kin-openapi/issues/329)
 * Type `openapi3filter.RouteError` moved to `routers` (so did `ErrPathNotFound` and `ErrMethodNotAllowed` which are now `RouteError`s)
diff --git a/openapi2/doc.go b/openapi2/doc.go
new file mode 100644
index 0000000..b4762d5
--- /dev/null
+++ b/openapi2/doc.go
@@ -0,0 +1,7 @@
+// Package openapi2 parses and writes OpenAPIv2 specification documents.
+//
+// Does not cover all elements of OpenAPIv2.
+// When OpenAPI version 3 is backwards-compatible with version 2, version 3 elements have been used.
+//
+// See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
+package openapi2
diff --git a/openapi2/openapi2.go b/openapi2/openapi2.go
index 8797c57..937cc08 100644
--- a/openapi2/openapi2.go
+++ b/openapi2/openapi2.go
@@ -1,10 +1,3 @@
-// Package openapi2 parses and writes OpenAPI 2 specifications.
-//
-// Does not cover all elements of OpenAPI 2.
-// When OpenAPI version 3 is backwards-compatible with version 2, version 3 elements have been used.
-//
-// The specification:
-// https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
 package openapi2
 
 import (
@@ -16,7 +9,8 @@ import (
 	"github.com/getkin/kin-openapi/openapi3"
 )
 
-type Swagger struct {
+// T is the root of an OpenAPI v2 document
+type T struct {
 	openapi3.ExtensionProps
 	Swagger             string                         `json:"swagger"`
 	Info                openapi3.Info                  `json:"info"`
@@ -34,19 +28,19 @@ type Swagger struct {
 	Tags                openapi3.Tags                  `json:"tags,omitempty"`
 }
 
-func (swagger *Swagger) MarshalJSON() ([]byte, error) {
-	return jsoninfo.MarshalStrictStruct(swagger)
+func (doc *T) MarshalJSON() ([]byte, error) {
+	return jsoninfo.MarshalStrictStruct(doc)
 }
 
-func (swagger *Swagger) UnmarshalJSON(data []byte) error {
-	return jsoninfo.UnmarshalStrictStruct(data, swagger)
+func (doc *T) UnmarshalJSON(data []byte) error {
+	return jsoninfo.UnmarshalStrictStruct(data, doc)
 }
 
-func (swagger *Swagger) AddOperation(path string, method string, operation *Operation) {
-	paths := swagger.Paths
+func (doc *T) AddOperation(path string, method string, operation *Operation) {
+	paths := doc.Paths
 	if paths == nil {
 		paths = make(map[string]*PathItem, 8)
-		swagger.Paths = paths
+		doc.Paths = paths
 	}
 	pathItem := paths[path]
 	if pathItem == nil {
diff --git a/openapi2conv/doc.go b/openapi2conv/doc.go
new file mode 100644
index 0000000..7b87ec2
--- /dev/null
+++ b/openapi2conv/doc.go
@@ -0,0 +1,2 @@
+// Package openapi2conv converts an OpenAPI v2 specification document to v3.
+package openapi2conv
diff --git a/openapi2conv/openapi2_conv.go b/openapi2conv/openapi2_conv.go
index 2622f76..05447ac 100644
--- a/openapi2conv/openapi2_conv.go
+++ b/openapi2conv/openapi2_conv.go
@@ -1,4 +1,3 @@
-// Package openapi2conv converts an OpenAPI v2 specification to v3.
 package openapi2conv
 
 import (
@@ -13,116 +12,116 @@ import (
 	"github.com/getkin/kin-openapi/openapi3"
 )
 
-// ToV3Swagger converts an OpenAPIv2 spec to an OpenAPIv3 spec
-func ToV3Swagger(swagger *openapi2.Swagger) (*openapi3.Swagger, error) {
-	stripNonCustomExtensions(swagger.Extensions)
+// ToV3 converts an OpenAPIv2 spec to an OpenAPIv3 spec
+func ToV3(doc2 *openapi2.T) (*openapi3.T, error) {
+	stripNonCustomExtensions(doc2.Extensions)
 
-	result := &openapi3.Swagger{
+	doc3 := &openapi3.T{
 		OpenAPI:        "3.0.3",
-		Info:           &swagger.Info,
+		Info:           &doc2.Info,
 		Components:     openapi3.Components{},
-		Tags:           swagger.Tags,
-		ExtensionProps: swagger.ExtensionProps,
-		ExternalDocs:   swagger.ExternalDocs,
+		Tags:           doc2.Tags,
+		ExtensionProps: doc2.ExtensionProps,
+		ExternalDocs:   doc2.ExternalDocs,
 	}
 
-	if host := swagger.Host; host != "" {
-		schemes := swagger.Schemes
+	if host := doc2.Host; host != "" {
+		schemes := doc2.Schemes
 		if len(schemes) == 0 {
 			schemes = []string{"https://"}
 		}
-		basePath := swagger.BasePath
+		basePath := doc2.BasePath
 		for _, scheme := range schemes {
 			u := url.URL{
 				Scheme: scheme,
 				Host:   host,
 				Path:   basePath,
 			}
-			result.AddServer(&openapi3.Server{URL: u.String()})
+			doc3.AddServer(&openapi3.Server{URL: u.String()})
 		}
 	}
 
-	result.Components.Schemas = make(map[string]*openapi3.SchemaRef)
-	if parameters := swagger.Parameters; len(parameters) != 0 {
-		result.Components.Parameters = make(map[string]*openapi3.ParameterRef)
-		result.Components.RequestBodies = make(map[string]*openapi3.RequestBodyRef)
+	doc3.Components.Schemas = make(map[string]*openapi3.SchemaRef)
+	if parameters := doc2.Parameters; len(parameters) != 0 {
+		doc3.Components.Parameters = make(map[string]*openapi3.ParameterRef)
+		doc3.Components.RequestBodies = make(map[string]*openapi3.RequestBodyRef)
 		for k, parameter := range parameters {
-			v3Parameter, v3RequestBody, v3SchemaMap, err := ToV3Parameter(&result.Components, parameter, swagger.Consumes)
+			v3Parameter, v3RequestBody, v3SchemaMap, err := ToV3Parameter(&doc3.Components, parameter, doc2.Consumes)
 			switch {
 			case err != nil:
 				return nil, err
 			case v3RequestBody != nil:
-				result.Components.RequestBodies[k] = v3RequestBody
+				doc3.Components.RequestBodies[k] = v3RequestBody
 			case v3SchemaMap != nil:
 				for _, v3Schema := range v3SchemaMap {
-					result.Components.Schemas[k] = v3Schema
+					doc3.Components.Schemas[k] = v3Schema
 				}
 			default:
-				result.Components.Parameters[k] = v3Parameter
+				doc3.Components.Parameters[k] = v3Parameter
 			}
 		}
 	}
 
-	if paths := swagger.Paths; len(paths) != 0 {
-		resultPaths := make(map[string]*openapi3.PathItem, len(paths))
+	if paths := doc2.Paths; len(paths) != 0 {
+		doc3Paths := make(map[string]*openapi3.PathItem, len(paths))
 		for path, pathItem := range paths {
-			r, err := ToV3PathItem(swagger, &result.Components, pathItem, swagger.Consumes)
+			r, err := ToV3PathItem(doc2, &doc3.Components, pathItem, doc2.Consumes)
 			if err != nil {
 				return nil, err
 			}
-			resultPaths[path] = r
+			doc3Paths[path] = r
 		}
-		result.Paths = resultPaths
+		doc3.Paths = doc3Paths
 	}
 
-	if responses := swagger.Responses; len(responses) != 0 {
-		result.Components.Responses = make(map[string]*openapi3.ResponseRef, len(responses))
+	if responses := doc2.Responses; len(responses) != 0 {
+		doc3.Components.Responses = make(map[string]*openapi3.ResponseRef, len(responses))
 		for k, response := range responses {
 			r, err := ToV3Response(response)
 			if err != nil {
 				return nil, err
 			}
-			result.Components.Responses[k] = r
+			doc3.Components.Responses[k] = r
 		}
 	}
 
-	for key, schema := range ToV3Schemas(swagger.Definitions) {
-		result.Components.Schemas[key] = schema
+	for key, schema := range ToV3Schemas(doc2.Definitions) {
+		doc3.Components.Schemas[key] = schema
 	}
 
-	if m := swagger.SecurityDefinitions; len(m) != 0 {
-		resultSecuritySchemes := make(map[string]*openapi3.SecuritySchemeRef)
+	if m := doc2.SecurityDefinitions; len(m) != 0 {
+		doc3SecuritySchemes := make(map[string]*openapi3.SecuritySchemeRef)
 		for k, v := range m {
 			r, err := ToV3SecurityScheme(v)
 			if err != nil {
 				return nil, err
 			}
-			resultSecuritySchemes[k] = r
+			doc3SecuritySchemes[k] = r
 		}
-		result.Components.SecuritySchemes = resultSecuritySchemes
+		doc3.Components.SecuritySchemes = doc3SecuritySchemes
 	}
 
-	result.Security = ToV3SecurityRequirements(swagger.Security)
+	doc3.Security = ToV3SecurityRequirements(doc2.Security)
 	{
-		sl := openapi3.NewSwaggerLoader()
-		if err := sl.ResolveRefsIn(result, nil); err != nil {
+		sl := openapi3.NewLoader()
+		if err := sl.ResolveRefsIn(doc3, nil); err != nil {
 			return nil, err
 		}
 	}
-	return result, nil
+	return doc3, nil
 }
 
-func ToV3PathItem(swagger *openapi2.Swagger, components *openapi3.Components, pathItem *openapi2.PathItem, consumes []string) (*openapi3.PathItem, error) {
+func ToV3PathItem(doc2 *openapi2.T, components *openapi3.Components, pathItem *openapi2.PathItem, consumes []string) (*openapi3.PathItem, error) {
 	stripNonCustomExtensions(pathItem.Extensions)
-	result := &openapi3.PathItem{
+	doc3 := &openapi3.PathItem{
 		ExtensionProps: pathItem.ExtensionProps,
 	}
 	for method, operation := range pathItem.Operations() {
-		resultOperation, err := ToV3Operation(swagger, components, pathItem, operation, consumes)
+		doc3Operation, err := ToV3Operation(doc2, components, pathItem, operation, consumes)
 		if err != nil {
 			return nil, err
 		}
-		result.SetOperation(method, resultOperation)
+		doc3.SetOperation(method, doc3Operation)
 	}
 	for _, parameter := range pathItem.Parameters {
 		v3Parameter, v3RequestBody, v3Schema, err := ToV3Parameter(components, parameter, consumes)
@@ -134,18 +133,18 @@ func ToV3PathItem(swagger *openapi2.Swagger, components *openapi3.Components, pa
 		case v3Schema != nil:
 			return nil, errors.New("pathItem must not have a schema parameter")
 		default:
-			result.Parameters = append(result.Parameters, v3Parameter)
+			doc3.Parameters = append(doc3.Parameters, v3Parameter)
 		}
 	}
-	return result, nil
+	return doc3, nil
 }
 
-func ToV3Operation(swagger *openapi2.Swagger, components *openapi3.Components, pathItem *openapi2.PathItem, operation *openapi2.Operation, consumes []string) (*openapi3.Operation, error) {
+func ToV3Operation(doc2 *openapi2.T, components *openapi3.Components, pathItem *openapi2.PathItem, operation *openapi2.Operation, consumes []string) (*openapi3.Operation, error) {
 	if operation == nil {
 		return nil, nil
 	}
 	stripNonCustomExtensions(operation.Extensions)
-	result := &openapi3.Operation{
+	doc3 := &openapi3.Operation{
 		OperationID:    operation.OperationID,
 		Summary:        operation.Summary,
 		Description:    operation.Description,
@@ -153,8 +152,8 @@ func ToV3Operation(swagger *openapi2.Swagger, components *openapi3.Components, p
 		ExtensionProps: operation.ExtensionProps,
 	}
 	if v := operation.Security; v != nil {
-		resultSecurity := ToV3SecurityRequirements(*v)
-		result.Security = &resultSecurity
+		doc3Security := ToV3SecurityRequirements(*v)
+		doc3.Security = &doc3Security
 	}
 
 	if len(operation.Consumes) > 0 {
@@ -175,26 +174,26 @@ func ToV3Operation(swagger *openapi2.Swagger, components *openapi3.Components, p
 				formDataSchemas[key] = v3Schema
 			}
 		default:
-			result.Parameters = append(result.Parameters, v3Parameter)
+			doc3.Parameters = append(doc3.Parameters, v3Parameter)
 		}
 	}
 	var err error
-	if result.RequestBody, err = onlyOneReqBodyParam(reqBodies, formDataSchemas, components, consumes); err != nil {
+	if doc3.RequestBody, err = onlyOneReqBodyParam(reqBodies, formDataSchemas, components, consumes); err != nil {
 		return nil, err
 	}
 
 	if responses := operation.Responses; responses != nil {
-		resultResponses := make(openapi3.Responses, len(responses))
+		doc3Responses := make(openapi3.Responses, len(responses))
 		for k, response := range responses {
-			result, err := ToV3Response(response)
+			doc3, err := ToV3Response(response)
 			if err != nil {
 				return nil, err
 			}
-			resultResponses[k] = result
+			doc3Responses[k] = doc3
 		}
-		result.Responses = resultResponses
+		doc3.Responses = doc3Responses
 	}
-	return result, nil
+	return doc3, nil
 }
 
 func getParameterNameFromOldRef(ref string) string {
@@ -409,9 +408,7 @@ func ToV3Response(response *openapi2.Response) (*openapi3.ResponseRef, error) {
 	if schemaRef := response.Schema; schemaRef != nil {
 		result.WithJSONSchemaRef(ToV3SchemaRef(schemaRef))
 	}
-	return &openapi3.ResponseRef{
-		Value: result,
-	}, nil
+	return &openapi3.ResponseRef{Value: result}, nil
 }
 
 func ToV3Schemas(defs map[string]*openapi3.SchemaRef) map[string]*openapi3.SchemaRef {
@@ -528,28 +525,28 @@ func ToV3SecurityScheme(securityScheme *openapi2.SecurityScheme) (*openapi3.Secu
 	}, nil
 }
 
-// FromV3Swagger converts an OpenAPIv3 spec to an OpenAPIv2 spec
-func FromV3Swagger(swagger *openapi3.Swagger) (*openapi2.Swagger, error) {
-	resultResponses, err := FromV3Responses(swagger.Components.Responses, &swagger.Components)
+// FromV3 converts an OpenAPIv3 spec to an OpenAPIv2 spec
+func FromV3(doc3 *openapi3.T) (*openapi2.T, error) {
+	doc2Responses, err := FromV3Responses(doc3.Components.Responses, &doc3.Components)
 	if err != nil {
 		return nil, err
 	}
-	stripNonCustomExtensions(swagger.Extensions)
-	schemas, parameters := FromV3Schemas(swagger.Components.Schemas, &swagger.Components)
-	result := &openapi2.Swagger{
+	stripNonCustomExtensions(doc3.Extensions)
+	schemas, parameters := FromV3Schemas(doc3.Components.Schemas, &doc3.Components)
+	doc2 := &openapi2.T{
 		Swagger:        "2.0",
-		Info:           *swagger.Info,
+		Info:           *doc3.Info,
 		Definitions:    schemas,
 		Parameters:     parameters,
-		Responses:      resultResponses,
-		Tags:           swagger.Tags,
-		ExtensionProps: swagger.ExtensionProps,
-		ExternalDocs:   swagger.ExternalDocs,
+		Responses:      doc2Responses,
+		Tags:           doc3.Tags,
+		ExtensionProps: doc3.ExtensionProps,
+		ExternalDocs:   doc3.ExternalDocs,
 	}
 
 	isHTTPS := false
 	isHTTP := false
-	servers := swagger.Servers
+	servers := doc3.Servers
 	for i, server := range servers {
 		parsedURL, err := url.Parse(server.URL)
 		if err == nil {
@@ -561,85 +558,85 @@ func FromV3Swagger(swagger *openapi3.Swagger) (*openapi2.Swagger, error) {
 			}
 			// The first server is assumed to provide the base path
 			if i == 0 {
-				result.Host = parsedURL.Host
-				result.BasePath = parsedURL.Path
+				doc2.Host = parsedURL.Host
+				doc2.BasePath = parsedURL.Path
 			}
 		}
 	}
 	if isHTTPS {
-		result.Schemes = append(result.Schemes, "https")
+		doc2.Schemes = append(doc2.Schemes, "https")
 	}
 	if isHTTP {
-		result.Schemes = append(result.Schemes, "http")
+		doc2.Schemes = append(doc2.Schemes, "http")
 	}
-	for path, pathItem := range swagger.Paths {
+	for path, pathItem := range doc3.Paths {
 		if pathItem == nil {
 			continue
 		}
-		result.AddOperation(path, "GET", nil)
+		doc2.AddOperation(path, "GET", nil)
 		stripNonCustomExtensions(pathItem.Extensions)
-		addPathExtensions(result, path, pathItem.ExtensionProps)
+		addPathExtensions(doc2, path, pathItem.ExtensionProps)
 		for method, operation := range pathItem.Operations() {
 			if operation == nil {
 				continue
 			}
-			resultOperation, err := FromV3Operation(swagger, operation)
+			doc2Operation, err := FromV3Operation(doc3, operation)
 			if err != nil {
 				return nil, err
 			}
-			result.AddOperation(path, method, resultOperation)
+			doc2.AddOperation(path, method, doc2Operation)
 		}
 		params := openapi2.Parameters{}
 		for _, param := range pathItem.Parameters {
-			p, err := FromV3Parameter(param, &swagger.Components)
+			p, err := FromV3Parameter(param, &doc3.Components)
 			if err != nil {
 				return nil, err
 			}
 			params = append(params, p)
 		}
 		sort.Sort(params)
-		result.Paths[path].Parameters = params
+		doc2.Paths[path].Parameters = params
 	}
 
-	for name, param := range swagger.Components.Parameters {
-		if result.Parameters[name], err = FromV3Parameter(param, &swagger.Components); err != nil {
+	for name, param := range doc3.Components.Parameters {
+		if doc2.Parameters[name], err = FromV3Parameter(param, &doc3.Components); err != nil {
 			return nil, err
 		}
 	}
 
-	for name, requestBodyRef := range swagger.Components.RequestBodies {
-		bodyOrRefParameters, formDataParameters, consumes, err := fromV3RequestBodies(name, requestBodyRef, &swagger.Components)
+	for name, requestBodyRef := range doc3.Components.RequestBodies {
+		bodyOrRefParameters, formDataParameters, consumes, err := fromV3RequestBodies(name, requestBodyRef, &doc3.Components)
 		if err != nil {
 			return nil, err
 		}
 		if len(formDataParameters) != 0 {
 			for _, param := range formDataParameters {
-				result.Parameters[param.Name] = param
+				doc2.Parameters[param.Name] = param
 			}
 		} else if len(bodyOrRefParameters) != 0 {
 			for _, param := range bodyOrRefParameters {
-				result.Parameters[name] = param
+				doc2.Parameters[name] = param
 			}
 		}
 
 		if len(consumes) != 0 {
-			result.Consumes = consumesToArray(consumes)
+			doc2.Consumes = consumesToArray(consumes)
 		}
 	}
 
-	if m := swagger.Components.SecuritySchemes; m != nil {
-		resultSecuritySchemes := make(map[string]*openapi2.SecurityScheme)
+	if m := doc3.Components.SecuritySchemes; m != nil {
+		doc2SecuritySchemes := make(map[string]*openapi2.SecurityScheme)
 		for id, securityScheme := range m {
-			v, err := FromV3SecurityScheme(swagger, securityScheme)
+			v, err := FromV3SecurityScheme(doc3, securityScheme)
 			if err != nil {
 				return nil, err
 			}
-			resultSecuritySchemes[id] = v
+			doc2SecuritySchemes[id] = v
 		}
-		result.SecurityDefinitions = resultSecuritySchemes
+		doc2.SecurityDefinitions = doc2SecuritySchemes
 	}
-	result.Security = FromV3SecurityRequirements(swagger.Security)
-	return result, nil
+	doc2.Security = FromV3SecurityRequirements(doc3.Security)
+	return doc2, nil
 }
 
 func consumesToArray(consumes map[string]struct{}) []string {
@@ -662,7 +659,7 @@ func fromV3RequestBodies(name string, requestBodyRef *openapi3.RequestBodyRef, c
 		return
 	}
 
-	//Only select one formData or request body for an individual requesstBody as swagger 2 does not support multiples
+	//Only select one formData or request body for an individual requesstBody as OpenAPI 2 does not support multiples
 	if requestBodyRef.Value != nil {
 		for contentType, mediaType := range requestBodyRef.Value.Content {
 			if consumes == nil {
@@ -789,20 +786,20 @@ func FromV3SecurityRequirements(requirements openapi3.SecurityRequirements) open
 	return result
 }
 
-func FromV3PathItem(swagger *openapi3.Swagger, pathItem *openapi3.PathItem) (*openapi2.PathItem, error) {
+func FromV3PathItem(doc3 *openapi3.T, pathItem *openapi3.PathItem) (*openapi2.PathItem, error) {
 	stripNonCustomExtensions(pathItem.Extensions)
 	result := &openapi2.PathItem{
 		ExtensionProps: pathItem.ExtensionProps,
 	}
 	for method, operation := range pathItem.Operations() {
-		r, err := FromV3Operation(swagger, operation)
+		r, err := FromV3Operation(doc3, operation)
 		if err != nil {
 			return nil, err
 		}
 		result.SetOperation(method, r)
 	}
 	for _, parameter := range pathItem.Parameters {
-		p, err := FromV3Parameter(parameter, &swagger.Components)
+		p, err := FromV3Parameter(parameter, &doc3.Components)
 		if err != nil {
 			return nil, err
 		}
@@ -875,7 +872,7 @@ func FromV3RequestBodyFormData(mediaType *openapi3.MediaType) openapi2.Parameter
 	return parameters
 }
 
-func FromV3Operation(swagger *openapi3.Swagger, operation *openapi3.Operation) (*openapi2.Operation, error) {
+func FromV3Operation(doc3 *openapi3.T, operation *openapi3.Operation) (*openapi2.Operation, error) {
 	if operation == nil {
 		return nil, nil
 	}
@@ -892,7 +889,7 @@ func FromV3Operation(swagger *openapi3.Swagger, operation *openapi3.Operation) (
 		result.Security = &resultSecurity
 	}
 	for _, parameter := range operation.Parameters {
-		r, err := FromV3Parameter(parameter, &swagger.Components)
+		r, err := FromV3Parameter(parameter, &doc3.Components)
 		if err != nil {
 			return nil, err
 		}
@@ -905,7 +902,7 @@ func FromV3Operation(swagger *openapi3.Swagger, operation *openapi3.Operation) (
 			return nil, errors.New("could not find a name for request body")
 		}
 
-		bodyOrRefParameters, formDataParameters, consumes, err := fromV3RequestBodies(name, v, &swagger.Components)
+		bodyOrRefParameters, formDataParameters, consumes, err := fromV3RequestBodies(name, v, &doc3.Components)
 		if err != nil {
 			return nil, err
 		}
@@ -926,7 +923,7 @@ func FromV3Operation(swagger *openapi3.Swagger, operation *openapi3.Operation) (
 	sort.Sort(result.Parameters)
 
 	if responses := operation.Responses; responses != nil {
-		resultResponses, err := FromV3Responses(responses, &swagger.Components)
+		resultResponses, err := FromV3Responses(responses, &doc3.Components)
 		if err != nil {
 			return nil, err
 		}
@@ -1032,7 +1029,7 @@ func FromV3Response(ref *openapi3.ResponseRef, components *openapi3.Components)
 	return result, nil
 }
 
-func FromV3SecurityScheme(swagger *openapi3.Swagger, ref *openapi3.SecuritySchemeRef) (*openapi2.SecurityScheme, error) {
+func FromV3SecurityScheme(doc3 *openapi3.T, ref *openapi3.SecuritySchemeRef) (*openapi2.SecurityScheme, error) {
 	securityScheme := ref.Value
 	if securityScheme == nil {
 		return nil, nil
@@ -1095,11 +1092,11 @@ func stripNonCustomExtensions(extensions map[string]interface{}) {
 	}
 }
 
-func addPathExtensions(swagger *openapi2.Swagger, path string, extensionProps openapi3.ExtensionProps) {
-	paths := swagger.Paths
+func addPathExtensions(doc2 *openapi2.T, path string, extensionProps openapi3.ExtensionProps) {
+	paths := doc2.Paths
 	if paths == nil {
 		paths = make(map[string]*openapi2.PathItem, 8)
-		swagger.Paths = paths
+		doc2.Paths = paths
 	}
 	pathItem := paths[path]
 	if pathItem == nil {
diff --git a/openapi3/callback.go b/openapi3/callback.go
index b216d1a..8995e47 100644
--- a/openapi3/callback.go
+++ b/openapi3/callback.go
@@ -26,9 +26,9 @@ func (c Callbacks) JSONLookup(token string) (interface{}, error) {
 // Callback is specified by OpenAPI/Swagger standard version 3.0.
 type Callback map[string]*PathItem
 
-func (value Callback) Validate(c context.Context) error {
+func (value Callback) Validate(ctx context.Context) error {
 	for _, v := range value {
-		if err := v.Validate(c); err != nil {
+		if err := v.Validate(ctx); err != nil {
 			return err
 		}
 	}
diff --git a/openapi3/components.go b/openapi3/components.go
index e01f961..7acafab 100644
--- a/openapi3/components.go
+++ b/openapi3/components.go
@@ -34,12 +34,12 @@ func (components *Components) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalStrictStruct(data, components)
 }
 
-func (components *Components) Validate(c context.Context) (err error) {
+func (components *Components) Validate(ctx context.Context) (err error) {
 	for k, v := range components.Schemas {
 		if err = ValidateIdentifier(k); err != nil {
 			return
 		}
-		if err = v.Validate(c); err != nil {
+		if err = v.Validate(ctx); err != nil {
 			return
 		}
 	}
@@ -48,7 +48,7 @@ func (components *Components) Validate(c context.Context) (err error) {
 		if err = ValidateIdentifier(k); err != nil {
 			return
 		}
-		if err = v.Validate(c); err != nil {
+		if err = v.Validate(ctx); err != nil {
 			return
 		}
 	}
@@ -57,7 +57,7 @@ func (components *Components) Validate(c context.Context) (err error) {
 		if err = ValidateIdentifier(k); err != nil {
 			return
 		}
-		if err = v.Validate(c); err != nil {
+		if err = v.Validate(ctx); err != nil {
 			return
 		}
 	}
@@ -66,7 +66,7 @@ func (components *Components) Validate(c context.Context) (err error) {
 		if err = ValidateIdentifier(k); err != nil {
 			return
 		}
-		if err = v.Validate(c); err != nil {
+		if err = v.Validate(ctx); err != nil {
 			return
 		}
 	}
@@ -75,7 +75,7 @@ func (components *Components) Validate(c context.Context) (err error) {
 		if err = ValidateIdentifier(k); err != nil {
 			return
 		}
-		if err = v.Validate(c); err != nil {
+		if err = v.Validate(ctx); err != nil {
 			return
 		}
 	}
@@ -84,7 +84,7 @@ func (components *Components) Validate(c context.Context) (err error) {
 		if err = ValidateIdentifier(k); err != nil {
 			return
 		}
-		if err = v.Validate(c); err != nil {
+		if err = v.Validate(ctx); err != nil {
 			return
 		}
 	}
diff --git a/openapi3/content.go b/openapi3/content.go
index abe376e..5edb7d3 100644
--- a/openapi3/content.go
+++ b/openapi3/content.go
@@ -104,10 +104,10 @@ func (content Content) Get(mime string) *MediaType {
 	return content["*/*"]
 }
 
-func (content Content) Validate(c context.Context) error {
-	for _, v := range content {
+func (value Content) Validate(ctx context.Context) error {
+	for _, v := range value {
 		// Validate MediaType
-		if err := v.Validate(c); err != nil {
+		if err := v.Validate(ctx); err != nil {
 			return err
 		}
 	}
diff --git a/openapi3/discriminator.go b/openapi3/discriminator.go
index de518d5..82ad704 100644
--- a/openapi3/discriminator.go
+++ b/openapi3/discriminator.go
@@ -21,6 +21,6 @@ func (value *Discriminator) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalStrictStruct(data, value)
 }
 
-func (value *Discriminator) Validate(c context.Context) error {
+func (value *Discriminator) Validate(ctx context.Context) error {
 	return nil
 }
diff --git a/openapi3/doc.go b/openapi3/doc.go
index efe8b4a..fc2735c 100644
--- a/openapi3/doc.go
+++ b/openapi3/doc.go
@@ -1,5 +1,4 @@
-// Package openapi3 parses and writes OpenAPI 3 specifications.
+// Package openapi3 parses and writes OpenAPI 3 specification documents.
 //
-// The OpenAPI 3.0 specification can be found at:
-//   https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md
+// See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md
 package openapi3
diff --git a/openapi3/encoding.go b/openapi3/encoding.go
index 4bf657f..ad48b91 100644
--- a/openapi3/encoding.go
+++ b/openapi3/encoding.go
@@ -61,21 +61,21 @@ func (encoding *Encoding) SerializationMethod() *SerializationMethod {
 	return sm
 }
 
-func (encoding *Encoding) Validate(c context.Context) error {
-	if encoding == nil {
+func (value *Encoding) Validate(ctx context.Context) error {
+	if value == nil {
 		return nil
 	}
-	for k, v := range encoding.Headers {
+	for k, v := range value.Headers {
 		if err := ValidateIdentifier(k); err != nil {
 			return nil
 		}
-		if err := v.Validate(c); err != nil {
+		if err := v.Validate(ctx); err != nil {
 			return nil
 		}
 	}
 
 	// Validate a media types's serialization method.
-	sm := encoding.SerializationMethod()
+	sm := value.SerializationMethod()
 	switch {
 	case sm.Style == SerializationForm && sm.Explode,
 		sm.Style == SerializationForm && !sm.Explode,
diff --git a/openapi3/examples.go b/openapi3/examples.go
index 98f79b8..f7f90ce 100644
--- a/openapi3/examples.go
+++ b/openapi3/examples.go
@@ -1,6 +1,7 @@
 package openapi3
 
 import (
+	"context"
 	"fmt"
 
 	"github.com/getkin/kin-openapi/jsoninfo"
@@ -46,3 +47,7 @@ func (example *Example) MarshalJSON() ([]byte, error) {
 func (example *Example) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalStrictStruct(data, example)
 }
+
+func (value *Example) Validate(ctx context.Context) error {
+	return nil // TODO
+}
diff --git a/openapi3/header.go b/openapi3/header.go
index bab30a4..7cf61f8 100644
--- a/openapi3/header.go
+++ b/openapi3/header.go
@@ -43,9 +43,9 @@ func (value *Header) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalStrictStruct(data, value)
 }
 
-func (value *Header) Validate(c context.Context) error {
+func (value *Header) Validate(ctx context.Context) error {
 	if v := value.Schema; v != nil {
-		if err := v.Validate(c); err != nil {
+		if err := v.Validate(ctx); err != nil {
 			return err
 		}
 	}
diff --git a/openapi3/info.go b/openapi3/info.go
index 386ae86..2adffff 100644
--- a/openapi3/info.go
+++ b/openapi3/info.go
@@ -26,15 +26,15 @@ func (value *Info) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalStrictStruct(data, value)
 }
 
-func (value *Info) Validate(c context.Context) error {
+func (value *Info) Validate(ctx context.Context) error {
 	if contact := value.Contact; contact != nil {
-		if err := contact.Validate(c); err != nil {
+		if err := contact.Validate(ctx); err != nil {
 			return err
 		}
 	}
 
 	if license := value.License; license != nil {
-		if err := license.Validate(c); err != nil {
+		if err := license.Validate(ctx); err != nil {
 			return err
 		}
 	}
@@ -66,7 +66,7 @@ func (value *Contact) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalStrictStruct(data, value)
 }
 
-func (value *Contact) Validate(c context.Context) error {
+func (value *Contact) Validate(ctx context.Context) error {
 	return nil
 }
 
@@ -85,7 +85,7 @@ func (value *License) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalStrictStruct(data, value)
 }
 
-func (value *License) Validate(c context.Context) error {
+func (value *License) Validate(ctx context.Context) error {
 	if value.Name == "" {
 		return errors.New("value of license name must be a non-empty string")
 	}
diff --git a/openapi3/link.go b/openapi3/link.go
index 722c166..7d627b8 100644
--- a/openapi3/link.go
+++ b/openapi3/link.go
@@ -44,7 +44,7 @@ func (value *Link) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalStrictStruct(data, value)
 }
 
-func (value *Link) Validate(c context.Context) error {
+func (value *Link) Validate(ctx context.Context) error {
 	if value.OperationID == "" && value.OperationRef == "" {
 		return errors.New("missing operationId or operationRef on link")
 	}
diff --git a/openapi3/swagger_loader.go b/openapi3/loader.go
similarity index 54%
rename from openapi3/swagger_loader.go
rename to openapi3/loader.go
index d97f803..ff93182 100644
--- a/openapi3/swagger_loader.go
+++ b/openapi3/loader.go
@@ -25,19 +25,19 @@ func failedToResolveRefFragmentPart(value, what string) error {
 	return fmt.Errorf("failed to resolve %q in fragment in URI: %q", what, value)
 }
 
-// SwaggerLoader helps deserialize a Swagger object
-type SwaggerLoader struct {
+// Loader helps deserialize an OpenAPIv3 document
+type Loader struct {
 	// IsExternalRefsAllowed enables visiting other files
 	IsExternalRefsAllowed bool
 
 	// ReadFromURIFunc allows overriding the any file/URL reading func
-	ReadFromURIFunc func(loader *SwaggerLoader, url *url.URL) ([]byte, error)
+	ReadFromURIFunc func(loader *Loader, url *url.URL) ([]byte, error)
 
 	Context context.Context
 
 	visitedPathItemRefs map[string]struct{}
 
-	visitedDocuments map[string]*Swagger
+	visitedDocuments map[string]*T
 
 	visitedExample        map[*Example]struct{}
 	visitedHeader         map[*Header]struct{}
@@ -49,44 +49,44 @@ type SwaggerLoader struct {
 	visitedSecurityScheme map[*SecurityScheme]struct{}
 }
 
-// NewSwaggerLoader returns an empty SwaggerLoader
-func NewSwaggerLoader() *SwaggerLoader {
-	return &SwaggerLoader{}
+// NewLoader returns an empty Loader
+func NewLoader() *Loader {
+	return &Loader{}
 }
 
-func (swaggerLoader *SwaggerLoader) resetVisitedPathItemRefs() {
-	swaggerLoader.visitedPathItemRefs = make(map[string]struct{})
+func (loader *Loader) resetVisitedPathItemRefs() {
+	loader.visitedPathItemRefs = make(map[string]struct{})
 }
 
-// LoadSwaggerFromURI loads a spec from a remote URL
-func (swaggerLoader *SwaggerLoader) LoadSwaggerFromURI(location *url.URL) (*Swagger, error) {
-	swaggerLoader.resetVisitedPathItemRefs()
-	return swaggerLoader.loadSwaggerFromURIInternal(location)
+// LoadFromURI loads a spec from a remote URL
+func (loader *Loader) LoadFromURI(location *url.URL) (*T, error) {
+	loader.resetVisitedPathItemRefs()
+	return loader.loadFromURIInternal(location)
 }
 
-// LoadSwaggerFromFile loads a spec from a local file path
-func (swaggerLoader *SwaggerLoader) LoadSwaggerFromFile(location string) (*Swagger, error) {
-	return swaggerLoader.LoadSwaggerFromURI(&url.URL{Path: filepath.ToSlash(location)})
+// LoadFromFile loads a spec from a local file path
+func (loader *Loader) LoadFromFile(location string) (*T, error) {
+	return loader.LoadFromURI(&url.URL{Path: filepath.ToSlash(location)})
 }
 
-func (swaggerLoader *SwaggerLoader) loadSwaggerFromURIInternal(location *url.URL) (*Swagger, error) {
-	data, err := swaggerLoader.readURL(location)
+func (loader *Loader) loadFromURIInternal(location *url.URL) (*T, error) {
+	data, err := loader.readURL(location)
 	if err != nil {
 		return nil, err
 	}
-	return swaggerLoader.loadSwaggerFromDataWithPathInternal(data, location)
+	return loader.loadFromDataWithPathInternal(data, location)
 }
 
-func (swaggerLoader *SwaggerLoader) allowsExternalRefs(ref string) (err error) {
-	if !swaggerLoader.IsExternalRefsAllowed {
+func (loader *Loader) allowsExternalRefs(ref string) (err error) {
+	if !loader.IsExternalRefsAllowed {
 		err = fmt.Errorf("encountered disallowed external reference: %q", ref)
 	}
 	return
 }
 
 // loadSingleElementFromURI reads the data from ref and unmarshals to the passed element.
-func (swaggerLoader *SwaggerLoader) loadSingleElementFromURI(ref string, rootPath *url.URL, element interface{}) (*url.URL, error) {
-	if err := swaggerLoader.allowsExternalRefs(ref); err != nil {
+func (loader *Loader) loadSingleElementFromURI(ref string, rootPath *url.URL, element interface{}) (*url.URL, error) {
+	if err := loader.allowsExternalRefs(ref); err != nil {
 		return nil, err
 	}
 
@@ -103,7 +103,7 @@ func (swaggerLoader *SwaggerLoader) loadSingleElementFromURI(ref string, rootPat
 		return nil, fmt.Errorf("could not resolve path: %v", err)
 	}
 
-	data, err := swaggerLoader.readURL(resolvedPath)
+	data, err := loader.readURL(resolvedPath)
 	if err != nil {
 		return nil, err
 	}
@@ -114,9 +114,9 @@ func (swaggerLoader *SwaggerLoader) loadSingleElementFromURI(ref string, rootPat
 	return resolvedPath, nil
 }
 
-func (swaggerLoader *SwaggerLoader) readURL(location *url.URL) ([]byte, error) {
-	if f := swaggerLoader.ReadFromURIFunc; f != nil {
-		return f(swaggerLoader, location)
+func (loader *Loader) readURL(location *url.URL) ([]byte, error) {
+	if f := loader.ReadFromURIFunc; f != nil {
+		return f(loader, location)
 	}
 
 	if location.Scheme != "" && location.Host != "" {
@@ -136,103 +136,103 @@ func (swaggerLoader *SwaggerLoader) readURL(location *url.URL) ([]byte, error) {
 	return ioutil.ReadFile(location.Path)
 }
 
-// LoadSwaggerFromData loads a spec from a byte array
-func (swaggerLoader *SwaggerLoader) LoadSwaggerFromData(data []byte) (*Swagger, error) {
-	swaggerLoader.resetVisitedPathItemRefs()
-	doc := &Swagger{}
+// LoadFromData loads a spec from a byte array
+func (loader *Loader) LoadFromData(data []byte) (*T, error) {
+	loader.resetVisitedPathItemRefs()
+	doc := &T{}
 	if err := yaml.Unmarshal(data, doc); err != nil {
 		return nil, err
 	}
-	if err := swaggerLoader.ResolveRefsIn(doc, nil); err != nil {
+	if err := loader.ResolveRefsIn(doc, nil); err != nil {
 		return nil, err
 	}
 	return doc, nil
 }
 
-// LoadSwaggerFromDataWithPath takes the OpenApi spec data in bytes and a path where the resolver can find referred
-// elements and returns a *Swagger with all resolved data or an error if unable to load data or resolve refs.
-func (swaggerLoader *SwaggerLoader) LoadSwaggerFromDataWithPath(data []byte, location *url.URL) (*Swagger, error) {
-	swaggerLoader.resetVisitedPathItemRefs()
-	return swaggerLoader.loadSwaggerFromDataWithPathInternal(data, location)
+// LoadFromDataWithPath takes the OpenAPI document data in bytes and a path where the resolver can find referred
+// elements and returns a *T with all resolved data or an error if unable to load data or resolve refs.
+func (loader *Loader) LoadFromDataWithPath(data []byte, location *url.URL) (*T, error) {
+	loader.resetVisitedPathItemRefs()
+	return loader.loadFromDataWithPathInternal(data, location)
 }
 
-func (swaggerLoader *SwaggerLoader) loadSwaggerFromDataWithPathInternal(data []byte, location *url.URL) (*Swagger, error) {
-	if swaggerLoader.visitedDocuments == nil {
-		swaggerLoader.visitedDocuments = make(map[string]*Swagger)
+func (loader *Loader) loadFromDataWithPathInternal(data []byte, location *url.URL) (*T, error) {
+	if loader.visitedDocuments == nil {
+		loader.visitedDocuments = make(map[string]*T)
 	}
 	uri := location.String()
-	if doc, ok := swaggerLoader.visitedDocuments[uri]; ok {
+	if doc, ok := loader.visitedDocuments[uri]; ok {
 		return doc, nil
 	}
 
-	swagger := &Swagger{}
-	swaggerLoader.visitedDocuments[uri] = swagger
+	doc := &T{}
+	loader.visitedDocuments[uri] = doc
 
-	if err := yaml.Unmarshal(data, swagger); err != nil {
+	if err := yaml.Unmarshal(data, doc); err != nil {
 		return nil, err
 	}
-	if err := swaggerLoader.ResolveRefsIn(swagger, location); err != nil {
+	if err := loader.ResolveRefsIn(doc, location); err != nil {
 		return nil, err
 	}
 
-	return swagger, nil
+	return doc, nil
 }
 
 // ResolveRefsIn expands references if for instance spec was just unmarshalled
-func (swaggerLoader *SwaggerLoader) ResolveRefsIn(swagger *Swagger, location *url.URL) (err error) {
-	if swaggerLoader.visitedPathItemRefs == nil {
-		swaggerLoader.resetVisitedPathItemRefs()
+func (loader *Loader) ResolveRefsIn(doc *T, location *url.URL) (err error) {
+	if loader.visitedPathItemRefs == nil {
+		loader.resetVisitedPathItemRefs()
 	}
 
 	// Visit all components
-	components := swagger.Components
+	components := doc.Components
 	for _, component := range components.Headers {
-		if err = swaggerLoader.resolveHeaderRef(swagger, component, location); err != nil {
+		if err = loader.resolveHeaderRef(doc, component, location); err != nil {
 			return
 		}
 	}
 	for _, component := range components.Parameters {
-		if err = swaggerLoader.resolveParameterRef(swagger, component, location); err != nil {
+		if err = loader.resolveParameterRef(doc, component, location); err != nil {
 			return
 		}
 	}
 	for _, component := range components.RequestBodies {
-		if err = swaggerLoader.resolveRequestBodyRef(swagger, component, location); err != nil {
+		if err = loader.resolveRequestBodyRef(doc, component, location); err != nil {
 			return
 		}
 	}
 	for _, component := range components.Responses {
-		if err = swaggerLoader.resolveResponseRef(swagger, component, location); err != nil {
+		if err = loader.resolveResponseRef(doc, component, location); err != nil {
 			return
 		}
 	}
 	for _, component := range components.Schemas {
-		if err = swaggerLoader.resolveSchemaRef(swagger, component, location); err != nil {
+		if err = loader.resolveSchemaRef(doc, component, location); err != nil {
 			return
 		}
 	}
 	for _, component := range components.SecuritySchemes {
-		if err = swaggerLoader.resolveSecuritySchemeRef(swagger, component, location); err != nil {
+		if err = loader.resolveSecuritySchemeRef(doc, component, location); err != nil {
 			return
 		}
 	}
 	for _, component := range components.Examples {
-		if err = swaggerLoader.resolveExampleRef(swagger, component, location); err != nil {
+		if err = loader.resolveExampleRef(doc, component, location); err != nil {
 			return
 		}
 	}
 	for _, component := range components.Callbacks {
-		if err = swaggerLoader.resolveCallbackRef(swagger, component, location); err != nil {
+		if err = loader.resolveCallbackRef(doc, component, location); err != nil {
 			return
 		}
 	}
 
 	// Visit all operations
-	for entrypoint, pathItem := range swagger.Paths {
+	for entrypoint, pathItem := range doc.Paths {
 		if pathItem == nil {
 			continue
 		}
-		if err = swaggerLoader.resolvePathItemRef(swagger, entrypoint, pathItem, location); err != nil {
+		if err = loader.resolvePathItemRef(doc, entrypoint, pathItem, location); err != nil {
 			return
 		}
 	}
@@ -267,8 +267,8 @@ func isSingleRefElement(ref string) bool {
 	return !strings.Contains(ref, "#")
 }
 
-func (swaggerLoader *SwaggerLoader) resolveComponent(
-	swagger *Swagger,
+func (loader *Loader) resolveComponent(
+	doc *T,
 	ref string,
 	path *url.URL,
 	resolved interface{},
@@ -276,7 +276,7 @@ func (swaggerLoader *SwaggerLoader) resolveComponent(
 	componentPath *url.URL,
 	err error,
 ) {
-	if swagger, ref, componentPath, err = swaggerLoader.resolveRefSwagger(swagger, ref, path); err != nil {
+	if doc, ref, componentPath, err = loader.resolveRef(doc, ref, path); err != nil {
 		return nil, err
 	}
 
@@ -293,7 +293,7 @@ func (swaggerLoader *SwaggerLoader) resolveComponent(
 		for _, pathPart := range strings.Split(fragment[1:], "/") {
 			pathPart = unescapeRefString(pathPart)
 
-			if cursor, err = drillIntoSwaggerField(cursor, pathPart); err != nil {
+			if cursor, err = drillIntoField(cursor, pathPart); err != nil {
 				e := failedToResolveRefFragmentPart(ref, pathPart)
 				return nil, fmt.Errorf("%s: %s", e.Error(), err.Error())
 			}
@@ -304,9 +304,9 @@ func (swaggerLoader *SwaggerLoader) resolveComponent(
 		return cursor, nil
 	}
 	var cursor interface{}
-	if cursor, err = drill(swagger); err != nil {
+	if cursor, err = drill(doc); err != nil {
 		var err2 error
-		data, err2 := swaggerLoader.readURL(path)
+		data, err2 := loader.readURL(path)
 		if err2 != nil {
 			return nil, err
 		}
@@ -345,7 +345,7 @@ func (swaggerLoader *SwaggerLoader) resolveComponent(
 	}
 }
 
-func drillIntoSwaggerField(cursor interface{}, fieldName string) (interface{}, error) {
+func drillIntoField(cursor interface{}, fieldName string) (interface{}, error) {
 	switch val := reflect.Indirect(reflect.ValueOf(cursor)); val.Kind() {
 	case reflect.Map:
 		elementValue := val.MapIndex(reflect.ValueOf(fieldName))
@@ -379,7 +379,7 @@ func drillIntoSwaggerField(cursor interface{}, fieldName string) (interface{}, e
 		// if cursor is a "ref wrapper" struct (e.g. RequestBodyRef),
 		if _, ok := val.Type().FieldByName("Value"); ok {
 			// try digging into its Value field
-			return drillIntoSwaggerField(val.FieldByName("Value").Interface(), fieldName)
+			return drillIntoField(val.FieldByName("Value").Interface(), fieldName)
 		}
 		if hasFields {
 			if ff := val.Type().Field(0); ff.PkgPath == "" && ff.Name == "ExtensionProps" {
@@ -400,12 +400,12 @@ func drillIntoSwaggerField(cursor interface{}, fieldName string) (interface{}, e
 	}
 }
 
-func (swaggerLoader *SwaggerLoader) resolveRefSwagger(swagger *Swagger, ref string, path *url.URL) (*Swagger, string, *url.URL, error) {
+func (loader *Loader) resolveRef(doc *T, ref string, path *url.URL) (*T, string, *url.URL, error) {
 	if ref != "" && ref[0] == '#' {
-		return swagger, ref, path, nil
+		return doc, ref, path, nil
 	}
 
-	if err := swaggerLoader.allowsExternalRefs(ref); err != nil {
+	if err := loader.allowsExternalRefs(ref); err != nil {
 		return nil, "", nil, err
 	}
 
@@ -421,22 +421,22 @@ func (swaggerLoader *SwaggerLoader) resolveRefSwagger(swagger *Swagger, ref stri
 		return nil, "", nil, fmt.Errorf("error resolving path: %v", err)
 	}
 
-	if swagger, err = swaggerLoader.loadSwaggerFromURIInternal(resolvedPath); err != nil {
+	if doc, err = loader.loadFromURIInternal(resolvedPath); err != nil {
 		return nil, "", nil, fmt.Errorf("error resolving reference %q: %v", ref, err)
 	}
 
-	return swagger, "#" + fragment, resolvedPath, nil
+	return doc, "#" + fragment, resolvedPath, nil
 }
 
-func (swaggerLoader *SwaggerLoader) resolveHeaderRef(swagger *Swagger, component *HeaderRef, documentPath *url.URL) (err error) {
+func (loader *Loader) resolveHeaderRef(doc *T, component *HeaderRef, documentPath *url.URL) (err error) {
 	if component != nil && component.Value != nil {
-		if swaggerLoader.visitedHeader == nil {
-			swaggerLoader.visitedHeader = make(map[*Header]struct{})
+		if loader.visitedHeader == nil {
+			loader.visitedHeader = make(map[*Header]struct{})
 		}
-		if _, ok := swaggerLoader.visitedHeader[component.Value]; ok {
+		if _, ok := loader.visitedHeader[component.Value]; ok {
 			return nil
 		}
-		swaggerLoader.visitedHeader[component.Value] = struct{}{}
+		loader.visitedHeader[component.Value] = struct{}{}
 	}
 
 	if component == nil {
@@ -445,17 +445,17 @@ func (swaggerLoader *SwaggerLoader) resolveHeaderRef(swagger *Swagger, component
 	if ref := component.Ref; ref != "" {
 		if isSingleRefElement(ref) {
 			var header Header
-			if documentPath, err = swaggerLoader.loadSingleElementFromURI(ref, documentPath, &header); err != nil {
+			if documentPath, err = loader.loadSingleElementFromURI(ref, documentPath, &header); err != nil {
 				return err
 			}
 			component.Value = &header
 		} else {
 			var resolved HeaderRef
-			componentPath, err := swaggerLoader.resolveComponent(swagger, ref, documentPath, &resolved)
+			componentPath, err := loader.resolveComponent(doc, ref, documentPath, &resolved)
 			if err != nil {
 				return err
 			}
-			if err := swaggerLoader.resolveHeaderRef(swagger, &resolved, componentPath); err != nil {
+			if err := loader.resolveHeaderRef(doc, &resolved, componentPath); err != nil {
 				return err
 			}
 			component.Value = resolved.Value
@@ -467,22 +467,22 @@ func (swaggerLoader *SwaggerLoader) resolveHeaderRef(swagger *Swagger, component
 	}
 
 	if schema := value.Schema; schema != nil {
-		if err := swaggerLoader.resolveSchemaRef(swagger, schema, documentPath); err != nil {
+		if err := loader.resolveSchemaRef(doc, schema, documentPath); err != nil {
 			return err
 		}
 	}
 	return nil
 }
 
-func (swaggerLoader *SwaggerLoader) resolveParameterRef(swagger *Swagger, component *ParameterRef, documentPath *url.URL) (err error) {
+func (loader *Loader) resolveParameterRef(doc *T, component *ParameterRef, documentPath *url.URL) (err error) {
 	if component != nil && component.Value != nil {
-		if swaggerLoader.visitedParameter == nil {
-			swaggerLoader.visitedParameter = make(map[*Parameter]struct{})
+		if loader.visitedParameter == nil {
+			loader.visitedParameter = make(map[*Parameter]struct{})
 		}
-		if _, ok := swaggerLoader.visitedParameter[component.Value]; ok {
+		if _, ok := loader.visitedParameter[component.Value]; ok {
 			return nil
 		}
-		swaggerLoader.visitedParameter[component.Value] = struct{}{}
+		loader.visitedParameter[component.Value] = struct{}{}
 	}
 
 	if component == nil {
@@ -492,17 +492,17 @@ func (swaggerLoader *SwaggerLoader) resolveParameterRef(swagger *Swagger, compon
 	if ref != "" {
 		if isSingleRefElement(ref) {
 			var param Parameter
-			if documentPath, err = swaggerLoader.loadSingleElementFromURI(ref, documentPath, &param); err != nil {
+			if documentPath, err = loader.loadSingleElementFromURI(ref, documentPath, &param); err != nil {
 				return err
 			}
 			component.Value = &param
 		} else {
 			var resolved ParameterRef
-			componentPath, err := swaggerLoader.resolveComponent(swagger, ref, documentPath, &resolved)
+			componentPath, err := loader.resolveComponent(doc, ref, documentPath, &resolved)
 			if err != nil {
 				return err
 			}
-			if err := swaggerLoader.resolveParameterRef(swagger, &resolved, componentPath); err != nil {
+			if err := loader.resolveParameterRef(doc, &resolved, componentPath); err != nil {
 				return err
 			}
 			component.Value = resolved.Value
@@ -518,28 +518,28 @@ func (swaggerLoader *SwaggerLoader) resolveParameterRef(swagger *Swagger, compon
 	}
 	for _, contentType := range value.Content {
 		if schema := contentType.Schema; schema != nil {
-			if err := swaggerLoader.resolveSchemaRef(swagger, schema, documentPath); err != nil {
+			if err := loader.resolveSchemaRef(doc, schema, documentPath); err != nil {
 				return err
 			}
 		}
 	}
 	if schema := value.Schema; schema != nil {
-		if err := swaggerLoader.resolveSchemaRef(swagger, schema, documentPath); err != nil {
+		if err := loader.resolveSchemaRef(doc, schema, documentPath); err != nil {
 			return err
 		}
 	}
 	return nil
 }
 
-func (swaggerLoader *SwaggerLoader) resolveRequestBodyRef(swagger *Swagger, component *RequestBodyRef, documentPath *url.URL) (err error) {
+func (loader *Loader) resolveRequestBodyRef(doc *T, component *RequestBodyRef, documentPath *url.URL) (err error) {
 	if component != nil && component.Value != nil {
-		if swaggerLoader.visitedRequestBody == nil {
-			swaggerLoader.visitedRequestBody = make(map[*RequestBody]struct{})
+		if loader.visitedRequestBody == nil {
+			loader.visitedRequestBody = make(map[*RequestBody]struct{})
 		}
-		if _, ok := swaggerLoader.visitedRequestBody[component.Value]; ok {
+		if _, ok := loader.visitedRequestBody[component.Value]; ok {
 			return nil
 		}
-		swaggerLoader.visitedRequestBody[component.Value] = struct{}{}
+		loader.visitedRequestBody[component.Value] = struct{}{}
 	}
 
 	if component == nil {
@@ -548,17 +548,17 @@ func (swaggerLoader *SwaggerLoader) resolveRequestBodyRef(swagger *Swagger, comp
 	if ref := component.Ref; ref != "" {
 		if isSingleRefElement(ref) {
 			var requestBody RequestBody
-			if documentPath, err = swaggerLoader.loadSingleElementFromURI(ref, documentPath, &requestBody); err != nil {
+			if documentPath, err = loader.loadSingleElementFromURI(ref, documentPath, &requestBody); err != nil {
 				return err
 			}
 			component.Value = &requestBody
 		} else {
 			var resolved RequestBodyRef
-			componentPath, err := swaggerLoader.resolveComponent(swagger, ref, documentPath, &resolved)
+			componentPath, err := loader.resolveComponent(doc, ref, documentPath, &resolved)
 			if err != nil {
 				return err
 			}
-			if err = swaggerLoader.resolveRequestBodyRef(swagger, &resolved, componentPath); err != nil {
+			if err = loader.resolveRequestBodyRef(doc, &resolved, componentPath); err != nil {
 				return err
 			}
 			component.Value = resolved.Value
@@ -571,13 +571,13 @@ func (swaggerLoader *SwaggerLoader) resolveRequestBodyRef(swagger *Swagger, comp
 
 	for _, contentType := range value.Content {
 		for name, example := range contentType.Examples {
-			if err := swaggerLoader.resolveExampleRef(swagger, example, documentPath); err != nil {
+			if err := loader.resolveExampleRef(doc, example, documentPath); err != nil {
 				return err
 			}
 			contentType.Examples[name] = example
 		}
 		if schema := contentType.Schema; schema != nil {
-			if err := swaggerLoader.resolveSchemaRef(swagger, schema, documentPath); err != nil {
+			if err := loader.resolveSchemaRef(doc, schema, documentPath); err != nil {
 				return err
 			}
 		}
@@ -585,15 +585,15 @@ func (swaggerLoader *SwaggerLoader) resolveRequestBodyRef(swagger *Swagger, comp
 	return nil
 }
 
-func (swaggerLoader *SwaggerLoader) resolveResponseRef(swagger *Swagger, component *ResponseRef, documentPath *url.URL) (err error) {
+func (loader *Loader) resolveResponseRef(doc *T, component *ResponseRef, documentPath *url.URL) (err error) {
 	if component != nil && component.Value != nil {
-		if swaggerLoader.visitedResponse == nil {
-			swaggerLoader.visitedResponse = make(map[*Response]struct{})
+		if loader.visitedResponse == nil {
+			loader.visitedResponse = make(map[*Response]struct{})
 		}
-		if _, ok := swaggerLoader.visitedResponse[component.Value]; ok {
+		if _, ok := loader.visitedResponse[component.Value]; ok {
 			return nil
 		}
-		swaggerLoader.visitedResponse[component.Value] = struct{}{}
+		loader.visitedResponse[component.Value] = struct{}{}
 	}
 
 	if component == nil {
@@ -603,17 +603,17 @@ func (swaggerLoader *SwaggerLoader) resolveResponseRef(swagger *Swagger, compone
 	if ref != "" {
 		if isSingleRefElement(ref) {
 			var resp Response
-			if documentPath, err = swaggerLoader.loadSingleElementFromURI(ref, documentPath, &resp); err != nil {
+			if documentPath, err = loader.loadSingleElementFromURI(ref, documentPath, &resp); err != nil {
 				return err
 			}
 			component.Value = &resp
 		} else {
 			var resolved ResponseRef
-			componentPath, err := swaggerLoader.resolveComponent(swagger, ref, documentPath, &resolved)
+			componentPath, err := loader.resolveComponent(doc, ref, documentPath, &resolved)
 			if err != nil {
 				return err
 			}
-			if err := swaggerLoader.resolveResponseRef(swagger, &resolved, componentPath); err != nil {
+			if err := loader.resolveResponseRef(doc, &resolved, componentPath); err != nil {
 				return err
 			}
 			component.Value = resolved.Value
@@ -625,7 +625,7 @@ func (swaggerLoader *SwaggerLoader) resolveResponseRef(swagger *Swagger, compone
 	}
 
 	for _, header := range value.Headers {
-		if err := swaggerLoader.resolveHeaderRef(swagger, header, documentPath); err != nil {
+		if err := loader.resolveHeaderRef(doc, header, documentPath); err != nil {
 			return err
 		}
 	}
@@ -634,35 +634,35 @@ func (swaggerLoader *SwaggerLoader) resolveResponseRef(swagger *Swagger, compone
 			continue
 		}
 		for name, example := range contentType.Examples {
-			if err := swaggerLoader.resolveExampleRef(swagger, example, documentPath); err != nil {
+			if err := loader.resolveExampleRef(doc, example, documentPath); err != nil {
 				return err
 			}
 			contentType.Examples[name] = example
 		}
 		if schema := contentType.Schema; schema != nil {
-			if err := swaggerLoader.resolveSchemaRef(swagger, schema, documentPath); err != nil {
+			if err := loader.resolveSchemaRef(doc, schema, documentPath); err != nil {
 				return err
 			}
 			contentType.Schema = schema
 		}
 	}
 	for _, link := range value.Links {
-		if err := swaggerLoader.resolveLinkRef(swagger, link, documentPath); err != nil {
+		if err := loader.resolveLinkRef(doc, link, documentPath); err != nil {
 			return err
 		}
 	}
 	return nil
 }
 
-func (swaggerLoader *SwaggerLoader) resolveSchemaRef(swagger *Swagger, component *SchemaRef, documentPath *url.URL) (err error) {
+func (loader *Loader) resolveSchemaRef(doc *T, component *SchemaRef, documentPath *url.URL) (err error) {
 	if component != nil && component.Value != nil {
-		if swaggerLoader.visitedSchema == nil {
-			swaggerLoader.visitedSchema = make(map[*Schema]struct{})
+		if loader.visitedSchema == nil {
+			loader.visitedSchema = make(map[*Schema]struct{})
 		}
-		if _, ok := swaggerLoader.visitedSchema[component.Value]; ok {
+		if _, ok := loader.visitedSchema[component.Value]; ok {
 			return nil
 		}
-		swaggerLoader.visitedSchema[component.Value] = struct{}{}
+		loader.visitedSchema[component.Value] = struct{}{}
 	}
 
 	if component == nil {
@@ -672,17 +672,17 @@ func (swaggerLoader *SwaggerLoader) resolveSchemaRef(swagger *Swagger, component
 	if ref != "" {
 		if isSingleRefElement(ref) {
 			var schema Schema
-			if documentPath, err = swaggerLoader.loadSingleElementFromURI(ref, documentPath, &schema); err != nil {
+			if documentPath, err = loader.loadSingleElementFromURI(ref, documentPath, &schema); err != nil {
 				return err
 			}
 			component.Value = &schema
 		} else {
 			var resolved SchemaRef
-			componentPath, err := swaggerLoader.resolveComponent(swagger, ref, documentPath, &resolved)
+			componentPath, err := loader.resolveComponent(doc, ref, documentPath, &resolved)
 			if err != nil {
 				return err
 			}
-			if err := swaggerLoader.resolveSchemaRef(swagger, &resolved, componentPath); err != nil {
+			if err := loader.resolveSchemaRef(doc, &resolved, componentPath); err != nil {
 				return err
 			}
 			component.Value = resolved.Value
@@ -695,52 +695,52 @@ func (swaggerLoader *SwaggerLoader) resolveSchemaRef(swagger *Swagger, component
 
 	// ResolveRefs referred schemas
 	if v := value.Items; v != nil {
-		if err := swaggerLoader.resolveSchemaRef(swagger, v, documentPath); err != nil {
+		if err := loader.resolveSchemaRef(doc, v, documentPath); err != nil {
 			return err
 		}
 	}
 	for _, v := range value.Properties {
-		if err := swaggerLoader.resolveSchemaRef(swagger, v, documentPath); err != nil {
+		if err := loader.resolveSchemaRef(doc, v, documentPath); err != nil {
 			return err
 		}
 	}
 	if v := value.AdditionalProperties; v != nil {
-		if err := swaggerLoader.resolveSchemaRef(swagger, v, documentPath); err != nil {
+		if err := loader.resolveSchemaRef(doc, v, documentPath); err != nil {
 			return err
 		}
 	}
 	if v := value.Not; v != nil {
-		if err := swaggerLoader.resolveSchemaRef(swagger, v, documentPath); err != nil {
+		if err := loader.resolveSchemaRef(doc, v, documentPath); err != nil {
 			return err
 		}
 	}
 	for _, v := range value.AllOf {
-		if err := swaggerLoader.resolveSchemaRef(swagger, v, documentPath); err != nil {
+		if err := loader.resolveSchemaRef(doc, v, documentPath); err != nil {
 			return err
 		}
 	}
 	for _, v := range value.AnyOf {
-		if err := swaggerLoader.resolveSchemaRef(swagger, v, documentPath); err != nil {
+		if err := loader.resolveSchemaRef(doc, v, documentPath); err != nil {
 			return err
 		}
 	}
 	for _, v := range value.OneOf {
-		if err := swaggerLoader.resolveSchemaRef(swagger, v, documentPath); err != nil {
+		if err := loader.resolveSchemaRef(doc, v, documentPath); err != nil {
 			return err
 		}
 	}
 	return nil
 }
 
-func (swaggerLoader *SwaggerLoader) resolveSecuritySchemeRef(swagger *Swagger, component *SecuritySchemeRef, documentPath *url.URL) (err error) {
+func (loader *Loader) resolveSecuritySchemeRef(doc *T, component *SecuritySchemeRef, documentPath *url.URL) (err error) {
 	if component != nil && component.Value != nil {
-		if swaggerLoader.visitedSecurityScheme == nil {
-			swaggerLoader.visitedSecurityScheme = make(map[*SecurityScheme]struct{})
+		if loader.visitedSecurityScheme == nil {
+			loader.visitedSecurityScheme = make(map[*SecurityScheme]struct{})
 		}
-		if _, ok := swaggerLoader.visitedSecurityScheme[component.Value]; ok {
+		if _, ok := loader.visitedSecurityScheme[component.Value]; ok {
 			return nil
 		}
-		swaggerLoader.visitedSecurityScheme[component.Value] = struct{}{}
+		loader.visitedSecurityScheme[component.Value] = struct{}{}
 	}
 
 	if component == nil {
@@ -749,17 +749,17 @@ func (swaggerLoader *SwaggerLoader) resolveSecuritySchemeRef(swagger *Swagger, c
 	if ref := component.Ref; ref != "" {
 		if isSingleRefElement(ref) {
 			var scheme SecurityScheme
-			if documentPath, err = swaggerLoader.loadSingleElementFromURI(ref, documentPath, &scheme); err != nil {
+			if documentPath, err = loader.loadSingleElementFromURI(ref, documentPath, &scheme); err != nil {
 				return err
 			}
 			component.Value = &scheme
 		} else {
 			var resolved SecuritySchemeRef
-			componentPath, err := swaggerLoader.resolveComponent(swagger, ref, documentPath, &resolved)
+			componentPath, err := loader.resolveComponent(doc, ref, documentPath, &resolved)
 			if err != nil {
 				return err
 			}
-			if err := swaggerLoader.resolveSecuritySchemeRef(swagger, &resolved, componentPath); err != nil {
+			if err := loader.resolveSecuritySchemeRef(doc, &resolved, componentPath); err != nil {
 				return err
 			}
 			component.Value = resolved.Value
@@ -768,15 +768,15 @@ func (swaggerLoader *SwaggerLoader) resolveSecuritySchemeRef(swagger *Swagger, c
 	return nil
 }
 
-func (swaggerLoader *SwaggerLoader) resolveExampleRef(swagger *Swagger, component *ExampleRef, documentPath *url.URL) (err error) {
+func (loader *Loader) resolveExampleRef(doc *T, component *ExampleRef, documentPath *url.URL) (err error) {
 	if component != nil && component.Value != nil {
-		if swaggerLoader.visitedExample == nil {
-			swaggerLoader.visitedExample = make(map[*Example]struct{})
+		if loader.visitedExample == nil {
+			loader.visitedExample = make(map[*Example]struct{})
 		}
-		if _, ok := swaggerLoader.visitedExample[component.Value]; ok {
+		if _, ok := loader.visitedExample[component.Value]; ok {
 			return nil
 		}
-		swaggerLoader.visitedExample[component.Value] = struct{}{}
+		loader.visitedExample[component.Value] = struct{}{}
 	}
 
 	if component == nil {
@@ -785,17 +785,17 @@ func (swaggerLoader *SwaggerLoader) resolveExampleRef(swagger *Swagger, componen
 	if ref := component.Ref; ref != "" {
 		if isSingleRefElement(ref) {
 			var example Example
-			if documentPath, err = swaggerLoader.loadSingleElementFromURI(ref, documentPath, &example); err != nil {
+			if documentPath, err = loader.loadSingleElementFromURI(ref, documentPath, &example); err != nil {
 				return err
 			}
 			component.Value = &example
 		} else {
 			var resolved ExampleRef
-			componentPath, err := swaggerLoader.resolveComponent(swagger, ref, documentPath, &resolved)
+			componentPath, err := loader.resolveComponent(doc, ref, documentPath, &resolved)
 			if err != nil {
 				return err
 			}
-			if err := swaggerLoader.resolveExampleRef(swagger, &resolved, componentPath); err != nil {
+			if err := loader.resolveExampleRef(doc, &resolved, componentPath); err != nil {
 				return err
 			}
 			component.Value = resolved.Value
@@ -804,7 +804,7 @@ func (swaggerLoader *SwaggerLoader) resolveExampleRef(swagger *Swagger, componen
 	return nil
 }
 
-func (swaggerLoader *SwaggerLoader) resolveCallbackRef(swagger *Swagger, component *CallbackRef, documentPath *url.URL) (err error) {
+func (loader *Loader) resolveCallbackRef(doc *T, component *CallbackRef, documentPath *url.URL) (err error) {
 
 	if component == nil {
 		return errors.New("invalid callback: value MUST be an object")
@@ -812,17 +812,17 @@ func (swaggerLoader *SwaggerLoader) resolveCallbackRef(swagger *Swagger, compone
 	if ref := component.Ref; ref != "" {
 		if isSingleRefElement(ref) {
 			var resolved Callback
-			if documentPath, err = swaggerLoader.loadSingleElementFromURI(ref, documentPath, &resolved); err != nil {
+			if documentPath, err = loader.loadSingleElementFromURI(ref, documentPath, &resolved); err != nil {
 				return err
 			}
 			component.Value = &resolved
 		} else {
 			var resolved CallbackRef
-			componentPath, err := swaggerLoader.resolveComponent(swagger, ref, documentPath, &resolved)
+			componentPath, err := loader.resolveComponent(doc, ref, documentPath, &resolved)
 			if err != nil {
 				return err
 			}
-			if err := swaggerLoader.resolveCallbackRef(swagger, &resolved, componentPath); err != nil {
+			if err := loader.resolveCallbackRef(doc, &resolved, componentPath); err != nil {
 				return err
 			}
 			component.Value = resolved.Value
@@ -841,10 +841,10 @@ func (swaggerLoader *SwaggerLoader) resolveCallbackRef(swagger *Swagger, compone
 				key = documentPath.EscapedPath()
 			}
 			key += entrypoint
-			if _, ok := swaggerLoader.visitedPathItemRefs[key]; ok {
+			if _, ok := loader.visitedPathItemRefs[key]; ok {
 				return nil
 			}
-			swaggerLoader.visitedPathItemRefs[key] = struct{}{}
+			loader.visitedPathItemRefs[key] = struct{}{}
 
 			if pathItem == nil {
 				return errors.New("invalid path item: value MUST be an object")
@@ -853,12 +853,12 @@ func (swaggerLoader *SwaggerLoader) resolveCallbackRef(swagger *Swagger, compone
 			if ref != "" {
 				if isSingleRefElement(ref) {
 					var p PathItem
-					if documentPath, err = swaggerLoader.loadSingleElementFromURI(ref, documentPath, &p); err != nil {
+					if documentPath, err = loader.loadSingleElementFromURI(ref, documentPath, &p); err != nil {
 						return err
 					}
 					*pathItem = p
 				} else {
-					if swagger, ref, documentPath, err = swaggerLoader.resolveRefSwagger(swagger, ref, documentPath); err != nil {
+					if doc, ref, documentPath, err = loader.resolveRef(doc, ref, documentPath); err != nil {
 						return
 					}
 
@@ -868,7 +868,7 @@ func (swaggerLoader *SwaggerLoader) resolveCallbackRef(swagger *Swagger, compone
 					}
 					id := unescapeRefString(rest)
 
-					definitions := swagger.Components.Callbacks
+					definitions := doc.Components.Callbacks
 					if definitions == nil {
 						return failedToResolveRefFragmentPart(ref, "callbacks")
 					}
@@ -883,7 +883,7 @@ func (swaggerLoader *SwaggerLoader) resolveCallbackRef(swagger *Swagger, compone
 					}
 				}
 			}
-			return swaggerLoader.resolvePathItemRefContinued(swagger, pathItem, documentPath)
+			return loader.resolvePathItemRefContinued(doc, pathItem, documentPath)
 		}()
 		if err != nil {
 			return err
@@ -892,15 +892,15 @@ func (swaggerLoader *SwaggerLoader) resolveCallbackRef(swagger *Swagger, compone
 	return nil
 }
 
-func (swaggerLoader *SwaggerLoader) resolveLinkRef(swagger *Swagger, component *LinkRef, documentPath *url.URL) (err error) {
+func (loader *Loader) resolveLinkRef(doc *T, component *LinkRef, documentPath *url.URL) (err error) {
 	if component != nil && component.Value != nil {
-		if swaggerLoader.visitedLink == nil {
-			swaggerLoader.visitedLink = make(map[*Link]struct{})
+		if loader.visitedLink == nil {
+			loader.visitedLink = make(map[*Link]struct{})
 		}
-		if _, ok := swaggerLoader.visitedLink[component.Value]; ok {
+		if _, ok := loader.visitedLink[component.Value]; ok {
 			return nil
 		}
-		swaggerLoader.visitedLink[component.Value] = struct{}{}
+		loader.visitedLink[component.Value] = struct{}{}
 	}
 
 	if component == nil {
@@ -909,17 +909,17 @@ func (swaggerLoader *SwaggerLoader) resolveLinkRef(swagger *Swagger, component *
 	if ref := component.Ref; ref != "" {
 		if isSingleRefElement(ref) {
 			var link Link
-			if documentPath, err = swaggerLoader.loadSingleElementFromURI(ref, documentPath, &link); err != nil {
+			if documentPath, err = loader.loadSingleElementFromURI(ref, documentPath, &link); err != nil {
 				return err
 			}
 			component.Value = &link
 		} else {
 			var resolved LinkRef
-			componentPath, err := swaggerLoader.resolveComponent(swagger, ref, documentPath, &resolved)
+			componentPath, err := loader.resolveComponent(doc, ref, documentPath, &resolved)
 			if err != nil {
 				return err
 			}
-			if err := swaggerLoader.resolveLinkRef(swagger, &resolved, componentPath); err != nil {
+			if err := loader.resolveLinkRef(doc, &resolved, componentPath); err != nil {
 				return err
 			}
 			component.Value = resolved.Value
@@ -928,16 +928,16 @@ func (swaggerLoader *SwaggerLoader) resolveLinkRef(swagger *Swagger, component *
 	return nil
 }
 
-func (swaggerLoader *SwaggerLoader) resolvePathItemRef(swagger *Swagger, entrypoint string, pathItem *PathItem, documentPath *url.URL) (err error) {
+func (loader *Loader) resolvePathItemRef(doc *T, entrypoint string, pathItem *PathItem, documentPath *url.URL) (err error) {
 	key := "_"
 	if documentPath != nil {
 		key = documentPath.EscapedPath()
 	}
 	key += entrypoint
-	if _, ok := swaggerLoader.visitedPathItemRefs[key]; ok {
+	if _, ok := loader.visitedPathItemRefs[key]; ok {
 		return nil
 	}
-	swaggerLoader.visitedPathItemRefs[key] = struct{}{}
+	loader.visitedPathItemRefs[key] = struct{}{}
 
 	if pathItem == nil {
 		return errors.New("invalid path item: value MUST be an object")
@@ -946,12 +946,12 @@ func (swaggerLoader *SwaggerLoader) resolvePathItemRef(swagger *Swagger, entrypo
 	if ref != "" {
 		if isSingleRefElement(ref) {
 			var p PathItem
-			if documentPath, err = swaggerLoader.loadSingleElementFromURI(ref, documentPath, &p); err != nil {
+			if documentPath, err = loader.loadSingleElementFromURI(ref, documentPath, &p); err != nil {
 				return err
 			}
 			*pathItem = p
 		} else {
-			if swagger, ref, documentPath, err = swaggerLoader.resolveRefSwagger(swagger, ref, documentPath); err != nil {
+			if doc, ref, documentPath, err = loader.resolveRef(doc, ref, documentPath); err != nil {
 				return
 			}
 
@@ -961,7 +961,7 @@ func (swaggerLoader *SwaggerLoader) resolvePathItemRef(swagger *Swagger, entrypo
 			}
 			id := unescapeRefString(rest)
 
-			definitions := swagger.Paths
+			definitions := doc.Paths
 			if definitions == nil {
 				return failedToResolveRefFragmentPart(ref, "paths")
 			}
@@ -973,33 +973,33 @@ func (swaggerLoader *SwaggerLoader) resolvePathItemRef(swagger *Swagger, entrypo
 			*pathItem = *resolved
 		}
 	}
-	return swaggerLoader.resolvePathItemRefContinued(swagger, pathItem, documentPath)
+	return loader.resolvePathItemRefContinued(doc, pathItem, documentPath)
 }
 
-func (swaggerLoader *SwaggerLoader) resolvePathItemRefContinued(swagger *Swagger, pathItem *PathItem, documentPath *url.URL) (err error) {
+func (loader *Loader) resolvePathItemRefContinued(doc *T, pathItem *PathItem, documentPath *url.URL) (err error) {
 	for _, parameter := range pathItem.Parameters {
-		if err = swaggerLoader.resolveParameterRef(swagger, parameter, documentPath); err != nil {
+		if err = loader.resolveParameterRef(doc, parameter, documentPath); err != nil {
 			return
 		}
 	}
 	for _, operation := range pathItem.Operations() {
 		for _, parameter := range operation.Parameters {
-			if err = swaggerLoader.resolveParameterRef(swagger, parameter, documentPath); err != nil {
+			if err = loader.resolveParameterRef(doc, parameter, documentPath); err != nil {
 				return
 			}
 		}
 		if requestBody := operation.RequestBody; requestBody != nil {
-			if err = swaggerLoader.resolveRequestBodyRef(swagger, requestBody, documentPath); err != nil {
+			if err = loader.resolveRequestBodyRef(doc, requestBody, documentPath); err != nil {
 				return
 			}
 		}
 		for _, response := range operation.Responses {
-			if err = swaggerLoader.resolveResponseRef(swagger, response, documentPath); err != nil {
+			if err = loader.resolveResponseRef(doc, response, documentPath); err != nil {
 				return
 			}
 		}
 		for _, callback := range operation.Callbacks {
-			if err = swaggerLoader.resolveCallbackRef(swagger, callback, documentPath); err != nil {
+			if err = loader.resolveCallbackRef(doc, callback, documentPath); err != nil {
 				return
 			}
 		}
diff --git a/openapi3/media_type.go b/openapi3/media_type.go
index 6d2f2cb..2dd0842 100644
--- a/openapi3/media_type.go
+++ b/openapi3/media_type.go
@@ -67,12 +67,12 @@ func (mediaType *MediaType) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalStrictStruct(data, mediaType)
 }
 
-func (mediaType *MediaType) Validate(c context.Context) error {
-	if mediaType == nil {
+func (value *MediaType) Validate(ctx context.Context) error {
+	if value == nil {
 		return nil
 	}
-	if schema := mediaType.Schema; schema != nil {
-		if err := schema.Validate(c); err != nil {
+	if schema := value.Schema; schema != nil {
+		if err := schema.Validate(ctx); err != nil {
 			return err
 		}
 	}
diff --git a/openapi3/swagger.go b/openapi3/openapi3.go
similarity index 66%
rename from openapi3/swagger.go
rename to openapi3/openapi3.go
index 64f76c2..ee68877 100644
--- a/openapi3/swagger.go
+++ b/openapi3/openapi3.go
@@ -8,7 +8,8 @@ import (
 	"github.com/getkin/kin-openapi/jsoninfo"
 )
 
-type Swagger struct {
+// T is the root of an OpenAPI v3 document
+type T struct {
 	ExtensionProps
 	OpenAPI      string               `json:"openapi" yaml:"openapi"` // Required
 	Components   Components           `json:"components,omitempty" yaml:"components,omitempty"`
@@ -20,19 +21,19 @@ type Swagger struct {
 	ExternalDocs *ExternalDocs        `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
 }
 
-func (swagger *Swagger) MarshalJSON() ([]byte, error) {
-	return jsoninfo.MarshalStrictStruct(swagger)
+func (doc *T) MarshalJSON() ([]byte, error) {
+	return jsoninfo.MarshalStrictStruct(doc)
 }
 
-func (swagger *Swagger) UnmarshalJSON(data []byte) error {
-	return jsoninfo.UnmarshalStrictStruct(data, swagger)
+func (doc *T) UnmarshalJSON(data []byte) error {
+	return jsoninfo.UnmarshalStrictStruct(data, doc)
 }
 
-func (swagger *Swagger) AddOperation(path string, method string, operation *Operation) {
-	paths := swagger.Paths
+func (doc *T) AddOperation(path string, method string, operation *Operation) {
+	paths := doc.Paths
 	if paths == nil {
 		paths = make(Paths)
-		swagger.Paths = paths
+		doc.Paths = paths
 	}
 	pathItem := paths[path]
 	if pathItem == nil {
@@ -42,12 +43,12 @@ func (swagger *Swagger) AddOperation(path string, method string, operation *Oper
 	pathItem.SetOperation(method, operation)
 }
 
-func (swagger *Swagger) AddServer(server *Server) {
-	swagger.Servers = append(swagger.Servers, server)
+func (doc *T) AddServer(server *Server) {
+	doc.Servers = append(doc.Servers, server)
 }
 
-func (swagger *Swagger) Validate(c context.Context) error {
-	if swagger.OpenAPI == "" {
+func (value *T) Validate(ctx context.Context) error {
+	if value.OpenAPI == "" {
 		return errors.New("value of openapi must be a non-empty string")
 	}
 
@@ -55,15 +56,15 @@ func (swagger *Swagger) Validate(c context.Context) error {
 
 	{
 		wrap := func(e error) error { return fmt.Errorf("invalid components: %v", e) }
-		if err := swagger.Components.Validate(c); err != nil {
+		if err := value.Components.Validate(ctx); err != nil {
 			return wrap(err)
 		}
 	}
 
 	{
 		wrap := func(e error) error { return fmt.Errorf("invalid info: %v", e) }
-		if v := swagger.Info; v != nil {
-			if err := v.Validate(c); err != nil {
+		if v := value.Info; v != nil {
+			if err := v.Validate(ctx); err != nil {
 				return wrap(err)
 			}
 		} else {
@@ -73,8 +74,8 @@ func (swagger *Swagger) Validate(c context.Context) error {
 
 	{
 		wrap := func(e error) error { return fmt.Errorf("invalid paths: %v", e) }
-		if v := swagger.Paths; v != nil {
-			if err := v.Validate(c); err != nil {
+		if v := value.Paths; v != nil {
+			if err := v.Validate(ctx); err != nil {
 				return wrap(err)
 			}
 		} else {
@@ -84,8 +85,8 @@ func (swagger *Swagger) Validate(c context.Context) error {
 
 	{
 		wrap := func(e error) error { return fmt.Errorf("invalid security: %v", e) }
-		if v := swagger.Security; v != nil {
-			if err := v.Validate(c); err != nil {
+		if v := value.Security; v != nil {
+			if err := v.Validate(ctx); err != nil {
 				return wrap(err)
 			}
 		}
@@ -93,8 +94,8 @@ func (swagger *Swagger) Validate(c context.Context) error {
 
 	{
 		wrap := func(e error) error { return fmt.Errorf("invalid servers: %v", e) }
-		if v := swagger.Servers; v != nil {
-			if err := v.Validate(c); err != nil {
+		if v := value.Servers; v != nil {
+			if err := v.Validate(ctx); err != nil {
 				return wrap(err)
 			}
 		}
diff --git a/openapi3/operation.go b/openapi3/operation.go
index f7ff93f..0de7c42 100644
--- a/openapi3/operation.go
+++ b/openapi3/operation.go
@@ -120,19 +120,19 @@ func (operation *Operation) AddResponse(status int, response *Response) {
 	}
 }
 
-func (operation *Operation) Validate(c context.Context) error {
-	if v := operation.Parameters; v != nil {
-		if err := v.Validate(c); err != nil {
+func (value *Operation) Validate(ctx context.Context) error {
+	if v := value.Parameters; v != nil {
+		if err := v.Validate(ctx); err != nil {
 			return err
 		}
 	}
-	if v := operation.RequestBody; v != nil {
-		if err := v.Validate(c); err != nil {
+	if v := value.RequestBody; v != nil {
+		if err := v.Validate(ctx); err != nil {
 			return err
 		}
 	}
-	if v := operation.Responses; v != nil {
-		if err := v.Validate(c); err != nil {
+	if v := value.Responses; v != nil {
+		if err := v.Validate(ctx); err != nil {
 			return err
 		}
 	} else {
diff --git a/openapi3/parameter.go b/openapi3/parameter.go
index 76e5f7f..f4b91ad 100644
--- a/openapi3/parameter.go
+++ b/openapi3/parameter.go
@@ -64,9 +64,9 @@ func (parameters Parameters) GetByInAndName(in string, name string) *Parameter {
 	return nil
 }
 
-func (parameters Parameters) Validate(c context.Context) error {
+func (value Parameters) Validate(ctx context.Context) error {
 	dupes := make(map[string]struct{})
-	for _, item := range parameters {
+	for _, item := range value {
 		if v := item.Value; v != nil {
 			key := v.In + ":" + v.Name
 			if _, ok := dupes[key]; ok {
@@ -75,7 +75,7 @@ func (parameters Parameters) Validate(c context.Context) error {
 			dupes[key] = struct{}{}
 		}
 
-		if err := item.Validate(c); err != nil {
+		if err := item.Validate(ctx); err != nil {
 			return err
 		}
 	}
@@ -236,11 +236,11 @@ func (parameter *Parameter) SerializationMethod() (*SerializationMethod, error)
 	}
 }
 
-func (parameter *Parameter) Validate(c context.Context) error {
-	if parameter.Name == "" {
+func (value *Parameter) Validate(ctx context.Context) error {
+	if value.Name == "" {
 		return errors.New("parameter name can't be blank")
 	}
-	in := parameter.In
+	in := value.In
 	switch in {
 	case
 		ParameterInPath,
@@ -248,55 +248,55 @@ func (parameter *Parameter) Validate(c context.Context) error {
 		ParameterInHeader,
 		ParameterInCookie:
 	default:
-		return fmt.Errorf("parameter can't have 'in' value %q", parameter.In)
+		return fmt.Errorf("parameter can't have 'in' value %q", value.In)
 	}
 
 	// Validate a parameter's serialization method.
-	sm, err := parameter.SerializationMethod()
+	sm, err := value.SerializationMethod()
 	if err != nil {
 		return err
 	}
 	var smSupported bool
 	switch {
-	case parameter.In == ParameterInPath && sm.Style == SerializationSimple && !sm.Explode,
-		parameter.In == ParameterInPath && sm.Style == SerializationSimple && sm.Explode,
-		parameter.In == ParameterInPath && sm.Style == SerializationLabel && !sm.Explode,
-		parameter.In == ParameterInPath && sm.Style == SerializationLabel && sm.Explode,
-		parameter.In == ParameterInPath && sm.Style == SerializationMatrix && !sm.Explode,
-		parameter.In == ParameterInPath && sm.Style == SerializationMatrix && sm.Explode,
-
-		parameter.In == ParameterInQuery && sm.Style == SerializationForm && sm.Explode,
-		parameter.In == ParameterInQuery && sm.Style == SerializationForm && !sm.Explode,
-		parameter.In == ParameterInQuery && sm.Style == SerializationSpaceDelimited && sm.Explode,
-		parameter.In == ParameterInQuery && sm.Style == SerializationSpaceDelimited && !sm.Explode,
-		parameter.In == ParameterInQuery && sm.Style == SerializationPipeDelimited && sm.Explode,
-		parameter.In == ParameterInQuery && sm.Style == SerializationPipeDelimited && !sm.Explode,
-		parameter.In == ParameterInQuery && sm.Style == SerializationDeepObject && sm.Explode,
-
-		parameter.In == ParameterInHeader && sm.Style == SerializationSimple && !sm.Explode,
-		parameter.In == ParameterInHeader && sm.Style == SerializationSimple && sm.Explode,
-
-		parameter.In == ParameterInCookie && sm.Style == SerializationForm && !sm.Explode,
-		parameter.In == ParameterInCookie && sm.Style == SerializationForm && sm.Explode:
+	case value.In == ParameterInPath && sm.Style == SerializationSimple && !sm.Explode,
+		value.In == ParameterInPath && sm.Style == SerializationSimple && sm.Explode,
+		value.In == ParameterInPath && sm.Style == SerializationLabel && !sm.Explode,
+		value.In == ParameterInPath && sm.Style == SerializationLabel && sm.Explode,
+		value.In == ParameterInPath && sm.Style == SerializationMatrix && !sm.Explode,
+		value.In == ParameterInPath && sm.Style == SerializationMatrix && sm.Explode,
+
+		value.In == ParameterInQuery && sm.Style == SerializationForm && sm.Explode,
+		value.In == ParameterInQuery && sm.Style == SerializationForm && !sm.Explode,
+		value.In == ParameterInQuery && sm.Style == SerializationSpaceDelimited && sm.Explode,
+		value.In == ParameterInQuery && sm.Style == SerializationSpaceDelimited && !sm.Explode,
+		value.In == ParameterInQuery && sm.Style == SerializationPipeDelimited && sm.Explode,
+		value.In == ParameterInQuery && sm.Style == SerializationPipeDelimited && !sm.Explode,
+		value.In == ParameterInQuery && sm.Style == SerializationDeepObject && sm.Explode,
+
+		value.In == ParameterInHeader && sm.Style == SerializationSimple && !sm.Explode,
+		value.In == ParameterInHeader && sm.Style == SerializationSimple && sm.Explode,
+
+		value.In == ParameterInCookie && sm.Style == SerializationForm && !sm.Explode,
+		value.In == ParameterInCookie && sm.Style == SerializationForm && sm.Explode:
 		smSupported = true
 	}
 	if !smSupported {
 		e := fmt.Errorf("serialization method with style=%q and explode=%v is not supported by a %s parameter", sm.Style, sm.Explode, in)
-		return fmt.Errorf("parameter %q schema is invalid: %v", parameter.Name, e)
+		return fmt.Errorf("parameter %q schema is invalid: %v", value.Name, e)
 	}
 
-	if (parameter.Schema == nil) == (parameter.Content == nil) {
+	if (value.Schema == nil) == (value.Content == nil) {
 		e := errors.New("parameter must contain exactly one of content and schema")
-		return fmt.Errorf("parameter %q schema is invalid: %v", parameter.Name, e)
+		return fmt.Errorf("parameter %q schema is invalid: %v", value.Name, e)
 	}
-	if schema := parameter.Schema; schema != nil {
-		if err := schema.Validate(c); err != nil {
-			return fmt.Errorf("parameter %q schema is invalid: %v", parameter.Name, err)
+	if schema := value.Schema; schema != nil {
+		if err := schema.Validate(ctx); err != nil {
+			return fmt.Errorf("parameter %q schema is invalid: %v", value.Name, err)
 		}
 	}
-	if content := parameter.Content; content != nil {
-		if err := content.Validate(c); err != nil {
-			return fmt.Errorf("parameter %q content is invalid: %v", parameter.Name, err)
+	if content := value.Content; content != nil {
+		if err := content.Validate(ctx); err != nil {
+			return fmt.Errorf("parameter %q content is invalid: %v", value.Name, err)
 		}
 	}
 	return nil
diff --git a/openapi3/path_item.go b/openapi3/path_item.go
index f7cf1d9..a665020 100644
--- a/openapi3/path_item.go
+++ b/openapi3/path_item.go
@@ -116,9 +116,9 @@ func (pathItem *PathItem) SetOperation(method string, operation *Operation) {
 	}
 }
 
-func (pathItem *PathItem) Validate(c context.Context) error {
-	for _, operation := range pathItem.Operations() {
-		if err := operation.Validate(c); err != nil {
+func (value *PathItem) Validate(ctx context.Context) error {
+	for _, operation := range value.Operations() {
+		if err := operation.Validate(ctx); err != nil {
 			return err
 		}
 	}
diff --git a/openapi3/paths.go b/openapi3/paths.go
index baafaaa..c6ddbf3 100644
--- a/openapi3/paths.go
+++ b/openapi3/paths.go
@@ -9,16 +9,16 @@ import (
 // Paths is specified by OpenAPI/Swagger standard version 3.0.
 type Paths map[string]*PathItem
 
-func (paths Paths) Validate(c context.Context) error {
+func (value Paths) Validate(ctx context.Context) error {
 	normalizedPaths := make(map[string]string)
-	for path, pathItem := range paths {
+	for path, pathItem := range value {
 		if path == "" || path[0] != '/' {
 			return fmt.Errorf("path %q does not start with a forward slash (/)", path)
 		}
 
 		if pathItem == nil {
-			paths[path] = &PathItem{}
-			pathItem = paths[path]
+			value[path] = &PathItem{}
+			pathItem = value[path]
 		}
 
 		normalizedPath, pathParamsCount := normalizeTemplatedPath(path)
@@ -49,7 +49,7 @@ func (paths Paths) Validate(c context.Context) error {
 			}
 		}
 
-		if err := pathItem.Validate(c); err != nil {
+		if err := pathItem.Validate(ctx); err != nil {
 			return err
 		}
 	}
diff --git a/openapi3/refs.go b/openapi3/refs.go
index a086e36..4b64035 100644
--- a/openapi3/refs.go
+++ b/openapi3/refs.go
@@ -27,12 +27,11 @@ func (value *CallbackRef) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalRef(data, &value.Ref, &value.Value)
 }
 
-func (value *CallbackRef) Validate(c context.Context) error {
-	v := value.Value
-	if v == nil {
-		return foundUnresolvedRef(value.Ref)
+func (value *CallbackRef) Validate(ctx context.Context) error {
+	if v := value.Value; v != nil {
+		return v.Validate(ctx)
 	}
-	return v.Validate(c)
+	return foundUnresolvedRef(value.Ref)
 }
 
 func (value CallbackRef) JSONLookup(token string) (interface{}, error) {
@@ -59,8 +58,11 @@ func (value *ExampleRef) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalRef(data, &value.Ref, &value.Value)
 }
 
-func (value *ExampleRef) Validate(c context.Context) error {
-	return nil
+func (value *ExampleRef) Validate(ctx context.Context) error {
+	if v := value.Value; v != nil {
+		return v.Validate(ctx)
+	}
+	return foundUnresolvedRef(value.Ref)
 }
 
 func (value ExampleRef) JSONLookup(token string) (interface{}, error) {
@@ -87,13 +89,13 @@ func (value *HeaderRef) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalRef(data, &value.Ref, &value.Value)
 }
 
-func (value *HeaderRef) Validate(c context.Context) error {
-	v := value.Value
-	if v == nil {
-		return foundUnresolvedRef(value.Ref)
+func (value *HeaderRef) Validate(ctx context.Context) error {
+	if v := value.Value; v != nil {
+		return v.Validate(ctx)
 	}
-	return v.Validate(c)
+	return foundUnresolvedRef(value.Ref)
 }
+
 func (value HeaderRef) JSONLookup(token string) (interface{}, error) {
 	if token == "$ref" {
 		return value.Ref, nil
@@ -116,12 +118,11 @@ func (value *LinkRef) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalRef(data, &value.Ref, &value.Value)
 }
 
-func (value *LinkRef) Validate(c context.Context) error {
-	v := value.Value
-	if v == nil {
-		return foundUnresolvedRef(value.Ref)
+func (value *LinkRef) Validate(ctx context.Context) error {
+	if v := value.Value; v != nil {
+		return v.Validate(ctx)
 	}
-	return v.Validate(c)
+	return foundUnresolvedRef(value.Ref)
 }
 
 type ParameterRef struct {
@@ -139,12 +140,11 @@ func (value *ParameterRef) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalRef(data, &value.Ref, &value.Value)
 }
 
-func (value *ParameterRef) Validate(c context.Context) error {
-	v := value.Value
-	if v == nil {
-		return foundUnresolvedRef(value.Ref)
+func (value *ParameterRef) Validate(ctx context.Context) error {
+	if v := value.Value; v != nil {
+		return v.Validate(ctx)
 	}
-	return v.Validate(c)
+	return foundUnresolvedRef(value.Ref)
 }
 
 func (value ParameterRef) JSONLookup(token string) (interface{}, error) {
@@ -171,12 +171,11 @@ func (value *ResponseRef) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalRef(data, &value.Ref, &value.Value)
 }
 
-func (value *ResponseRef) Validate(c context.Context) error {
-	v := value.Value
-	if v == nil {
-		return foundUnresolvedRef(value.Ref)
+func (value *ResponseRef) Validate(ctx context.Context) error {
+	if v := value.Value; v != nil {
+		return v.Validate(ctx)
 	}
-	return v.Validate(c)
+	return foundUnresolvedRef(value.Ref)
 }
 
 func (value ResponseRef) JSONLookup(token string) (interface{}, error) {
@@ -203,12 +202,11 @@ func (value *RequestBodyRef) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalRef(data, &value.Ref, &value.Value)
 }
 
-func (value *RequestBodyRef) Validate(c context.Context) error {
-	v := value.Value
-	if v == nil {
-		return foundUnresolvedRef(value.Ref)
+func (value *RequestBodyRef) Validate(ctx context.Context) error {
+	if v := value.Value; v != nil {
+		return v.Validate(ctx)
 	}
-	return v.Validate(c)
+	return foundUnresolvedRef(value.Ref)
 }
 
 func (value RequestBodyRef) JSONLookup(token string) (interface{}, error) {
@@ -242,12 +240,11 @@ func (value *SchemaRef) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalRef(data, &value.Ref, &value.Value)
 }
 
-func (value *SchemaRef) Validate(c context.Context) error {
-	v := value.Value
-	if v == nil {
-		return foundUnresolvedRef(value.Ref)
+func (value *SchemaRef) Validate(ctx context.Context) error {
+	if v := value.Value; v != nil {
+		return v.Validate(ctx)
 	}
-	return v.Validate(c)
+	return foundUnresolvedRef(value.Ref)
 }
 
 func (value SchemaRef) JSONLookup(token string) (interface{}, error) {
@@ -274,12 +271,11 @@ func (value *SecuritySchemeRef) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalRef(data, &value.Ref, &value.Value)
 }
 
-func (value *SecuritySchemeRef) Validate(c context.Context) error {
-	v := value.Value
-	if v == nil {
-		return foundUnresolvedRef(value.Ref)
+func (value *SecuritySchemeRef) Validate(ctx context.Context) error {
+	if v := value.Value; v != nil {
+		return v.Validate(ctx)
 	}
-	return v.Validate(c)
+	return foundUnresolvedRef(value.Ref)
 }
 
 func (value SecuritySchemeRef) JSONLookup(token string) (interface{}, error) {
diff --git a/openapi3/request_body.go b/openapi3/request_body.go
index ad871e8..66b512f 100644
--- a/openapi3/request_body.go
+++ b/openapi3/request_body.go
@@ -97,9 +97,9 @@ func (requestBody *RequestBody) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalStrictStruct(data, requestBody)
 }
 
-func (requestBody *RequestBody) Validate(c context.Context) error {
-	if v := requestBody.Content; v != nil {
-		if err := v.Validate(c); err != nil {
+func (value *RequestBody) Validate(ctx context.Context) error {
+	if v := value.Content; v != nil {
+		if err := v.Validate(ctx); err != nil {
 			return err
 		}
 	}
diff --git a/openapi3/response.go b/openapi3/response.go
index 7c4da1d..2ab33ac 100644
--- a/openapi3/response.go
+++ b/openapi3/response.go
@@ -29,12 +29,12 @@ func (responses Responses) Get(status int) *ResponseRef {
 	return responses[strconv.FormatInt(int64(status), 10)]
 }
 
-func (responses Responses) Validate(c context.Context) error {
-	if len(responses) == 0 {
+func (value Responses) Validate(ctx context.Context) error {
+	if len(value) == 0 {
 		return errors.New("the responses object MUST contain at least one response code")
 	}
-	for _, v := range responses {
-		if err := v.Validate(c); err != nil {
+	for _, v := range value {
+		if err := v.Validate(ctx); err != nil {
 			return err
 		}
 	}
@@ -94,13 +94,13 @@ func (response *Response) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalStrictStruct(data, response)
 }
 
-func (response *Response) Validate(c context.Context) error {
-	if response.Description == nil {
+func (value *Response) Validate(ctx context.Context) error {
+	if value.Description == nil {
 		return errors.New("a short description of the response is required")
 	}
 
-	if content := response.Content; content != nil {
-		if err := content.Validate(c); err != nil {
+	if content := value.Content; content != nil {
+		if err := content.Validate(ctx); err != nil {
 			return err
 		}
 	}
diff --git a/openapi3/schema.go b/openapi3/schema.go
index 22cb842..8c59f3c 100644
--- a/openapi3/schema.go
+++ b/openapi3/schema.go
@@ -579,11 +579,11 @@ func (schema *Schema) IsEmpty() bool {
 	return true
 }
 
-func (schema *Schema) Validate(c context.Context) error {
-	return schema.validate(c, []*Schema{})
+func (value *Schema) Validate(ctx context.Context) error {
+	return value.validate(ctx, []*Schema{})
 }
 
-func (schema *Schema) validate(c context.Context, stack []*Schema) (err error) {
+func (schema *Schema) validate(ctx context.Context, stack []*Schema) (err error) {
 	for _, existing := range stack {
 		if existing == schema {
 			return
@@ -600,7 +600,7 @@ func (schema *Schema) validate(c context.Context, stack []*Schema) (err error) {
 		if v == nil {
 			return foundUnresolvedRef(item.Ref)
 		}
-		if err = v.validate(c, stack); err == nil {
+		if err = v.validate(ctx, stack); err == nil {
 			return
 		}
 	}
@@ -610,7 +610,7 @@ func (schema *Schema) validate(c context.Context, stack []*Schema) (err error) {
 		if v == nil {
 			return foundUnresolvedRef(item.Ref)
 		}
-		if err = v.validate(c, stack); err != nil {
+		if err = v.validate(ctx, stack); err != nil {
 			return
 		}
 	}
@@ -620,7 +620,7 @@ func (schema *Schema) validate(c context.Context, stack []*Schema) (err error) {
 		if v == nil {
 			return foundUnresolvedRef(item.Ref)
 		}
-		if err = v.validate(c, stack); err != nil {
+		if err = v.validate(ctx, stack); err != nil {
 			return
 		}
 	}
@@ -630,7 +630,7 @@ func (schema *Schema) validate(c context.Context, stack []*Schema) (err error) {
 		if v == nil {
 			return foundUnresolvedRef(ref.Ref)
 		}
-		if err = v.validate(c, stack); err != nil {
+		if err = v.validate(ctx, stack); err != nil {
 			return
 		}
 	}
@@ -691,7 +691,7 @@ func (schema *Schema) validate(c context.Context, stack []*Schema) (err error) {
 		if v == nil {
 			return foundUnresolvedRef(ref.Ref)
 		}
-		if err = v.validate(c, stack); err != nil {
+		if err = v.validate(ctx, stack); err != nil {
 			return
 		}
 	}
@@ -701,7 +701,7 @@ func (schema *Schema) validate(c context.Context, stack []*Schema) (err error) {
 		if v == nil {
 			return foundUnresolvedRef(ref.Ref)
 		}
-		if err = v.validate(c, stack); err != nil {
+		if err = v.validate(ctx, stack); err != nil {
 			return
 		}
 	}
@@ -711,7 +711,7 @@ func (schema *Schema) validate(c context.Context, stack []*Schema) (err error) {
 		if v == nil {
 			return foundUnresolvedRef(ref.Ref)
 		}
-		if err = v.validate(c, stack); err != nil {
+		if err = v.validate(ctx, stack); err != nil {
 			return
 		}
 	}
diff --git a/openapi3/security_requirements.go b/openapi3/security_requirements.go
index 1d2c745..ce6fcc6 100644
--- a/openapi3/security_requirements.go
+++ b/openapi3/security_requirements.go
@@ -15,9 +15,9 @@ func (srs *SecurityRequirements) With(securityRequirement SecurityRequirement) *
 	return srs
 }
 
-func (srs SecurityRequirements) Validate(c context.Context) error {
-	for _, item := range srs {
-		if err := item.Validate(c); err != nil {
+func (value SecurityRequirements) Validate(ctx context.Context) error {
+	for _, item := range value {
+		if err := item.Validate(ctx); err != nil {
 			return err
 		}
 	}
@@ -38,6 +38,6 @@ func (security SecurityRequirement) Authenticate(provider string, scopes ...stri
 	return security
 }
 
-func (security SecurityRequirement) Validate(c context.Context) error {
+func (value SecurityRequirement) Validate(ctx context.Context) error {
 	return nil
 }
diff --git a/openapi3/security_scheme.go b/openapi3/security_scheme.go
index d1f665c..990f258 100644
--- a/openapi3/security_scheme.go
+++ b/openapi3/security_scheme.go
@@ -103,15 +103,15 @@ func (ss *SecurityScheme) WithBearerFormat(value string) *SecurityScheme {
 	return ss
 }
 
-func (ss *SecurityScheme) Validate(c context.Context) error {
+func (value *SecurityScheme) Validate(ctx context.Context) error {
 	hasIn := false
 	hasBearerFormat := false
 	hasFlow := false
-	switch ss.Type {
+	switch value.Type {
 	case "apiKey":
 		hasIn = true
 	case "http":
-		scheme := ss.Scheme
+		scheme := value.Scheme
 		switch scheme {
 		case "bearer":
 			hasBearerFormat = true
@@ -122,46 +122,46 @@ func (ss *SecurityScheme) Validate(c context.Context) error {
 	case "oauth2":
 		hasFlow = true
 	case "openIdConnect":
-		if ss.OpenIdConnectUrl == "" {
-			return fmt.Errorf("no OIDC URL found for openIdConnect security scheme %q", ss.Name)
+		if value.OpenIdConnectUrl == "" {
+			return fmt.Errorf("no OIDC URL found for openIdConnect security scheme %q", value.Name)
 		}
 	default:
-		return fmt.Errorf("security scheme 'type' can't be %q", ss.Type)
+		return fmt.Errorf("security scheme 'type' can't be %q", value.Type)
 	}
 
 	// Validate "in" and "name"
 	if hasIn {
-		switch ss.In {
+		switch value.In {
 		case "query", "header", "cookie":
 		default:
-			return fmt.Errorf("security scheme of type 'apiKey' should have 'in'. It can be 'query', 'header' or 'cookie', not %q", ss.In)
+			return fmt.Errorf("security scheme of type 'apiKey' should have 'in'. It can be 'query', 'header' or 'cookie', not %q", value.In)
 		}
-		if ss.Name == "" {
+		if value.Name == "" {
 			return errors.New("security scheme of type 'apiKey' should have 'name'")
 		}
-	} else if len(ss.In) > 0 {
-		return fmt.Errorf("security scheme of type %q can't have 'in'", ss.Type)
-	} else if len(ss.Name) > 0 {
+	} else if len(value.In) > 0 {
+		return fmt.Errorf("security scheme of type %q can't have 'in'", value.Type)
+	} else if len(value.Name) > 0 {
 		return errors.New("security scheme of type 'apiKey' can't have 'name'")
 	}
 
 	// Validate "format"
 	// "bearerFormat" is an arbitrary string so we only check if the scheme supports it
-	if !hasBearerFormat && len(ss.BearerFormat) > 0 {
-		return fmt.Errorf("security scheme of type %q can't have 'bearerFormat'", ss.Type)
+	if !hasBearerFormat && len(value.BearerFormat) > 0 {
+		return fmt.Errorf("security scheme of type %q can't have 'bearerFormat'", value.Type)
 	}
 
 	// Validate "flow"
 	if hasFlow {
-		flow := ss.Flows
+		flow := value.Flows
 		if flow == nil {
-			return fmt.Errorf("security scheme of type %q should have 'flows'", ss.Type)
+			return fmt.Errorf("security scheme of type %q should have 'flows'", value.Type)
 		}
-		if err := flow.Validate(c); err != nil {
+		if err := flow.Validate(ctx); err != nil {
 			return fmt.Errorf("security scheme 'flow' is invalid: %v", err)
 		}
-	} else if ss.Flows != nil {
-		return fmt.Errorf("security scheme of type %q can't have 'flows'", ss.Type)
+	} else if value.Flows != nil {
+		return fmt.Errorf("security scheme of type %q can't have 'flows'", value.Type)
 	}
 	return nil
 }
@@ -191,18 +191,18 @@ func (flows *OAuthFlows) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalStrictStruct(data, flows)
 }
 
-func (flows *OAuthFlows) Validate(c context.Context) error {
+func (flows *OAuthFlows) Validate(ctx context.Context) error {
 	if v := flows.Implicit; v != nil {
-		return v.Validate(c, oAuthFlowTypeImplicit)
+		return v.Validate(ctx, oAuthFlowTypeImplicit)
 	}
 	if v := flows.Password; v != nil {
-		return v.Validate(c, oAuthFlowTypePassword)
+		return v.Validate(ctx, oAuthFlowTypePassword)
 	}
 	if v := flows.ClientCredentials; v != nil {
-		return v.Validate(c, oAuthFlowTypeClientCredentials)
+		return v.Validate(ctx, oAuthFlowTypeClientCredentials)
 	}
 	if v := flows.AuthorizationCode; v != nil {
-		return v.Validate(c, oAuthFlowAuthorizationCode)
+		return v.Validate(ctx, oAuthFlowAuthorizationCode)
 	}
 	return errors.New("no OAuth flow is defined")
 }
@@ -223,7 +223,7 @@ func (flow *OAuthFlow) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalStrictStruct(data, flow)
 }
 
-func (flow *OAuthFlow) Validate(c context.Context, typ oAuthFlowType) error {
+func (flow *OAuthFlow) Validate(ctx context.Context, typ oAuthFlowType) error {
 	if typ == oAuthFlowAuthorizationCode || typ == oAuthFlowTypeImplicit {
 		if v := flow.AuthorizationURL; v == "" {
 			return errors.New("an OAuth flow is missing 'authorizationUrl in authorizationCode or implicit '")
diff --git a/openapi3/server.go b/openapi3/server.go
index 6cdeb4a..4415bd0 100644
--- a/openapi3/server.go
+++ b/openapi3/server.go
@@ -15,9 +15,9 @@ import (
 type Servers []*Server
 
 // Validate ensures servers are per the OpenAPIv3 specification.
-func (servers Servers) Validate(c context.Context) error {
-	for _, v := range servers {
-		if err := v.Validate(c); err != nil {
+func (value Servers) Validate(ctx context.Context) error {
+	for _, v := range value {
+		if err := v.Validate(ctx); err != nil {
 			return err
 		}
 	}
@@ -125,22 +125,22 @@ func (server Server) MatchRawURL(input string) ([]string, string, bool) {
 	return params, input, true
 }
 
-func (server *Server) Validate(c context.Context) (err error) {
-	if server.URL == "" {
+func (value *Server) Validate(ctx context.Context) (err error) {
+	if value.URL == "" {
 		return errors.New("value of url must be a non-empty string")
 	}
-	opening, closing := strings.Count(server.URL, "{"), strings.Count(server.URL, "}")
+	opening, closing := strings.Count(value.URL, "{"), strings.Count(value.URL, "}")
 	if opening != closing {
 		return errors.New("server URL has mismatched { and }")
 	}
-	if opening != len(server.Variables) {
+	if opening != len(value.Variables) {
 		return errors.New("server has undeclared variables")
 	}
-	for name, v := range server.Variables {
-		if !strings.Contains(server.URL, fmt.Sprintf("{%s}", name)) {
+	for name, v := range value.Variables {
+		if !strings.Contains(value.URL, fmt.Sprintf("{%s}", name)) {
 			return errors.New("server has undeclared variables")
 		}
-		if err = v.Validate(c); err != nil {
+		if err = v.Validate(ctx); err != nil {
 			return
 		}
 	}
@@ -163,9 +163,9 @@ func (serverVariable *ServerVariable) UnmarshalJSON(data []byte) error {
 	return jsoninfo.UnmarshalStrictStruct(data, serverVariable)
 }
 
-func (serverVariable *ServerVariable) Validate(c context.Context) error {
-	if serverVariable.Default == "" {
-		data, err := serverVariable.MarshalJSON()
+func (value *ServerVariable) Validate(ctx context.Context) error {
+	if value.Default == "" {
+		data, err := value.MarshalJSON()
 		if err != nil {
 			return err
 		}
diff --git a/openapi3filter/validate_request.go b/openapi3filter/validate_request.go
index f1e7bf9..2f9a5f1 100644
--- a/openapi3filter/validate_request.go
+++ b/openapi3filter/validate_request.go
@@ -25,7 +25,7 @@ var ErrInvalidRequired = errors.New("value is required but missing")
 //
 // Note: One can tune the behavior of uniqueItems: true verification
 // by registering a custom function with openapi3.RegisterArrayUniqueItemsChecker
-func ValidateRequest(c context.Context, input *RequestValidationInput) error {
+func ValidateRequest(ctx context.Context, input *RequestValidationInput) error {
 	var (
 		err error
 		me  openapi3.MultiError
@@ -49,7 +49,7 @@ func ValidateRequest(c context.Context, input *RequestValidationInput) error {
 			}
 		}
 
-		if err = ValidateParameter(c, input, parameter); err != nil && !options.MultiError {
+		if err = ValidateParameter(ctx, input, parameter); err != nil && !options.MultiError {
 			return err
 		}
 
@@ -60,7 +60,7 @@ func ValidateRequest(c context.Context, input *RequestValidationInput) error {
 
 	// For each parameter of the Operation
 	for _, parameter := range operationParameters {
-		if err = ValidateParameter(c, input, parameter.Value); err != nil && !options.MultiError {
+		if err = ValidateParameter(ctx, input, parameter.Value); err != nil && !options.MultiError {
 			return err
 		}
 
@@ -72,7 +72,7 @@ func ValidateRequest(c context.Context, input *RequestValidationInput) error {
 	// RequestBody
 	requestBody := operation.RequestBody
 	if requestBody != nil && !options.ExcludeRequestBody {
-		if err = ValidateRequestBody(c, input, requestBody.Value); err != nil && !options.MultiError {
+		if err = ValidateRequestBody(ctx, input, requestBody.Value); err != nil && !options.MultiError {
 			return err
 		}
 
@@ -86,10 +86,10 @@ func ValidateRequest(c context.Context, input *RequestValidationInput) error {
 	// If there aren't any security requirements for the operation
 	if security == nil {
 		// Use the global security requirements.
-		security = &route.Swagger.Security
+		security = &route.Spec.Security
 	}
 	if security != nil {
-		if err = ValidateSecurityRequirements(c, input, *security); err != nil && !options.MultiError {
+		if err = ValidateSecurityRequirements(ctx, input, *security); err != nil && !options.MultiError {
 			return err
 		}
 
@@ -109,10 +109,10 @@ func ValidateRequest(c context.Context, input *RequestValidationInput) error {
 // The function returns RequestError with a ParseError cause when unable to parse a value.
 // The function returns RequestError with ErrInvalidRequired cause when a value of a required parameter is not defined.
 // The function returns RequestError with a openapi3.SchemaError cause when a value is invalid by JSON schema.
-func ValidateParameter(c context.Context, input *RequestValidationInput, parameter *openapi3.Parameter) error {
+func ValidateParameter(ctx context.Context, input *RequestValidationInput, parameter *openapi3.Parameter) error {
 	if parameter.Schema == nil && parameter.Content == nil {
 		// We have no schema for the parameter. Assume that everything passes
-		// a schema-less check, but this could also be an error. The Swagger
+		// a schema-less check, but this could also be an error. The OpenAPI
 		// validation allows this to happen.
 		return nil
 	}
@@ -166,7 +166,7 @@ const prefixInvalidCT = "header Content-Type has unexpected value"
 //
 // The function returns RequestError with ErrInvalidRequired cause when a value is required but not defined.
 // The function returns RequestError with a openapi3.SchemaError cause when a value is invalid by JSON schema.
-func ValidateRequestBody(c context.Context, input *RequestValidationInput, requestBody *openapi3.RequestBody) error {
+func ValidateRequestBody(ctx context.Context, input *RequestValidationInput, requestBody *openapi3.RequestBody) error {
 	var (
 		req  = input.Request
 		data []byte
@@ -252,13 +252,13 @@ func ValidateRequestBody(c context.Context, input *RequestValidationInput, reque
 // ValidateSecurityRequirements goes through multiple OpenAPI 3 security
 // requirements in order and returns nil on the first valid requirement.
 // If no requirement is met, errors are returned in order.
-func ValidateSecurityRequirements(c context.Context, input *RequestValidationInput, srs openapi3.SecurityRequirements) error {
+func ValidateSecurityRequirements(ctx context.Context, input *RequestValidationInput, srs openapi3.SecurityRequirements) error {
 	if len(srs) == 0 {
 		return nil
 	}
 	var errs []error
 	for _, sr := range srs {
-		if err := validateSecurityRequirement(c, input, sr); err != nil {
+		if err := validateSecurityRequirement(ctx, input, sr); err != nil {
 			if len(errs) == 0 {
 				errs = make([]error, 0, len(srs))
 			}
@@ -274,9 +274,9 @@ func ValidateSecurityRequirements(c context.Context, input *RequestValidationInp
 }
 
 // validateSecurityRequirement validates a single OpenAPI 3 security requirement
-func validateSecurityRequirement(c context.Context, input *RequestValidationInput, securityRequirement openapi3.SecurityRequirement) error {
-	swagger := input.Route.Swagger
-	securitySchemes := swagger.Components.SecuritySchemes
+func validateSecurityRequirement(ctx context.Context, input *RequestValidationInput, securityRequirement openapi3.SecurityRequirement) error {
+	doc := input.Route.Spec
+	securitySchemes := doc.Components.SecuritySchemes
 
 	// Ensure deterministic order
 	names := make([]string, 0, len(securityRequirement))
@@ -310,7 +310,7 @@ func validateSecurityRequirement(c context.Context, input *RequestValidationInpu
 			}
 		}
 		scopes := securityRequirement[name]
-		if err := f(c, &AuthenticationInput{
+		if err := f(ctx, &AuthenticationInput{
 			RequestValidationInput: input,
 			SecuritySchemeName:     name,
 			SecurityScheme:         securityScheme,
diff --git a/openapi3filter/validate_request_input.go b/openapi3filter/validate_request_input.go
index 14c661b..91dd102 100644
--- a/openapi3filter/validate_request_input.go
+++ b/openapi3filter/validate_request_input.go
@@ -8,7 +8,7 @@ import (
 	"github.com/getkin/kin-openapi/routers"
 )
 
-// A ContentParameterDecoder takes a parameter definition from the swagger spec,
+// A ContentParameterDecoder takes a parameter definition from the OpenAPI spec,
 // and the value which we received for it. It is expected to return the
 // value unmarshaled into an interface which can be traversed for
 // validation, it should also return the schema to be used for validating the
diff --git a/openapi3filter/validate_response.go b/openapi3filter/validate_response.go
index 9575c4c..b70938e 100644
--- a/openapi3filter/validate_response.go
+++ b/openapi3filter/validate_response.go
@@ -17,7 +17,7 @@ import (
 //
 // Note: One can tune the behavior of uniqueItems: true verification
 // by registering a custom function with openapi3.RegisterArrayUniqueItemsChecker
-func ValidateResponse(c context.Context, input *ResponseValidationInput) error {
+func ValidateResponse(ctx context.Context, input *ResponseValidationInput) error {
 	req := input.RequestValidationInput.Request
 	switch req.Method {
 	case "HEAD":
diff --git a/openapi3filter/validation_handler.go b/openapi3filter/validation_handler.go
index 111ece7..eeb1ca1 100644
--- a/openapi3filter/validation_handler.go
+++ b/openapi3filter/validation_handler.go
@@ -18,14 +18,14 @@ var _ AuthenticationFunc = NoopAuthenticationFunc
 type ValidationHandler struct {
 	Handler            http.Handler
 	AuthenticationFunc AuthenticationFunc
-	SwaggerFile        string
+	File               string
 	ErrorEncoder       ErrorEncoder
 	router             routers.Router
 }
 
 func (h *ValidationHandler) Load() error {
-	loader := openapi3.NewSwaggerLoader()
-	doc, err := loader.LoadSwaggerFromFile(h.SwaggerFile)
+	loader := openapi3.NewLoader()
+	doc, err := loader.LoadFromFile(h.File)
 	if err != nil {
 		return err
 	}
diff --git a/routers/gorillamux/router.go b/routers/gorillamux/router.go
index 896f5fa..4011932 100644
--- a/routers/gorillamux/router.go
+++ b/routers/gorillamux/router.go
@@ -26,7 +26,7 @@ type Router struct {
 // NewRouter creates a gorilla/mux router.
 // Assumes spec is .Validate()d
 // TODO: Handle/HandlerFunc + ServeHTTP (When there is a match, the route variables can be retrieved calling mux.Vars(request))
-func NewRouter(doc *openapi3.Swagger) (routers.Router, error) {
+func NewRouter(doc *openapi3.T) (routers.Router, error) {
 	type srv struct {
 		schemes    []string
 		host, base string
@@ -81,7 +81,7 @@ func NewRouter(doc *openapi3.Swagger) (routers.Router, error) {
 			}
 			r.muxes = append(r.muxes, muxRoute)
 			r.routes = append(r.routes, &routers.Route{
-				Swagger:   doc,
+				Spec:      doc,
 				Server:    s.server,
 				Path:      path,
 				PathItem:  pathItem,
@@ -103,7 +103,7 @@ func (r *Router) FindRoute(req *http.Request) (*routers.Route, map[string]string
 			}
 			route := r.routes[i]
 			route.Method = req.Method
-			route.Operation = route.Swagger.Paths[route.Path].GetOperation(route.Method)
+			route.Operation = route.Spec.Paths[route.Path].GetOperation(route.Method)
 			return route, match.Vars, nil
 		}
 		switch match.MatchErr {
diff --git a/routers/legacy/router.go b/routers/legacy/router.go
index 1cb1426..ecaae13 100644
--- a/routers/legacy/router.go
+++ b/routers/legacy/router.go
@@ -50,15 +50,15 @@ func (rs Routers) FindRoute(req *http.Request) (routers.Router, *routers.Route,
 
 // Router maps a HTTP request to an OpenAPI operation.
 type Router struct {
-	doc      *openapi3.Swagger
+	doc      *openapi3.T
 	pathNode *pathpattern.Node
 }
 
 // NewRouter creates a new router.
 //
-// If the given Swagger has servers, router will use them.
-// All operations of the Swagger will be added to the router.
-func NewRouter(doc *openapi3.Swagger) (routers.Router, error) {
+// If the given OpenAPIv3 document has servers, router will use them.
+// All operations of the document will be added to the router.
+func NewRouter(doc *openapi3.T) (routers.Router, error) {
 	if err := doc.Validate(context.Background()); err != nil {
 		return nil, fmt.Errorf("validating OpenAPI failed: %v", err)
 	}
@@ -68,7 +68,7 @@ func NewRouter(doc *openapi3.Swagger) (routers.Router, error) {
 		for method, operation := range pathItem.Operations() {
 			method = strings.ToUpper(method)
 			if err := root.Add(method+" "+path, &routers.Route{
-				Swagger:   doc,
+				Spec:      doc,
 				Path:      path,
 				PathItem:  pathItem,
 				Method:    method,
diff --git a/routers/types.go b/routers/types.go
index b15b3ba..3cdbee3 100644
--- a/routers/types.go
+++ b/routers/types.go
@@ -13,7 +13,7 @@ type Router interface {
 
 // Route describes the operation an http.Request can match
 type Route struct {
-	Swagger   *openapi3.Swagger
+	Spec      *openapi3.T
 	Server    *openapi3.Server
 	Path      string
 	PathItem  *openapi3.PathItem


Test patch:
diff --git a/openapi2/openapi2_test.go b/openapi2/openapi2_test.go
index 1a5135d..87bd5ce 100644
--- a/openapi2/openapi2_test.go
+++ b/openapi2/openapi2_test.go
@@ -1,24 +1,36 @@
-package openapi2
+package openapi2_test
 
 import (
 	"encoding/json"
+	"fmt"
 	"io/ioutil"
-	"testing"
+	"reflect"
 
-	"github.com/stretchr/testify/require"
+	"github.com/getkin/kin-openapi/openapi2"
 )
 
-func TestReadingSwagger(t *testing.T) {
-	var swagger Swagger
-
+func Example() {
 	input, err := ioutil.ReadFile("testdata/swagger.json")
-	require.NoError(t, err)
+	if err != nil {
+		panic(err)
+	}
 
-	err = json.Unmarshal(input, &swagger)
-	require.NoError(t, err)
+	var doc openapi2.T
+	if err = json.Unmarshal(input, &doc); err != nil {
+		panic(err)
+	}
 
-	output, err := json.Marshal(swagger)
-	require.NoError(t, err)
+	output, err := json.Marshal(doc)
+	if err != nil {
+		panic(err)
+	}
 
-	require.JSONEq(t, string(input), string(output))
+	var docAgain openapi2.T
+	if err = json.Unmarshal(output, &docAgain); err != nil {
+		panic(err)
+	}
+	if !reflect.DeepEqual(doc, docAgain) {
+		fmt.Println("objects doc & docAgain should be the same")
+	}
+	// Output:
 }
diff --git a/openapi2conv/issue187_test.go b/openapi2conv/issue187_test.go
index 16a6d1a..7ca85ca 100644
--- a/openapi2conv/issue187_test.go
+++ b/openapi2conv/issue187_test.go
@@ -11,21 +11,21 @@ import (
 	"github.com/stretchr/testify/require"
 )
 
-func v2v3JSON(spec2 []byte) (doc3 *openapi3.Swagger, err error) {
-	var doc2 openapi2.Swagger
+func v2v3JSON(spec2 []byte) (doc3 *openapi3.T, err error) {
+	var doc2 openapi2.T
 	if err = json.Unmarshal(spec2, &doc2); err != nil {
 		return
 	}
-	doc3, err = ToV3Swagger(&doc2)
+	doc3, err = ToV3(&doc2)
 	return
 }
 
-func v2v3YAML(spec2 []byte) (doc3 *openapi3.Swagger, err error) {
-	var doc2 openapi2.Swagger
+func v2v3YAML(spec2 []byte) (doc3 *openapi3.T, err error) {
+	var doc2 openapi2.T
 	if err = yaml.Unmarshal(spec2, &doc2); err != nil {
 		return
 	}
-	doc3, err = ToV3Swagger(&doc2)
+	doc3, err = ToV3(&doc2)
 	return
 }
 
diff --git a/openapi2conv/openapi2_conv_test.go b/openapi2conv/openapi2_conv_test.go
index f284ba4..adb9b08 100644
--- a/openapi2conv/openapi2_conv_test.go
+++ b/openapi2conv/openapi2_conv_test.go
@@ -11,19 +11,19 @@ import (
 )
 
 func TestConvOpenAPIV3ToV2(t *testing.T) {
-	var doc3 openapi3.Swagger
+	var doc3 openapi3.T
 	err := json.Unmarshal([]byte(exampleV3), &doc3)
 	require.NoError(t, err)
 	{
 		// Refs need resolving before we can Validate
-		sl := openapi3.NewSwaggerLoader()
+		sl := openapi3.NewLoader()
 		err = sl.ResolveRefsIn(&doc3, nil)
 		require.NoError(t, err)
 		err = doc3.Validate(context.Background())
 		require.NoError(t, err)
 	}
 
-	spec2, err := FromV3Swagger(&doc3)
+	spec2, err := FromV3(&doc3)
 	require.NoError(t, err)
 	data, err := json.Marshal(spec2)
 	require.NoError(t, err)
@@ -31,11 +31,11 @@ func TestConvOpenAPIV3ToV2(t *testing.T) {
 }
 
 func TestConvOpenAPIV2ToV3(t *testing.T) {
-	var doc2 openapi2.Swagger
+	var doc2 openapi2.T
 	err := json.Unmarshal([]byte(exampleV2), &doc2)
 	require.NoError(t, err)
 
-	spec3, err := ToV3Swagger(&doc2)
+	spec3, err := ToV3(&doc2)
 	require.NoError(t, err)
 	err = spec3.Validate(context.Background())
 	require.NoError(t, err)
diff --git a/openapi3/discriminator_test.go b/openapi3/discriminator_test.go
index c855481..7c16992 100644
--- a/openapi3/discriminator_test.go
+++ b/openapi3/discriminator_test.go
@@ -45,8 +45,8 @@ func TestParsingDiscriminator(t *testing.T) {
 }
 `
 
-	loader := NewSwaggerLoader()
-	doc, err := loader.LoadSwaggerFromData([]byte(spec))
+	loader := NewLoader()
+	doc, err := loader.LoadFromData([]byte(spec))
 	require.NoError(t, err)
 
 	err = doc.Validate(loader.Context)
diff --git a/openapi3/extension_test.go b/openapi3/extension_test.go
index 22ed6af..9d00902 100644
--- a/openapi3/extension_test.go
+++ b/openapi3/extension_test.go
@@ -10,9 +10,9 @@ import (
 )
 
 func ExampleExtensionProps_DecodeWith() {
-	loader := NewSwaggerLoader()
+	loader := NewLoader()
 	loader.IsExternalRefsAllowed = true
-	spec, err := loader.LoadSwaggerFromFile("testdata/testref.openapi.json")
+	spec, err := loader.LoadFromFile("testdata/testref.openapi.json")
 	if err != nil {
 		panic(err)
 	}
diff --git a/openapi3/issue301_test.go b/openapi3/issue301_test.go
index 15298a5..a0225fd 100644
--- a/openapi3/issue301_test.go
+++ b/openapi3/issue301_test.go
@@ -7,10 +7,10 @@ import (
 )
 
 func TestIssue301(t *testing.T) {
-	sl := NewSwaggerLoader()
+	sl := NewLoader()
 	sl.IsExternalRefsAllowed = true
 
-	doc, err := sl.LoadSwaggerFromFile("testdata/callbacks.yml")
+	doc, err := sl.LoadFromFile("testdata/callbacks.yml")
 	require.NoError(t, err)
 
 	err = doc.Validate(sl.Context)
diff --git a/openapi3/issue341_test.go b/openapi3/issue341_test.go
index c026d6d..93364d0 100644
--- a/openapi3/issue341_test.go
+++ b/openapi3/issue341_test.go
@@ -7,9 +7,9 @@ import (
 )
 
 func TestIssue341(t *testing.T) {
-	sl := NewSwaggerLoader()
+	sl := NewLoader()
 	sl.IsExternalRefsAllowed = true
-	doc, err := sl.LoadSwaggerFromFile("testdata/main.yaml")
+	doc, err := sl.LoadFromFile("testdata/main.yaml")
 	require.NoError(t, err)
 
 	err = doc.Validate(sl.Context)
diff --git a/openapi3/issue344_test.go b/openapi3/issue344_test.go
index 8a53394..44ba2b7 100644
--- a/openapi3/issue344_test.go
+++ b/openapi3/issue344_test.go
@@ -7,10 +7,10 @@ import (
 )
 
 func TestIssue344(t *testing.T) {
-	sl := NewSwaggerLoader()
+	sl := NewLoader()
 	sl.IsExternalRefsAllowed = true
 
-	doc, err := sl.LoadSwaggerFromFile("testdata/spec.yaml")
+	doc, err := sl.LoadFromFile("testdata/spec.yaml")
 	require.NoError(t, err)
 
 	err = doc.Validate(sl.Context)
diff --git a/openapi3/swagger_loader_empty_response_description_test.go b/openapi3/loader_empty_response_description_test.go
similarity index 83%
rename from openapi3/swagger_loader_empty_response_description_test.go
rename to openapi3/loader_empty_response_description_test.go
index c75ad8a..3c4b6bf 100644
--- a/openapi3/swagger_loader_empty_response_description_test.go
+++ b/openapi3/loader_empty_response_description_test.go
@@ -33,8 +33,8 @@ func TestJSONSpecResponseDescriptionEmptiness(t *testing.T) {
 
 	{
 		spec := []byte(spec)
-		loader := NewSwaggerLoader()
-		doc, err := loader.LoadSwaggerFromData(spec)
+		loader := NewLoader()
+		doc, err := loader.LoadFromData(spec)
 		require.NoError(t, err)
 		got := doc.Paths["/path1"].Get.Responses["200"].Value.Description
 		expected := ""
@@ -46,8 +46,8 @@ func TestJSONSpecResponseDescriptionEmptiness(t *testing.T) {
 
 	{
 		spec := []byte(strings.Replace(spec, `"description": ""`, `"description": "My response"`, 1))
-		loader := NewSwaggerLoader()
-		doc, err := loader.LoadSwaggerFromData(spec)
+		loader := NewLoader()
+		doc, err := loader.LoadFromData(spec)
 		require.NoError(t, err)
 		got := doc.Paths["/path1"].Get.Responses["200"].Value.Description
 		expected := "My response"
@@ -57,9 +57,9 @@ func TestJSONSpecResponseDescriptionEmptiness(t *testing.T) {
 		require.NoError(t, err)
 	}
 
-	noDescriptionIsInvalid := func(data []byte) *Swagger {
-		loader := NewSwaggerLoader()
-		doc, err := loader.LoadSwaggerFromData(data)
+	noDescriptionIsInvalid := func(data []byte) *T {
+		loader := NewLoader()
+		doc, err := loader.LoadFromData(data)
 		require.NoError(t, err)
 		got := doc.Paths["/path1"].Get.Responses["200"].Value.Description
 		require.Nil(t, got)
@@ -69,7 +69,7 @@ func TestJSONSpecResponseDescriptionEmptiness(t *testing.T) {
 		return doc
 	}
 
-	var docWithNoResponseDescription *Swagger
+	var docWithNoResponseDescription *T
 	{
 		spec := []byte(strings.Replace(spec, `"description": ""`, ``, 1))
 		docWithNoResponseDescription = noDescriptionIsInvalid(spec)
diff --git a/openapi3/swagger_loader_http_error_test.go b/openapi3/loader_http_error_test.go
similarity index 84%
rename from openapi3/swagger_loader_http_error_test.go
rename to openapi3/loader_http_error_test.go
index ba361f4..5f7f137 100644
--- a/openapi3/swagger_loader_http_error_test.go
+++ b/openapi3/loader_http_error_test.go
@@ -42,15 +42,15 @@ func TestLoadReferenceFromRemoteURLFailsWithHttpError(t *testing.T) {
     }
 }`)
 
-	loader := NewSwaggerLoader()
+	loader := NewLoader()
 	loader.IsExternalRefsAllowed = true
-	swagger, err := loader.LoadSwaggerFromDataWithPath(spec, &url.URL{Path: "testdata/testfilename.openapi.json"})
+	doc, err := loader.LoadFromDataWithPath(spec, &url.URL{Path: "testdata/testfilename.openapi.json"})
 
-	require.Nil(t, swagger)
+	require.Nil(t, doc)
 	require.EqualError(t, err, fmt.Sprintf("error resolving reference \"%s/components.openapi.json#/components/headers/CustomTestHeader\": error loading \"%s/components.openapi.json\": request returned status code 400", ts.URL, ts.URL))
 
-	swagger, err = loader.LoadSwaggerFromData(spec)
-	require.Nil(t, swagger)
+	doc, err = loader.LoadFromData(spec)
+	require.Nil(t, doc)
 	require.EqualError(t, err, fmt.Sprintf("error resolving reference \"%s/components.openapi.json#/components/headers/CustomTestHeader\": error loading \"%s/components.openapi.json\": request returned status code 400", ts.URL, ts.URL))
 }
 
@@ -86,14 +86,14 @@ func TestLoadFromRemoteURLFailsWithHttpError(t *testing.T) {
     }
 }`)
 
-	loader := NewSwaggerLoader()
+	loader := NewLoader()
 	loader.IsExternalRefsAllowed = true
-	swagger, err := loader.LoadSwaggerFromDataWithPath(spec, &url.URL{Path: "testdata/testfilename.openapi.json"})
+	doc, err := loader.LoadFromDataWithPath(spec, &url.URL{Path: "testdata/testfilename.openapi.json"})
 
-	require.Nil(t, swagger)
+	require.Nil(t, doc)
 	require.EqualError(t, err, fmt.Sprintf("error loading \"%s/components.openapi.json\": request returned status code 400", ts.URL))
 
-	swagger, err = loader.LoadSwaggerFromData(spec)
-	require.Nil(t, swagger)
+	doc, err = loader.LoadFromData(spec)
+	require.Nil(t, doc)
 	require.EqualError(t, err, fmt.Sprintf("error loading \"%s/components.openapi.json\": request returned status code 400", ts.URL))
 }
diff --git a/openapi3/swagger_loader_issue212_test.go b/openapi3/loader_issue212_test.go
similarity index 96%
rename from openapi3/swagger_loader_issue212_test.go
rename to openapi3/loader_issue212_test.go
index 1999db4..507b375 100644
--- a/openapi3/swagger_loader_issue212_test.go
+++ b/openapi3/loader_issue212_test.go
@@ -72,8 +72,8 @@ components:
                   pattern: ^\/images\/[0-9a-f]{64}$
 `
 
-	loader := NewSwaggerLoader()
-	doc, err := loader.LoadSwaggerFromData([]byte(spec))
+	loader := NewLoader()
+	doc, err := loader.LoadFromData([]byte(spec))
 	require.NoError(t, err)
 	err = doc.Validate(loader.Context)
 	require.NoError(t, err)
diff --git a/openapi3/swagger_loader_issue220_test.go b/openapi3/loader_issue220_test.go
similarity index 87%
rename from openapi3/swagger_loader_issue220_test.go
rename to openapi3/loader_issue220_test.go
index 14c4d64..57a44d5 100644
--- a/openapi3/swagger_loader_issue220_test.go
+++ b/openapi3/loader_issue220_test.go
@@ -14,9 +14,9 @@ func TestIssue220(t *testing.T) {
 	} {
 		t.Logf("specPath: %q", specPath)
 
-		loader := NewSwaggerLoader()
+		loader := NewLoader()
 		loader.IsExternalRefsAllowed = true
-		doc, err := loader.LoadSwaggerFromFile(specPath)
+		doc, err := loader.LoadFromFile(specPath)
 		require.NoError(t, err)
 
 		err = doc.Validate(loader.Context)
diff --git a/openapi3/swagger_loader_issue235_test.go b/openapi3/loader_issue235_test.go
similarity index 69%
rename from openapi3/swagger_loader_issue235_test.go
rename to openapi3/loader_issue235_test.go
index 79515c1..4cb54ef 100644
--- a/openapi3/swagger_loader_issue235_test.go
+++ b/openapi3/loader_issue235_test.go
@@ -7,9 +7,9 @@ import (
 )
 
 func TestIssue235OK(t *testing.T) {
-	loader := NewSwaggerLoader()
+	loader := NewLoader()
 	loader.IsExternalRefsAllowed = true
-	doc, err := loader.LoadSwaggerFromFile("testdata/issue235.spec0.yml")
+	doc, err := loader.LoadFromFile("testdata/issue235.spec0.yml")
 	require.NoError(t, err)
 	err = doc.Validate(loader.Context)
 	require.NoError(t, err)
@@ -17,9 +17,9 @@ func TestIssue235OK(t *testing.T) {
 
 func TestIssue235CircularDep(t *testing.T) {
 	t.Skip("TODO: return an error on circular dependencies between external files of a spec")
-	loader := NewSwaggerLoader()
+	loader := NewLoader()
 	loader.IsExternalRefsAllowed = true
-	doc, err := loader.LoadSwaggerFromFile("testdata/issue235.spec0-typo.yml")
+	doc, err := loader.LoadFromFile("testdata/issue235.spec0-typo.yml")
 	require.Nil(t, doc)
 	require.Error(t, err)
 }
diff --git a/openapi3/swagger_loader_outside_refs_test.go b/openapi3/loader_outside_refs_test.go
similarity index 81%
rename from openapi3/swagger_loader_outside_refs_test.go
rename to openapi3/loader_outside_refs_test.go
index 1a5cb1c..5cec934 100644
--- a/openapi3/swagger_loader_outside_refs_test.go
+++ b/openapi3/loader_outside_refs_test.go
@@ -7,9 +7,9 @@ import (
 )
 
 func TestLoadOutsideRefs(t *testing.T) {
-	loader := NewSwaggerLoader()
+	loader := NewLoader()
 	loader.IsExternalRefsAllowed = true
-	doc, err := loader.LoadSwaggerFromFile("testdata/303bis/service.yaml")
+	doc, err := loader.LoadFromFile("testdata/303bis/service.yaml")
 	require.NoError(t, err)
 	require.NotNil(t, doc)
 
diff --git a/openapi3/swagger_loader_paths_test.go b/openapi3/loader_paths_test.go
similarity index 84%
rename from openapi3/swagger_loader_paths_test.go
rename to openapi3/loader_paths_test.go
index babd52c..584f00e 100644
--- a/openapi3/swagger_loader_paths_test.go
+++ b/openapi3/loader_paths_test.go
@@ -26,8 +26,8 @@ paths:
 		"foo/bar":  "invalid paths: path \"foo/bar\" does not start with a forward slash (/)",
 		"/foo/bar": "",
 	} {
-		loader := NewSwaggerLoader()
-		doc, err := loader.LoadSwaggerFromData([]byte(strings.Replace(spec, "PATH", path, 1)))
+		loader := NewLoader()
+		doc, err := loader.LoadFromData([]byte(strings.Replace(spec, "PATH", path, 1)))
 		require.NoError(t, err)
 		err = doc.Validate(loader.Context)
 		if expectedErr != "" {
diff --git a/openapi3/swagger_loader_read_from_uri_func_test.go b/openapi3/loader_read_from_uri_func_test.go
similarity index 75%
rename from openapi3/swagger_loader_read_from_uri_func_test.go
rename to openapi3/loader_read_from_uri_func_test.go
index d63a3be..72d4a95 100644
--- a/openapi3/swagger_loader_read_from_uri_func_test.go
+++ b/openapi3/loader_read_from_uri_func_test.go
@@ -11,24 +11,24 @@ import (
 )
 
 func TestLoaderReadFromURIFunc(t *testing.T) {
-	loader := NewSwaggerLoader()
+	loader := NewLoader()
 	loader.IsExternalRefsAllowed = true
-	loader.ReadFromURIFunc = func(loader *SwaggerLoader, url *url.URL) ([]byte, error) {
+	loader.ReadFromURIFunc = func(loader *Loader, url *url.URL) ([]byte, error) {
 		return ioutil.ReadFile(filepath.Join("testdata", url.Path))
 	}
-	doc, err := loader.LoadSwaggerFromFile("recursiveRef/openapi.yml")
+	doc, err := loader.LoadFromFile("recursiveRef/openapi.yml")
 	require.NoError(t, err)
 	require.NotNil(t, doc)
 	require.NoError(t, doc.Validate(loader.Context))
 	require.Equal(t, "bar", doc.Paths["/foo"].Get.Responses.Get(200).Value.Content.Get("application/json").Schema.Value.Properties["foo"].Value.Properties["bar"].Value.Items.Value.Example)
 }
 
-type multipleSourceSwaggerLoaderExample struct {
+type multipleSourceLoaderExample struct {
 	Sources map[string][]byte
 }
 
-func (l *multipleSourceSwaggerLoaderExample) LoadSwaggerFromURI(
-	loader *SwaggerLoader,
+func (l *multipleSourceLoaderExample) LoadFromURI(
+	loader *Loader,
 	location *url.URL,
 ) ([]byte, error) {
 	source := l.resolveSourceFromURI(location)
@@ -38,7 +38,7 @@ func (l *multipleSourceSwaggerLoaderExample) LoadSwaggerFromURI(
 	return source, nil
 }
 
-func (l *multipleSourceSwaggerLoaderExample) resolveSourceFromURI(location fmt.Stringer) []byte {
+func (l *multipleSourceLoaderExample) resolveSourceFromURI(location fmt.Stringer) []byte {
 	return l.Sources[location.String()]
 }
 
@@ -50,18 +50,18 @@ func TestResolveSchemaExternalRef(t *testing.T) {
 		externalLocation.String(),
 	))
 	externalSpec := []byte(`{"openapi":"3.0.0","info":{"title":"MyAPI","version":"0.1","description":"External Spec"},"paths":{},"components":{"schemas":{"External":{"type":"string"}}}}`)
-	multipleSourceLoader := &multipleSourceSwaggerLoaderExample{
+	multipleSourceLoader := &multipleSourceLoaderExample{
 		Sources: map[string][]byte{
 			rootLocation.String():     rootSpec,
 			externalLocation.String(): externalSpec,
 		},
 	}
-	loader := &SwaggerLoader{
+	loader := &Loader{
 		IsExternalRefsAllowed: true,
-		ReadFromURIFunc:       multipleSourceLoader.LoadSwaggerFromURI,
+		ReadFromURIFunc:       multipleSourceLoader.LoadFromURI,
 	}
 
-	doc, err := loader.LoadSwaggerFromURI(rootLocation)
+	doc, err := loader.LoadFromURI(rootLocation)
 	require.NoError(t, err)
 
 	err = doc.Validate(loader.Context)
diff --git a/openapi3/swagger_loader_recursive_ref_test.go b/openapi3/loader_recursive_ref_test.go
similarity index 81%
rename from openapi3/swagger_loader_recursive_ref_test.go
rename to openapi3/loader_recursive_ref_test.go
index 45842d8..bc1f24b 100644
--- a/openapi3/swagger_loader_recursive_ref_test.go
+++ b/openapi3/loader_recursive_ref_test.go
@@ -7,9 +7,9 @@ import (
 )
 
 func TestLoaderSupportsRecursiveReference(t *testing.T) {
-	loader := NewSwaggerLoader()
+	loader := NewLoader()
 	loader.IsExternalRefsAllowed = true
-	doc, err := loader.LoadSwaggerFromFile("testdata/recursiveRef/openapi.yml")
+	doc, err := loader.LoadFromFile("testdata/recursiveRef/openapi.yml")
 	require.NoError(t, err)
 	require.NotNil(t, doc)
 	require.NoError(t, doc.Validate(loader.Context))
diff --git a/openapi3/swagger_loader_relative_refs_test.go b/openapi3/loader_relative_refs_test.go
similarity index 71%
rename from openapi3/swagger_loader_relative_refs_test.go
rename to openapi3/loader_relative_refs_test.go
index cb5ab3f..50d2c7d 100644
--- a/openapi3/swagger_loader_relative_refs_test.go
+++ b/openapi3/loader_relative_refs_test.go
@@ -11,120 +11,120 @@ import (
 type refTestDataEntry struct {
 	name            string
 	contentTemplate string
-	testFunc        func(t *testing.T, swagger *Swagger)
+	testFunc        func(t *testing.T, doc *T)
 }
 
 type refTestDataEntryWithErrorMessage struct {
 	name            string
 	contentTemplate string
 	errorMessage    *string
-	testFunc        func(t *testing.T, swagger *Swagger)
+	testFunc        func(t *testing.T, doc *T)
 }
 
 var refTestDataEntries = []refTestDataEntry{
 	{
 		name:            "SchemaRef",
 		contentTemplate: externalSchemaRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Components.Schemas["TestSchema"].Value.Type)
-			require.Equal(t, "string", swagger.Components.Schemas["TestSchema"].Value.Type)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Components.Schemas["TestSchema"].Value.Type)
+			require.Equal(t, "string", doc.Components.Schemas["TestSchema"].Value.Type)
 		},
 	},
 	{
 		name:            "ResponseRef",
 		contentTemplate: externalResponseRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
+		testFunc: func(t *testing.T, doc *T) {
 			desc := "description"
-			require.Equal(t, &desc, swagger.Components.Responses["TestResponse"].Value.Description)
+			require.Equal(t, &desc, doc.Components.Responses["TestResponse"].Value.Description)
 		},
 	},
 	{
 		name:            "ParameterRef",
 		contentTemplate: externalParameterRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Components.Parameters["TestParameter"].Value.Name)
-			require.Equal(t, "id", swagger.Components.Parameters["TestParameter"].Value.Name)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Components.Parameters["TestParameter"].Value.Name)
+			require.Equal(t, "id", doc.Components.Parameters["TestParameter"].Value.Name)
 		},
 	},
 	{
 		name:            "ExampleRef",
 		contentTemplate: externalExampleRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Components.Examples["TestExample"].Value.Description)
-			require.Equal(t, "description", swagger.Components.Examples["TestExample"].Value.Description)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Components.Examples["TestExample"].Value.Description)
+			require.Equal(t, "description", doc.Components.Examples["TestExample"].Value.Description)
 		},
 	},
 	{
 		name:            "RequestBodyRef",
 		contentTemplate: externalRequestBodyRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Components.RequestBodies["TestRequestBody"].Value.Content)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Components.RequestBodies["TestRequestBody"].Value.Content)
 		},
 	},
 	{
 		name:            "SecuritySchemeRef",
 		contentTemplate: externalSecuritySchemeRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Components.SecuritySchemes["TestSecurityScheme"].Value.Description)
-			require.Equal(t, "description", swagger.Components.SecuritySchemes["TestSecurityScheme"].Value.Description)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Components.SecuritySchemes["TestSecurityScheme"].Value.Description)
+			require.Equal(t, "description", doc.Components.SecuritySchemes["TestSecurityScheme"].Value.Description)
 		},
 	},
 	{
 		name:            "ExternalHeaderRef",
 		contentTemplate: externalHeaderRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Components.Headers["TestHeader"].Value.Description)
-			require.Equal(t, "description", swagger.Components.Headers["TestHeader"].Value.Description)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Components.Headers["TestHeader"].Value.Description)
+			require.Equal(t, "description", doc.Components.Headers["TestHeader"].Value.Description)
 		},
 	},
 	{
 		name:            "PathParameterRef",
 		contentTemplate: externalPathParameterRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Paths["/test/{id}"].Parameters[0].Value.Name)
-			require.Equal(t, "id", swagger.Paths["/test/{id}"].Parameters[0].Value.Name)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Paths["/test/{id}"].Parameters[0].Value.Name)
+			require.Equal(t, "id", doc.Paths["/test/{id}"].Parameters[0].Value.Name)
 		},
 	},
 	{
 		name:            "PathOperationParameterRef",
 		contentTemplate: externalPathOperationParameterRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Paths["/test/{id}"].Get.Parameters[0].Value)
-			require.Equal(t, "id", swagger.Paths["/test/{id}"].Get.Parameters[0].Value.Name)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Paths["/test/{id}"].Get.Parameters[0].Value)
+			require.Equal(t, "id", doc.Paths["/test/{id}"].Get.Parameters[0].Value.Name)
 		},
 	},
 	{
 		name:            "PathOperationRequestBodyRef",
 		contentTemplate: externalPathOperationRequestBodyRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Paths["/test"].Post.RequestBody.Value)
-			require.NotNil(t, swagger.Paths["/test"].Post.RequestBody.Value.Content)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Paths["/test"].Post.RequestBody.Value)
+			require.NotNil(t, doc.Paths["/test"].Post.RequestBody.Value.Content)
 		},
 	},
 	{
 		name:            "PathOperationResponseRef",
 		contentTemplate: externalPathOperationResponseRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Paths["/test"].Post.Responses["default"].Value)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Paths["/test"].Post.Responses["default"].Value)
 			desc := "description"
-			require.Equal(t, &desc, swagger.Paths["/test"].Post.Responses["default"].Value.Description)
+			require.Equal(t, &desc, doc.Paths["/test"].Post.Responses["default"].Value.Description)
 		},
 	},
 	{
 		name:            "PathOperationParameterSchemaRef",
 		contentTemplate: externalPathOperationParameterSchemaRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Paths["/test/{id}"].Get.Parameters[0].Value.Schema.Value)
-			require.Equal(t, "string", swagger.Paths["/test/{id}"].Get.Parameters[0].Value.Schema.Value.Type)
-			require.Equal(t, "id", swagger.Paths["/test/{id}"].Get.Parameters[0].Value.Name)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Paths["/test/{id}"].Get.Parameters[0].Value.Schema.Value)
+			require.Equal(t, "string", doc.Paths["/test/{id}"].Get.Parameters[0].Value.Schema.Value.Type)
+			require.Equal(t, "id", doc.Paths["/test/{id}"].Get.Parameters[0].Value.Name)
 		},
 	},
 
 	{
 		name:            "PathOperationParameterRefWithContentInQuery",
 		contentTemplate: externalPathOperationParameterWithContentInQueryTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			schemaRef := swagger.Paths["/test/{id}"].Get.Parameters[0].Value.Content["application/json"].Schema
+		testFunc: func(t *testing.T, doc *T) {
+			schemaRef := doc.Paths["/test/{id}"].Get.Parameters[0].Value.Content["application/json"].Schema
 			require.NotNil(t, schemaRef.Value)
 			require.Equal(t, "string", schemaRef.Value.Type)
 		},
@@ -133,53 +133,53 @@ var refTestDataEntries = []refTestDataEntry{
 	{
 		name:            "PathOperationRequestBodyExampleRef",
 		contentTemplate: externalPathOperationRequestBodyExampleRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Paths["/test"].Post.RequestBody.Value.Content["application/json"].Examples["application/json"].Value)
-			require.Equal(t, "description", swagger.Paths["/test"].Post.RequestBody.Value.Content["application/json"].Examples["application/json"].Value.Description)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Paths["/test"].Post.RequestBody.Value.Content["application/json"].Examples["application/json"].Value)
+			require.Equal(t, "description", doc.Paths["/test"].Post.RequestBody.Value.Content["application/json"].Examples["application/json"].Value.Description)
 		},
 	},
 	{
 		name:            "PathOperationReqestBodyContentSchemaRef",
 		contentTemplate: externalPathOperationReqestBodyContentSchemaRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Paths["/test"].Post.RequestBody.Value.Content["application/json"].Schema.Value)
-			require.Equal(t, "string", swagger.Paths["/test"].Post.RequestBody.Value.Content["application/json"].Schema.Value.Type)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Paths["/test"].Post.RequestBody.Value.Content["application/json"].Schema.Value)
+			require.Equal(t, "string", doc.Paths["/test"].Post.RequestBody.Value.Content["application/json"].Schema.Value.Type)
 		},
 	},
 	{
 		name:            "PathOperationResponseExampleRef",
 		contentTemplate: externalPathOperationResponseExampleRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Paths["/test"].Post.Responses["default"].Value)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Paths["/test"].Post.Responses["default"].Value)
 			desc := "testdescription"
-			require.Equal(t, &desc, swagger.Paths["/test"].Post.Responses["default"].Value.Description)
-			require.Equal(t, "description", swagger.Paths["/test"].Post.Responses["default"].Value.Content["application/json"].Examples["application/json"].Value.Description)
+			require.Equal(t, &desc, doc.Paths["/test"].Post.Responses["default"].Value.Description)
+			require.Equal(t, "description", doc.Paths["/test"].Post.Responses["default"].Value.Content["application/json"].Examples["application/json"].Value.Description)
 		},
 	},
 	{
 		name:            "PathOperationResponseSchemaRef",
 		contentTemplate: externalPathOperationResponseSchemaRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Paths["/test"].Post.Responses["default"].Value)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Paths["/test"].Post.Responses["default"].Value)
 			desc := "testdescription"
-			require.Equal(t, &desc, swagger.Paths["/test"].Post.Responses["default"].Value.Description)
-			require.Equal(t, "string", swagger.Paths["/test"].Post.Responses["default"].Value.Content["application/json"].Schema.Value.Type)
+			require.Equal(t, &desc, doc.Paths["/test"].Post.Responses["default"].Value.Description)
+			require.Equal(t, "string", doc.Paths["/test"].Post.Responses["default"].Value.Content["application/json"].Schema.Value.Type)
 		},
 	},
 	{
 		name:            "ComponentHeaderSchemaRef",
 		contentTemplate: externalComponentHeaderSchemaRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Components.Headers["TestHeader"].Value)
-			require.Equal(t, "string", swagger.Components.Headers["TestHeader"].Value.Schema.Value.Type)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Components.Headers["TestHeader"].Value)
+			require.Equal(t, "string", doc.Components.Headers["TestHeader"].Value.Schema.Value.Type)
 		},
 	},
 	{
 		name:            "RequestResponseHeaderRef",
 		contentTemplate: externalRequestResponseHeaderRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Paths["/test"].Post.Responses["default"].Value.Headers["X-TEST-HEADER"].Value.Description)
-			require.Equal(t, "description", swagger.Paths["/test"].Post.Responses["default"].Value.Headers["X-TEST-HEADER"].Value.Description)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Paths["/test"].Post.Responses["default"].Value.Headers["X-TEST-HEADER"].Value.Description)
+			require.Equal(t, "description", doc.Paths["/test"].Post.Responses["default"].Value.Headers["X-TEST-HEADER"].Value.Description)
 		},
 	},
 }
@@ -189,7 +189,7 @@ var refTestDataEntriesResponseError = []refTestDataEntryWithErrorMessage{
 		name:            "CannotContainBothSchemaAndContentInAParameter",
 		contentTemplate: externalCannotContainBothSchemaAndContentInAParameter,
 		errorMessage:    &(&struct{ x string }{"cannot contain both schema and content in a parameter"}).x,
-		testFunc: func(t *testing.T, swagger *Swagger) {
+		testFunc: func(t *testing.T, doc *T) {
 		},
 	},
 }
@@ -199,11 +199,11 @@ func TestLoadFromDataWithExternalRef(t *testing.T) {
 		t.Logf("testcase %q", td.name)
 
 		spec := []byte(fmt.Sprintf(td.contentTemplate, "components.openapi.json"))
-		loader := NewSwaggerLoader()
+		loader := NewLoader()
 		loader.IsExternalRefsAllowed = true
-		swagger, err := loader.LoadSwaggerFromDataWithPath(spec, &url.URL{Path: "testdata/testfilename.openapi.json"})
+		doc, err := loader.LoadFromDataWithPath(spec, &url.URL{Path: "testdata/testfilename.openapi.json"})
 		require.NoError(t, err)
-		td.testFunc(t, swagger)
+		td.testFunc(t, doc)
 	}
 }
 
@@ -212,11 +212,11 @@ func TestLoadFromDataWithExternalRefResponseError(t *testing.T) {
 		t.Logf("testcase %q", td.name)
 
 		spec := []byte(fmt.Sprintf(td.contentTemplate, "components.openapi.json"))
-		loader := NewSwaggerLoader()
+		loader := NewLoader()
 		loader.IsExternalRefsAllowed = true
-		swagger, err := loader.LoadSwaggerFromDataWithPath(spec, &url.URL{Path: "testdata/testfilename.openapi.json"})
+		doc, err := loader.LoadFromDataWithPath(spec, &url.URL{Path: "testdata/testfilename.openapi.json"})
 		require.EqualError(t, err, *td.errorMessage)
-		td.testFunc(t, swagger)
+		td.testFunc(t, doc)
 	}
 }
 
@@ -225,11 +225,11 @@ func TestLoadFromDataWithExternalNestedRef(t *testing.T) {
 		t.Logf("testcase %q", td.name)
 
 		spec := []byte(fmt.Sprintf(td.contentTemplate, "nesteddir/nestedcomponents.openapi.json"))
-		loader := NewSwaggerLoader()
+		loader := NewLoader()
 		loader.IsExternalRefsAllowed = true
-		swagger, err := loader.LoadSwaggerFromDataWithPath(spec, &url.URL{Path: "testdata/testfilename.openapi.json"})
+		doc, err := loader.LoadFromDataWithPath(spec, &url.URL{Path: "testdata/testfilename.openapi.json"})
 		require.NoError(t, err)
-		td.testFunc(t, swagger)
+		td.testFunc(t, doc)
 	}
 }
 
@@ -723,78 +723,78 @@ var relativeDocRefsTestDataEntries = []refTestDataEntry{
 	{
 		name:            "SchemaRef",
 		contentTemplate: relativeSchemaDocsRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Components.Schemas["TestSchema"].Value.Type)
-			require.Equal(t, "string", swagger.Components.Schemas["TestSchema"].Value.Type)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Components.Schemas["TestSchema"].Value.Type)
+			require.Equal(t, "string", doc.Components.Schemas["TestSchema"].Value.Type)
 		},
 	},
 	{
 		name:            "ResponseRef",
 		contentTemplate: relativeResponseDocsRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
+		testFunc: func(t *testing.T, doc *T) {
 			desc := "description"
-			require.Equal(t, &desc, swagger.Components.Responses["TestResponse"].Value.Description)
+			require.Equal(t, &desc, doc.Components.Responses["TestResponse"].Value.Description)
 		},
 	},
 	{
 		name:            "ParameterRef",
 		contentTemplate: relativeParameterDocsRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Components.Parameters["TestParameter"].Value.Name)
-			require.Equal(t, "param", swagger.Components.Parameters["TestParameter"].Value.Name)
-			require.Equal(t, true, swagger.Components.Parameters["TestParameter"].Value.Required)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Components.Parameters["TestParameter"].Value.Name)
+			require.Equal(t, "param", doc.Components.Parameters["TestParameter"].Value.Name)
+			require.Equal(t, true, doc.Components.Parameters["TestParameter"].Value.Required)
 		},
 	},
 	{
 		name:            "ExampleRef",
 		contentTemplate: relativeExampleDocsRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, "param", swagger.Components.Examples["TestExample"].Value.Summary)
-			require.NotNil(t, "param", swagger.Components.Examples["TestExample"].Value.Value)
-			require.Equal(t, "An example", swagger.Components.Examples["TestExample"].Value.Summary)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, "param", doc.Components.Examples["TestExample"].Value.Summary)
+			require.NotNil(t, "param", doc.Components.Examples["TestExample"].Value.Value)
+			require.Equal(t, "An example", doc.Components.Examples["TestExample"].Value.Summary)
 		},
 	},
 	{
 		name:            "RequestRef",
 		contentTemplate: relativeRequestDocsRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, "param", swagger.Components.RequestBodies["TestRequestBody"].Value.Description)
-			require.Equal(t, "example request", swagger.Components.RequestBodies["TestRequestBody"].Value.Description)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, "param", doc.Components.RequestBodies["TestRequestBody"].Value.Description)
+			require.Equal(t, "example request", doc.Components.RequestBodies["TestRequestBody"].Value.Description)
 		},
 	},
 	{
 		name:            "HeaderRef",
 		contentTemplate: relativeHeaderDocsRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, "param", swagger.Components.Headers["TestHeader"].Value.Description)
-			require.Equal(t, "description", swagger.Components.Headers["TestHeader"].Value.Description)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, "param", doc.Components.Headers["TestHeader"].Value.Description)
+			require.Equal(t, "description", doc.Components.Headers["TestHeader"].Value.Description)
 		},
 	},
 	{
 		name:            "HeaderRef",
 		contentTemplate: relativeHeaderDocsRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, "param", swagger.Components.Headers["TestHeader"].Value.Description)
-			require.Equal(t, "description", swagger.Components.Headers["TestHeader"].Value.Description)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, "param", doc.Components.Headers["TestHeader"].Value.Description)
+			require.Equal(t, "description", doc.Components.Headers["TestHeader"].Value.Description)
 		},
 	},
 	{
 		name:            "SecuritySchemeRef",
 		contentTemplate: relativeSecuritySchemeDocsRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Components.SecuritySchemes["TestSecurityScheme"].Value.Type)
-			require.NotNil(t, swagger.Components.SecuritySchemes["TestSecurityScheme"].Value.Scheme)
-			require.Equal(t, "http", swagger.Components.SecuritySchemes["TestSecurityScheme"].Value.Type)
-			require.Equal(t, "basic", swagger.Components.SecuritySchemes["TestSecurityScheme"].Value.Scheme)
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Components.SecuritySchemes["TestSecurityScheme"].Value.Type)
+			require.NotNil(t, doc.Components.SecuritySchemes["TestSecurityScheme"].Value.Scheme)
+			require.Equal(t, "http", doc.Components.SecuritySchemes["TestSecurityScheme"].Value.Type)
+			require.Equal(t, "basic", doc.Components.SecuritySchemes["TestSecurityScheme"].Value.Scheme)
 		},
 	},
 	{
 		name:            "PathRef",
 		contentTemplate: relativePathDocsRefTemplate,
-		testFunc: func(t *testing.T, swagger *Swagger) {
-			require.NotNil(t, swagger.Paths["/pets"])
-			require.NotNil(t, swagger.Paths["/pets"].Get.Responses["200"])
-			require.NotNil(t, swagger.Paths["/pets"].Get.Responses["200"].Value.Content["application/json"])
+		testFunc: func(t *testing.T, doc *T) {
+			require.NotNil(t, doc.Paths["/pets"])
+			require.NotNil(t, doc.Paths["/pets"].Get.Responses["200"])
+			require.NotNil(t, doc.Paths["/pets"].Get.Responses["200"].Value.Content["application/json"])
 		},
 	},
 }
@@ -804,11 +804,11 @@ func TestLoadSpecWithRelativeDocumentRefs(t *testing.T) {
 		t.Logf("testcase %q", td.name)
 
 		spec := []byte(td.contentTemplate)
-		loader := NewSwaggerLoader()
+		loader := NewLoader()
 		loader.IsExternalRefsAllowed = true
-		swagger, err := loader.LoadSwaggerFromDataWithPath(spec, &url.URL{Path: "testdata/"})
+		doc, err := loader.LoadFromDataWithPath(spec, &url.URL{Path: "testdata/"})
 		require.NoError(t, err)
-		td.testFunc(t, swagger)
+		td.testFunc(t, doc)
 	}
 }
 
@@ -906,15 +906,15 @@ paths:
 `
 
 func TestLoadSpecWithRelativeDocumentRefs2(t *testing.T) {
-	loader := NewSwaggerLoader()
+	loader := NewLoader()
 	loader.IsExternalRefsAllowed = true
-	swagger, err := loader.LoadSwaggerFromFile("testdata/relativeDocsUseDocumentPath/openapi/openapi.yml")
+	doc, err := loader.LoadFromFile("testdata/relativeDocsUseDocumentPath/openapi/openapi.yml")
 
 	require.NoError(t, err)
 
 	// path in nested directory
 	// check parameter
-	nestedDirPath := swagger.Paths["/pets/{id}"]
+	nestedDirPath := doc.Paths["/pets/{id}"]
 	require.Equal(t, "param", nestedDirPath.Patch.Parameters[0].Value.Name)
 	require.Equal(t, "path", nestedDirPath.Patch.Parameters[0].Value.In)
 	require.Equal(t, true, nestedDirPath.Patch.Parameters[0].Value.Required)
@@ -934,7 +934,7 @@ func TestLoadSpecWithRelativeDocumentRefs2(t *testing.T) {
 
 	// path in more nested directory
 	// check parameter
-	moreNestedDirPath := swagger.Paths["/pets/{id}/{city}"]
+	moreNestedDirPath := doc.Paths["/pets/{id}/{city}"]
 	require.Equal(t, "param", moreNestedDirPath.Patch.Parameters[0].Value.Name)
 	require.Equal(t, "path", moreNestedDirPath.Patch.Parameters[0].Value.In)
 	require.Equal(t, true, moreNestedDirPath.Patch.Parameters[0].Value.Required)
diff --git a/openapi3/swagger_loader_test.go b/openapi3/loader_test.go
similarity index 77%
rename from openapi3/swagger_loader_test.go
rename to openapi3/loader_test.go
index 0662f16..4bc4ce4 100644
--- a/openapi3/swagger_loader_test.go
+++ b/openapi3/loader_test.go
@@ -55,8 +55,8 @@ paths:
                 $ref: '#/components/schemas/ErrorModel'
 `)
 
-	loader := NewSwaggerLoader()
-	doc, err := loader.LoadSwaggerFromData(spec)
+	loader := NewLoader()
+	doc, err := loader.LoadFromData(spec)
 	require.NoError(t, err)
 	require.Equal(t, "An API", doc.Info.Title)
 	require.Equal(t, 2, len(doc.Components.Schemas))
@@ -68,20 +68,20 @@ paths:
 	require.NoError(t, err)
 }
 
-func ExampleSwaggerLoader() {
+func ExampleLoader() {
 	const source = `{"info":{"description":"An API"}}`
-	swagger, err := NewSwaggerLoader().LoadSwaggerFromData([]byte(source))
+	doc, err := NewLoader().LoadFromData([]byte(source))
 	if err != nil {
 		panic(err)
 	}
-	fmt.Print(swagger.Info.Description)
+	fmt.Print(doc.Info.Description)
 	// Output: An API
 }
 
 func TestResolveSchemaRef(t *testing.T) {
 	source := []byte(`{"openapi":"3.0.0","info":{"title":"MyAPI","version":"0.1",description":"An API"},"paths":{},"components":{"schemas":{"B":{"type":"string"},"A":{"allOf":[{"$ref":"#/components/schemas/B"}]}}}}`)
-	loader := NewSwaggerLoader()
-	doc, err := loader.LoadSwaggerFromData(source)
+	loader := NewLoader()
+	doc, err := loader.LoadFromData(source)
 	require.NoError(t, err)
 	err = doc.Validate(loader.Context)
 	require.NoError(t, err)
@@ -93,8 +93,8 @@ func TestResolveSchemaRef(t *testing.T) {
 
 func TestResolveSchemaRefWithNullSchemaRef(t *testing.T) {
 	source := []byte(`{"openapi":"3.0.0","info":{"title":"MyAPI","version":"0.1","description":"An API"},"paths":{"/foo":{"post":{"requestBody":{"content":{"application/json":{"schema":null}}}}}}}`)
-	loader := NewSwaggerLoader()
-	doc, err := loader.LoadSwaggerFromData(source)
+	loader := NewLoader()
+	doc, err := loader.LoadFromData(source)
 	require.NoError(t, err)
 	err = doc.Validate(loader.Context)
 	require.EqualError(t, err, `invalid paths: found unresolved ref: ""`)
@@ -122,8 +122,8 @@ paths:
               examples:
                 test:
                   $ref: '#/components/examples/test'`)
-	loader := NewSwaggerLoader()
-	doc, err := loader.LoadSwaggerFromData(source)
+	loader := NewLoader()
+	doc, err := loader.LoadFromData(source)
 	require.NoError(t, err)
 
 	err = doc.Validate(loader.Context)
@@ -160,8 +160,8 @@ paths:
                 $ref: '#/components/schemas/Thing'
 `)
 
-	loader := NewSwaggerLoader()
-	_, err := loader.LoadSwaggerFromData(spec)
+	loader := NewLoader()
+	_, err := loader.LoadFromData(spec)
 	require.Error(t, err)
 }
 
@@ -188,11 +188,11 @@ paths:
           description: Test call.
 `)
 
-	loader := NewSwaggerLoader()
-	swagger, err := loader.LoadSwaggerFromData(spec)
+	loader := NewLoader()
+	doc, err := loader.LoadFromData(spec)
 	require.NoError(t, err)
 
-	require.NotNil(t, swagger.Paths["/"].Parameters[0].Value)
+	require.NotNil(t, doc.Paths["/"].Parameters[0].Value)
 }
 
 func TestLoadRequestExampleRef(t *testing.T) {
@@ -220,11 +220,11 @@ paths:
           description: Test call.
 `)
 
-	loader := NewSwaggerLoader()
-	swagger, err := loader.LoadSwaggerFromData(spec)
+	loader := NewLoader()
+	doc, err := loader.LoadFromData(spec)
 	require.NoError(t, err)
 
-	require.NotNil(t, swagger.Paths["/"].Post.RequestBody.Value.Content.Get("application/json").Examples["test"])
+	require.NotNil(t, doc.Paths["/"].Post.RequestBody.Value.Content.Get("application/json").Examples["test"])
 }
 
 func createTestServer(handler http.Handler) *httptest.Server {
@@ -242,21 +242,21 @@ func TestLoadFromRemoteURL(t *testing.T) {
 	ts.Start()
 	defer ts.Close()
 
-	loader := NewSwaggerLoader()
+	loader := NewLoader()
 	loader.IsExternalRefsAllowed = true
 	url, err := url.Parse("http://" + addr + "/test.openapi.json")
 	require.NoError(t, err)
 
-	swagger, err := loader.LoadSwaggerFromURI(url)
+	doc, err := loader.LoadFromURI(url)
 	require.NoError(t, err)
 
-	require.Equal(t, "string", swagger.Components.Schemas["TestSchema"].Value.Type)
+	require.Equal(t, "string", doc.Components.Schemas["TestSchema"].Value.Type)
 }
 
 func TestLoadWithReferenceInReference(t *testing.T) {
-	loader := NewSwaggerLoader()
+	loader := NewLoader()
 	loader.IsExternalRefsAllowed = true
-	doc, err := loader.LoadSwaggerFromFile("testdata/refInRef/openapi.json")
+	doc, err := loader.LoadFromFile("testdata/refInRef/openapi.json")
 	require.NoError(t, err)
 	require.NotNil(t, doc)
 	err = doc.Validate(loader.Context)
@@ -265,22 +265,22 @@ func TestLoadWithReferenceInReference(t *testing.T) {
 }
 
 func TestLoadFileWithExternalSchemaRef(t *testing.T) {
-	loader := NewSwaggerLoader()
+	loader := NewLoader()
 	loader.IsExternalRefsAllowed = true
-	swagger, err := loader.LoadSwaggerFromFile("testdata/testref.openapi.json")
+	doc, err := loader.LoadFromFile("testdata/testref.openapi.json")
 	require.NoError(t, err)
-	require.NotNil(t, swagger.Components.Schemas["AnotherTestSchema"].Value.Type)
+	require.NotNil(t, doc.Components.Schemas["AnotherTestSchema"].Value.Type)
 }
 
 func TestLoadFileWithExternalSchemaRefSingleComponent(t *testing.T) {
-	loader := NewSwaggerLoader()
+	loader := NewLoader()
 	loader.IsExternalRefsAllowed = true
-	swagger, err := loader.LoadSwaggerFromFile("testdata/testrefsinglecomponent.openapi.json")
+	doc, err := loader.LoadFromFile("testdata/testrefsinglecomponent.openapi.json")
 	require.NoError(t, err)
 
-	require.NotNil(t, swagger.Components.Responses["SomeResponse"])
+	require.NotNil(t, doc.Components.Responses["SomeResponse"])
 	desc := "this is a single response definition"
-	require.Equal(t, &desc, swagger.Components.Responses["SomeResponse"].Value.Description)
+	require.Equal(t, &desc, doc.Components.Responses["SomeResponse"].Value.Description)
 }
 
 func TestLoadRequestResponseHeaderRef(t *testing.T) {
@@ -316,12 +316,12 @@ func TestLoadRequestResponseHeaderRef(t *testing.T) {
     }
 }`)
 
-	loader := NewSwaggerLoader()
-	swagger, err := loader.LoadSwaggerFromData(spec)
+	loader := NewLoader()
+	doc, err := loader.LoadFromData(spec)
 	require.NoError(t, err)
 
-	require.NotNil(t, swagger.Paths["/test"].Post.Responses["default"].Value.Headers["X-TEST-HEADER"].Value.Description)
-	require.Equal(t, "testheader", swagger.Paths["/test"].Post.Responses["default"].Value.Headers["X-TEST-HEADER"].Value.Description)
+	require.NotNil(t, doc.Paths["/test"].Post.Responses["default"].Value.Headers["X-TEST-HEADER"].Value.Description)
+	require.Equal(t, "testheader", doc.Paths["/test"].Post.Responses["default"].Value.Headers["X-TEST-HEADER"].Value.Description)
 }
 
 func TestLoadFromDataWithExternalRequestResponseHeaderRemoteRef(t *testing.T) {
@@ -355,41 +355,41 @@ func TestLoadFromDataWithExternalRequestResponseHeaderRemoteRef(t *testing.T) {
 	ts.Start()
 	defer ts.Close()
 
-	loader := NewSwaggerLoader()
+	loader := NewLoader()
 	loader.IsExternalRefsAllowed = true
-	swagger, err := loader.LoadSwaggerFromDataWithPath(spec, &url.URL{Path: "testdata/testfilename.openapi.json"})
+	doc, err := loader.LoadFromDataWithPath(spec, &url.URL{Path: "testdata/testfilename.openapi.json"})
 	require.NoError(t, err)
 
-	require.NotNil(t, swagger.Paths["/test"].Post.Responses["default"].Value.Headers["X-TEST-HEADER"].Value.Description)
-	require.Equal(t, "description", swagger.Paths["/test"].Post.Responses["default"].Value.Headers["X-TEST-HEADER"].Value.Description)
+	require.NotNil(t, doc.Paths["/test"].Post.Responses["default"].Value.Headers["X-TEST-HEADER"].Value.Description)
+	require.Equal(t, "description", doc.Paths["/test"].Post.Responses["default"].Value.Headers["X-TEST-HEADER"].Value.Description)
 }
 
 func TestLoadYamlFile(t *testing.T) {
-	loader := NewSwaggerLoader()
+	loader := NewLoader()
 	loader.IsExternalRefsAllowed = true
-	swagger, err := loader.LoadSwaggerFromFile("testdata/test.openapi.yml")
+	doc, err := loader.LoadFromFile("testdata/test.openapi.yml")
 	require.NoError(t, err)
 
-	require.Equal(t, "OAI Specification in YAML", swagger.Info.Title)
+	require.Equal(t, "OAI Specification in YAML", doc.Info.Title)
 }
 
 func TestLoadYamlFileWithExternalSchemaRef(t *testing.T) {
-	loader := NewSwaggerLoader()
+	loader := NewLoader()
 	loader.IsExternalRefsAllowed = true
-	swagger, err := loader.LoadSwaggerFromFile("testdata/testref.openapi.yml")
+	doc, err := loader.LoadFromFile("testdata/testref.openapi.yml")
 	require.NoError(t, err)
 
-	require.NotNil(t, swagger.Components.Schemas["AnotherTestSchema"].Value.Type)
+	require.NotNil(t, doc.Components.Schemas["AnotherTestSchema"].Value.Type)
 }
 
 func TestLoadYamlFileWithExternalPathRef(t *testing.T) {
-	loader := NewSwaggerLoader()
+	loader := NewLoader()
 	loader.IsExternalRefsAllowed = true
-	swagger, err := loader.LoadSwaggerFromFile("testdata/pathref.openapi.yml")
+	doc, err := loader.LoadFromFile("testdata/pathref.openapi.yml")
 	require.NoError(t, err)
 
-	require.NotNil(t, swagger.Paths["/test"].Get.Responses["200"].Value.Content["application/json"].Schema.Value.Type)
-	require.Equal(t, "string", swagger.Paths["/test"].Get.Responses["200"].Value.Content["application/json"].Schema.Value.Type)
+	require.NotNil(t, doc.Paths["/test"].Get.Responses["200"].Value.Content["application/json"].Schema.Value.Type)
+	require.Equal(t, "string", doc.Paths["/test"].Get.Responses["200"].Value.Content["application/json"].Schema.Value.Type)
 }
 
 func TestResolveResponseLinkRef(t *testing.T) {
@@ -423,8 +423,8 @@ paths:
             father:
               $ref: '#/components/links/Father'
 `)
-	loader := NewSwaggerLoader()
-	doc, err := loader.LoadSwaggerFromData(source)
+	loader := NewLoader()
+	doc, err := loader.LoadFromData(source)
 	require.NoError(t, err)
 
 	err = doc.Validate(loader.Context)
@@ -492,8 +492,8 @@ paths:
                 $ref: '#/components/schemas/ErrorModel'
 `)
 
-	loader := NewSwaggerLoader()
-	doc, err := loader.LoadSwaggerFromData(spec)
+	loader := NewLoader()
+	doc, err := loader.LoadFromData(spec)
 	require.NoError(t, err)
 	err = doc.Validate(loader.Context)
 	require.NoError(t, err)
@@ -521,8 +521,8 @@ servers:
 		`{url: "http://{y}.example.com", variables: {x: {enum: ["www"]}}}`:                 errors.New("invalid servers: server has undeclared variables"),
 	} {
 		t.Run(value, func(t *testing.T) {
-			loader := NewSwaggerLoader()
-			doc, err := loader.LoadSwaggerFromData([]byte(strings.Replace(spec, "@@@", value, 1)))
+			loader := NewLoader()
+			doc, err := loader.LoadFromData([]byte(strings.Replace(spec, "@@@", value, 1)))
 			require.NoError(t, err)
 			err = doc.Validate(loader.Context)
 			require.Equal(t, expected, err)
diff --git a/openapi3/swagger_test.go b/openapi3/openapi3_test.go
similarity index 93%
rename from openapi3/swagger_test.go
rename to openapi3/openapi3_test.go
index ded2500..4c6bfe3 100644
--- a/openapi3/swagger_test.go
+++ b/openapi3/openapi3_test.go
@@ -11,28 +11,28 @@ import (
 )
 
 func TestRefsJSON(t *testing.T) {
-	loader := NewSwaggerLoader()
+	loader := NewLoader()
 
-	t.Log("Marshal *Swagger to JSON")
+	t.Log("Marshal *T to JSON")
 	data, err := json.Marshal(spec())
 	require.NoError(t, err)
 	require.NotEmpty(t, data)
 
-	t.Log("Unmarshal *Swagger from JSON")
-	docA := &Swagger{}
+	t.Log("Unmarshal *T from JSON")
+	docA := &T{}
 	err = json.Unmarshal(specJSON, &docA)
 	require.NoError(t, err)
 	require.NotEmpty(t, data)
 
-	t.Log("Resolve refs in unmarshalled *Swagger")
+	t.Log("Resolve refs in unmarshalled *T")
 	err = loader.ResolveRefsIn(docA, nil)
 	require.NoError(t, err)
-	t.Log("Resolve refs in marshalled *Swagger")
-	docB, err := loader.LoadSwaggerFromData(data)
+	t.Log("Resolve refs in marshalled *T")
+	docB, err := loader.LoadFromData(data)
 	require.NoError(t, err)
 	require.NotEmpty(t, docB)
 
-	t.Log("Validate *Swagger")
+	t.Log("Validate *T")
 	err = docA.Validate(loader.Context)
 	require.NoError(t, err)
 	err = docB.Validate(loader.Context)
@@ -49,28 +49,28 @@ func TestRefsJSON(t *testing.T) {
 }
 
 func TestRefsYAML(t *testing.T) {
-	loader := NewSwaggerLoader()
+	loader := NewLoader()
 
-	t.Log("Marshal *Swagger to YAML")
+	t.Log("Marshal *T to YAML")
 	data, err := yaml.Marshal(spec())
 	require.NoError(t, err)
 	require.NotEmpty(t, data)
 
-	t.Log("Unmarshal *Swagger from YAML")
-	docA := &Swagger{}
+	t.Log("Unmarshal *T from YAML")
+	docA := &T{}
 	err = yaml.Unmarshal(specYAML, &docA)
 	require.NoError(t, err)
 	require.NotEmpty(t, data)
 
-	t.Log("Resolve refs in unmarshalled *Swagger")
+	t.Log("Resolve refs in unmarshalled *T")
 	err = loader.ResolveRefsIn(docA, nil)
 	require.NoError(t, err)
-	t.Log("Resolve refs in marshalled *Swagger")
-	docB, err := loader.LoadSwaggerFromData(data)
+	t.Log("Resolve refs in marshalled *T")
+	docB, err := loader.LoadFromData(data)
 	require.NoError(t, err)
 	require.NotEmpty(t, docB)
 
-	t.Log("Validate *Swagger")
+	t.Log("Validate *T")
 	err = docA.Validate(loader.Context)
 	require.NoError(t, err)
 	err = docB.Validate(loader.Context)
@@ -237,7 +237,7 @@ var specJSON = []byte(`
 }
 `)
 
-func spec() *Swagger {
+func spec() *T {
 	parameter := &Parameter{
 		Description: "Some parameter",
 		Name:        "example",
@@ -257,7 +257,7 @@ func spec() *Swagger {
 		Description: "Some schema",
 	}
 	example := map[string]string{"name": "Some example"}
-	return &Swagger{
+	return &T{
 		OpenAPI: "3.0",
 		Info: &Info{
 			Title:   "MyAPI",
@@ -401,7 +401,7 @@ components:
 
 	for spec, expectedErr := range tests {
 		t.Run(expectedErr, func(t *testing.T) {
-			doc := &Swagger{}
+			doc := &T{}
 			err := yaml.Unmarshal([]byte(spec), &doc)
 			require.NoError(t, err)
 
diff --git a/openapi3/parameter_issue223_test.go b/openapi3/parameter_issue223_test.go
index ae1ddd2..336d42f 100644
--- a/openapi3/parameter_issue223_test.go
+++ b/openapi3/parameter_issue223_test.go
@@ -109,7 +109,7 @@ components:
           type: string
 `
 
-	doc, err := NewSwaggerLoader().LoadSwaggerFromData([]byte(spec))
+	doc, err := NewLoader().LoadFromData([]byte(spec))
 	require.NoError(t, err)
 	err = doc.Validate(context.Background())
 	require.EqualError(t, err, `invalid paths: operation GET /pets/{petId} must define exactly all path parameters`)
diff --git a/openapi3/paths_test.go b/openapi3/paths_test.go
index cc8d930..402288b 100644
--- a/openapi3/paths_test.go
+++ b/openapi3/paths_test.go
@@ -21,8 +21,8 @@ paths:
 `
 
 func TestPathValidate(t *testing.T) {
-	swagger, err := NewSwaggerLoader().LoadSwaggerFromData([]byte(emptyPathSpec))
+	doc, err := NewLoader().LoadFromData([]byte(emptyPathSpec))
 	require.NoError(t, err)
-	err = swagger.Paths.Validate(context.Background())
+	err = doc.Paths.Validate(context.Background())
 	require.NoError(t, err)
 }
diff --git a/openapi3/refs_test.go b/openapi3/refs_test.go
index 7de298c..e714da4 100644
--- a/openapi3/refs_test.go
+++ b/openapi3/refs_test.go
@@ -108,7 +108,7 @@ components:
           type: string
 `
 
-	_, err := NewSwaggerLoader().LoadSwaggerFromData([]byte(spec))
+	_, err := NewLoader().LoadFromData([]byte(spec))
 	require.EqualError(t, err, `invalid response: value MUST be an object`)
 }
 
@@ -213,7 +213,7 @@ components:
         - type: integer
           format: int32
   `
-	root, err := NewSwaggerLoader().LoadSwaggerFromData([]byte(spec))
+	root, err := NewLoader().LoadFromData([]byte(spec))
 	require.NoError(t, err)
 
 	ptr, err := jsonpointer.New("/paths/~1pet/put/responses/200/content")
diff --git a/openapi3/response_issue224_test.go b/openapi3/response_issue224_test.go
index 2a17580..b456d88 100644
--- a/openapi3/response_issue224_test.go
+++ b/openapi3/response_issue224_test.go
@@ -453,7 +453,7 @@ func TestEmptyResponsesAreInvalid(t *testing.T) {
 }
 `
 
-	doc, err := NewSwaggerLoader().LoadSwaggerFromData([]byte(spec))
+	doc, err := NewLoader().LoadFromData([]byte(spec))
 	require.NoError(t, err)
 	err = doc.Validate(context.Background())
 	require.EqualError(t, err, `invalid paths: the responses object MUST contain at least one response code`)
diff --git a/openapi3/schema_issue289_test.go b/openapi3/schema_issue289_test.go
index e4e4aad..6ab6b63 100644
--- a/openapi3/schema_issue289_test.go
+++ b/openapi3/schema_issue289_test.go
@@ -29,7 +29,7 @@ func TestIssue289(t *testing.T) {
 openapi: "3.0.1"
 `)
 
-	s, err := NewSwaggerLoader().LoadSwaggerFromData(spec)
+	s, err := NewLoader().LoadFromData(spec)
 	require.NoError(t, err)
 	err = s.Components.Schemas["Server"].Value.VisitJSON(map[string]interface{}{
 		"name":    "kin-openapi",
diff --git a/openapi3/schema_test.go b/openapi3/schema_test.go
index 91747d8..f621ca7 100644
--- a/openapi3/schema_test.go
+++ b/openapi3/schema_test.go
@@ -1211,7 +1211,7 @@ components:
 		"name":      "kin-openapi",
 		"ownerName": true,
 	}
-	s, err := NewSwaggerLoader().LoadSwaggerFromData([]byte(api))
+	s, err := NewLoader().LoadFromData([]byte(api))
 	require.NoError(t, err)
 	require.NotNil(t, s)
 	err = s.Components.Schemas["Test"].Value.VisitJSON(data)
diff --git a/openapi3/testdata/load_with_go_embed_test.go b/openapi3/testdata/load_with_go_embed_test.go
index ffcf35f..9cdace5 100644
--- a/openapi3/testdata/load_with_go_embed_test.go
+++ b/openapi3/testdata/load_with_go_embed_test.go
@@ -14,13 +14,13 @@ import (
 var fs embed.FS
 
 func Example() {
-	loader := openapi3.NewSwaggerLoader()
+	loader := openapi3.NewLoader()
 	loader.IsExternalRefsAllowed = true
-	loader.ReadFromURIFunc = func(loader *openapi3.SwaggerLoader, uri *url.URL) ([]byte, error) {
+	loader.ReadFromURIFunc = func(loader *openapi3.Loader, uri *url.URL) ([]byte, error) {
 		return fs.ReadFile(uri.Path)
 	}
 
-	doc, err := loader.LoadSwaggerFromFile("recursiveRef/openapi.yml")
+	doc, err := loader.LoadFromFile("recursiveRef/openapi.yml")
 	if err != nil {
 		panic(err)
 	}
diff --git a/openapi3filter/req_resp_decoder_test.go b/openapi3filter/req_resp_decoder_test.go
index c461da9..397c9e9 100644
--- a/openapi3filter/req_resp_decoder_test.go
+++ b/openapi3filter/req_resp_decoder_test.go
@@ -914,7 +914,7 @@ func TestDecodeParameter(t *testing.T) {
 						Title:   "MyAPI",
 						Version: "0.1",
 					}
-					spec := &openapi3.Swagger{OpenAPI: "3.0.0", Info: info}
+					spec := &openapi3.T{OpenAPI: "3.0.0", Info: info}
 					op := &openapi3.Operation{
 						OperationID: "test",
 						Parameters:  []*openapi3.ParameterRef{{Value: tc.param}},
diff --git a/openapi3filter/validate_readonly_test.go b/openapi3filter/validate_readonly_test.go
index cefadf7..454a927 100644
--- a/openapi3filter/validate_readonly_test.go
+++ b/openapi3filter/validate_readonly_test.go
@@ -65,8 +65,8 @@ func TestValidatingRequestBodyWithReadOnlyProperty(t *testing.T) {
 		ID string `json:"_id"`
 	}
 
-	sl := openapi3.NewSwaggerLoader()
-	doc, err := sl.LoadSwaggerFromData([]byte(spec))
+	sl := openapi3.NewLoader()
+	doc, err := sl.LoadFromData([]byte(spec))
 	require.NoError(t, err)
 	err = doc.Validate(sl.Context)
 	require.NoError(t, err)
diff --git a/openapi3filter/validate_request_test.go b/openapi3filter/validate_request_test.go
index 2c1c0b5..60e3f2e 100644
--- a/openapi3filter/validate_request_test.go
+++ b/openapi3filter/validate_request_test.go
@@ -64,8 +64,8 @@ components:
 `
 
 func Example() {
-	loader := openapi3.NewSwaggerLoader()
-	doc, err := loader.LoadSwaggerFromData([]byte(spec))
+	loader := openapi3.NewLoader()
+	doc, err := loader.LoadFromData([]byte(spec))
 	if err != nil {
 		panic(err)
 	}
diff --git a/openapi3filter/validation_discriminator_test.go b/openapi3filter/validation_discriminator_test.go
index a3eb8a8..c7d6144 100644
--- a/openapi3filter/validation_discriminator_test.go
+++ b/openapi3filter/validation_discriminator_test.go
@@ -75,8 +75,8 @@ components:
             type: integer
 `
 
-	loader := openapi3.NewSwaggerLoader()
-	doc, err := loader.LoadSwaggerFromData([]byte(spec))
+	loader := openapi3.NewLoader()
+	doc, err := loader.LoadFromData([]byte(spec))
 	require.NoError(t, err)
 
 	router, err := legacyrouter.NewRouter(doc)
diff --git a/openapi3filter/validation_error_test.go b/openapi3filter/validation_error_test.go
index d03fb7d..d539c3f 100644
--- a/openapi3filter/validation_error_test.go
+++ b/openapi3filter/validation_error_test.go
@@ -28,7 +28,7 @@ func newPetstoreRequest(t *testing.T, method, path string, body io.Reader) *http
 
 type validationFields struct {
 	Handler      http.Handler
-	SwaggerFile  string
+	File         string
 	ErrorEncoder ErrorEncoder
 }
 type validationArgs struct {
@@ -543,12 +543,12 @@ func TestValidationErrorEncoder(t *testing.T) {
 }
 
 func buildValidationHandler(tt *validationTest) (*ValidationHandler, error) {
-	if tt.fields.SwaggerFile == "" {
-		tt.fields.SwaggerFile = "fixtures/petstore.json"
+	if tt.fields.File == "" {
+		tt.fields.File = "fixtures/petstore.json"
 	}
 	h := &ValidationHandler{
 		Handler:      tt.fields.Handler,
-		SwaggerFile:  tt.fields.SwaggerFile,
+		File:         tt.fields.File,
 		ErrorEncoder: tt.fields.ErrorEncoder,
 	}
 	tt.wantErr = tt.wantErr ||
@@ -588,7 +588,7 @@ func runTest_ServeHTTP(t *testing.T, handler http.Handler, encoder ErrorEncoder,
 	h := &ValidationHandler{
 		Handler:      handler,
 		ErrorEncoder: encoder,
-		SwaggerFile:  "fixtures/petstore.json",
+		File:         "fixtures/petstore.json",
 	}
 	err := h.Load()
 	require.NoError(t, err)
@@ -600,7 +600,7 @@ func runTest_ServeHTTP(t *testing.T, handler http.Handler, encoder ErrorEncoder,
 func runTest_Middleware(t *testing.T, handler http.Handler, encoder ErrorEncoder, req *http.Request) *http.Response {
 	h := &ValidationHandler{
 		ErrorEncoder: encoder,
-		SwaggerFile:  "fixtures/petstore.json",
+		File:         "fixtures/petstore.json",
 	}
 	err := h.Load()
 	require.NoError(t, err)
diff --git a/openapi3filter/validation_test.go b/openapi3filter/validation_test.go
index 9db7674..d4d0a12 100644
--- a/openapi3filter/validation_test.go
+++ b/openapi3filter/validation_test.go
@@ -45,7 +45,7 @@ func TestFilter(t *testing.T) {
 	complexArgSchema.Required = []string{"name", "id"}
 
 	// Declare router
-	doc := &openapi3.Swagger{
+	doc := &openapi3.T{
 		OpenAPI: "3.0.0",
 		Info: &openapi3.Info{
 			Title:   "MyAPI",
@@ -528,7 +528,7 @@ func TestRootSecurityRequirementsAreUsedIfNotProvidedAtTheOperationLevel(t *test
 		},
 	}
 
-	doc := &openapi3.Swagger{
+	doc := &openapi3.T{
 		OpenAPI: "3.0.0",
 		Info: &openapi3.Info{
 			Title:   "MyAPI",
@@ -596,7 +596,7 @@ func TestRootSecurityRequirementsAreUsedIfNotProvidedAtTheOperationLevel(t *test
 			Request: httpReq,
 			Route:   route,
 			Options: &Options{
-				AuthenticationFunc: func(c context.Context, input *AuthenticationInput) error {
+				AuthenticationFunc: func(ctx context.Context, input *AuthenticationInput) error {
 					if schemesValidated != nil {
 						if validated, ok := (*schemesValidated)[input.SecurityScheme]; ok {
 							if validated {
@@ -662,7 +662,7 @@ func TestAnySecurityRequirementMet(t *testing.T) {
 		},
 	}
 
-	doc := openapi3.Swagger{
+	doc := openapi3.T{
 		OpenAPI: "3.0.0",
 		Info: &openapi3.Info{
 			Title:   "MyAPI",
@@ -759,7 +759,7 @@ func TestAllSchemesMet(t *testing.T) {
 		},
 	}
 
-	doc := openapi3.Swagger{
+	doc := openapi3.T{
 		OpenAPI: "3.0.0",
 		Info: &openapi3.Info{
 			Title:   "MyAPI",
@@ -840,8 +840,8 @@ func TestAllSchemesMet(t *testing.T) {
 // makeAuthFunc creates an authentication function that accepts the given valid schemes.
 // If an invalid or unknown scheme is encountered, an error is returned by the returned function.
 // Otherwise the return value of the returned function is nil.
-func makeAuthFunc(schemes map[string]bool) func(c context.Context, input *AuthenticationInput) error {
-	return func(c context.Context, input *AuthenticationInput) error {
+func makeAuthFunc(schemes map[string]bool) func(ctx context.Context, input *AuthenticationInput) error {
+	return func(ctx context.Context, input *AuthenticationInput) error {
 		// If the scheme is valid and present in the schemes
 		valid, present := schemes[input.SecuritySchemeName]
 		if valid && present {
diff --git a/routers/gorillamux/router_test.go b/routers/gorillamux/router_test.go
index 1a3d112..d9ad2c9 100644
--- a/routers/gorillamux/router_test.go
+++ b/routers/gorillamux/router_test.go
@@ -24,7 +24,7 @@ func TestRouter(t *testing.T) {
 	paramsGET := &openapi3.Operation{Responses: openapi3.NewResponses()}
 	booksPOST := &openapi3.Operation{Responses: openapi3.NewResponses()}
 	partialGET := &openapi3.Operation{Responses: openapi3.NewResponses()}
-	doc := &openapi3.Swagger{
+	doc := &openapi3.T{
 		OpenAPI: "3.0.0",
 		Info: &openapi3.Info{
 			Title:   "MyAPI",
diff --git a/routers/legacy/router_test.go b/routers/legacy/router_test.go
index 082eab5..bfc7e11 100644
--- a/routers/legacy/router_test.go
+++ b/routers/legacy/router_test.go
@@ -24,7 +24,7 @@ func TestRouter(t *testing.T) {
 	paramsGET := &openapi3.Operation{Responses: openapi3.NewResponses()}
 	booksPOST := &openapi3.Operation{Responses: openapi3.NewResponses()}
 	partialGET := &openapi3.Operation{Responses: openapi3.NewResponses()}
-	doc := &openapi3.Swagger{
+	doc := &openapi3.T{
 		OpenAPI: "3.0.0",
 		Info: &openapi3.Info{
 			Title:   "MyAPI",