func (x *Parameters) UnmarshalJSON(data []byte) (err error) {
	x2 := parameters{}
	if err = json.Unmarshal(data, &x2); err == nil {
		*x = Parameters(x2)
		return x.checkResourceType()
	}
	return
}
Custom unmarshaller to properly unmarshal embedded resources (represented as interface{})
package models
import (
	"encoding/json"
	"errors"
	"fmt"
)
type Parameters struct {
	Resource  `bson:",inline"`
	Parameter []ParametersParameterComponent `bson:"parameter,omitempty" json:"parameter,omitempty"`
}
func (resource *Parameters) MarshalJSON() ([]byte, error) {
	resource.ResourceType = "Parameters"
	return json.Marshal(*resource)
}
func (x *Parameters) GetBSON() (interface{}, error) {
	x.ResourceType = "Parameters"
	return *x, nil
}
type parameters Parameters