func (x *Conformance) UnmarshalJSON(data []byte) (err error) {
	x2 := conformance{}
	if err = json.Unmarshal(data, &x2); err == nil {
		if x2.Contained != nil {
			for i := range x2.Contained {
				x2.Contained[i] = MapToResource(x2.Contained[i], true)
			}
		}
		*x = Conformance(x2)
		return x.checkResourceType()
	}
	return
}
Custom unmarshaller to properly unmarshal embedded resources (represented as interface{})
package models
import (
	"encoding/json"
	"errors"
	"fmt"
)
type Conformance struct {
	DomainResource `bson:",inline"`
	Url            string                              `bson:"url,omitempty" json:"url,omitempty"`
	Version        string                              `bson:"version,omitempty" json:"version,omitempty"`
	Name           string                              `bson:"name,omitempty" json:"name,omitempty"`
	Status         string                              `bson:"status,omitempty" json:"status,omitempty"`
	Experimental   *bool                               `bson:"experimental,omitempty" json:"experimental,omitempty"`
	Date           *FHIRDateTime                       `bson:"date,omitempty" json:"date,omitempty"`
	Publisher      string                              `bson:"publisher,omitempty" json:"publisher,omitempty"`
	Contact        []ConformanceContactComponent       `bson:"contact,omitempty" json:"contact,omitempty"`
	Description    string                              `bson:"description,omitempty" json:"description,omitempty"`
	UseContext     []CodeableConcept                   `bson:"useContext,omitempty" json:"useContext,omitempty"`
	Requirements   string                              `bson:"requirements,omitempty" json:"requirements,omitempty"`
	Copyright      string                              `bson:"copyright,omitempty" json:"copyright,omitempty"`
	Kind           string                              `bson:"kind,omitempty" json:"kind,omitempty"`
	Instantiates   []string                            `bson:"instantiates,omitempty" json:"instantiates,omitempty"`
	Software       *ConformanceSoftwareComponent       `bson:"software,omitempty" json:"software,omitempty"`
	Implementation *ConformanceImplementationComponent `bson:"implementation,omitempty" json:"implementation,omitempty"`
	FhirVersion    string                              `bson:"fhirVersion,omitempty" json:"fhirVersion,omitempty"`
	AcceptUnknown  string                              `bson:"acceptUnknown,omitempty" json:"acceptUnknown,omitempty"`
	Format         []string                            `bson:"format,omitempty" json:"format,omitempty"`
	Profile        []Reference                         `bson:"profile,omitempty" json:"profile,omitempty"`
	Rest           []ConformanceRestComponent          `bson:"rest,omitempty" json:"rest,omitempty"`
	Messaging      []ConformanceMessagingComponent     `bson:"messaging,omitempty" json:"messaging,omitempty"`
	Document       []ConformanceDocumentComponent      `bson:"document,omitempty" json:"document,omitempty"`
}
func (resource *Conformance) MarshalJSON() ([]byte, error) {
	resource.ResourceType = "Conformance"
	return json.Marshal(*resource)
}
func (x *Conformance) GetBSON() (interface{}, error) {
	x.ResourceType = "Conformance"
	return *x, nil
}
type conformance Conformance