示例#1
0
 private void AddValueTypes(SaJsonValueType jsonValueType)
 {
     foreach (var dataType in jsonValueType.JsonDataTypes)
     {
         AddJsonDataType(dataType);
     }
 }
示例#2
0
        public static SaJsonSchema Create(StringBuilder sb, string jsonTag, SaJsonValueType primaryType, IEnumerable <string> jsonKeys)
        {
            var jsonSchema = new SaJsonSchema(sb)
            {
                Keys = jsonKeys
            };

            // The root level schema for a SA
            if (jsonTag != null)
            {
                jsonSchema._jsonObject.StartObject();
                jsonSchema.AddSchemaVersion();
                // SA json is an object
                jsonSchema.AddJsonDataType(JsonDataType.Object);
                jsonSchema._jsonObject.StartObjectWithKey(jsonTag);
            }

            jsonSchema.AddValueTypes(primaryType);
            return(jsonSchema);
        }
示例#3
0
 public SaJsonKeyProperties(SaJsonValueType valueType, CustomAnnotationCategories category, string description)
 {
     ValueType   = valueType;
     Category    = category;
     Description = description;
 }
示例#4
0
 public static SaJsonKeyAnnotation CreateFromProperties(SaJsonValueType valueType, CustomAnnotationCategories category, string description)
 {
     return(new SaJsonKeyAnnotation {
         Properties = new SaJsonKeyProperties(valueType, category, description)
     });
 }