code: func NewJSONSchemaFromProps(t *Type, properties map[string]interface{}, typ, name string) JSONSchema {
  	var required []string
  
  	if isTypeArray(typ) {
  		return newArraySchema(t, typ, name)
  	}
  
  	props := make(map[string]property, len(properties))
  	for name := range properties {
  		rp := t.GetProperty(name)
  		if !isPropTypeSupported(rp) {
  			continue
  		}
  
  		p := newProperty(rp)
  		props[p.Name] = p
  		if p.Required {
  			required = append(required, p.Name)
  		}
  	}
  
  	// we need it to be sorted for testing purpose
  	sort.Strings(required)
  	js := JSONSchema{
  		Schema:     schemaVer,
  		Name:       name,
  		Type:       typ,
  		T:          t,
  		Properties: props,
  		Required:   required,
  	}
  	if js.T == nil {
  		js.T = &Type{
  			Type:       typ,
  			Properties: properties,
  		}
  	}
  	return js
  }
docs: // NewJSONSchemaFromProps creates json schmema
  // from a map of properties