code: func UnmarshalLicense(bytes []byte) (License, error) {
  	if len(bytes) == 0 {
  		return nil, trace.BadParameter("missing resource data")
  	}
  
  	schema := fmt.Sprintf(V2SchemaTemplate, MetadataSchema, LicenseSpecV3Template, DefaultDefinitions)
  
  	var license LicenseV3
  	err := utils.UnmarshalWithSchema(schema, &license, bytes)
  	if err != nil {
  		return nil, trace.BadParameter(err.Error())
  	}
  
  	if license.Version != V3 {
  		return nil, trace.BadParameter("unsupported version %v, expected version %v", license.Version, V3)
  	}
  
  	if err := license.CheckAndSetDefaults(); err != nil {
  		return nil, trace.Wrap(err)
  	}
  
  	return &license, nil
  }
docs: // UnmarshalLicense unmarshals License from JSON or YAML
  // and validates schema