Beispiel #1
0
 private void AddAnnotation(SaJsonKeyAnnotation annotation)
 {
     if (annotation.Properties != null)
     {
         AddAnnotationProperties(annotation);
     }
     else
     {
         _sb.Append(annotation.Schema);
         _jsonObject.EndObject();
     }
 }
Beispiel #2
0
        private void AddAnnotationProperties(SaJsonKeyAnnotation annotation)
        {
            AddValueTypes(annotation.Properties.ValueType);
            int numComplexTypes = annotation.Properties.ValueType.JsonDataTypes.Count(x => x.IsComplexType());

            while (numComplexTypes > 0)
            {
                _jsonObject.EndObject();
                numComplexTypes--;
            }
            if (annotation.Properties.Category != CustomAnnotationCategories.Unknown)
            {
                _jsonObject.AddStringValue("category", annotation.Properties.Category.ToString());
            }
            if (annotation.Properties.Description != null)
            {
                _jsonObject.AddStringValue("description", annotation.Properties.Description);
            }
        }
Beispiel #3
0
 public void AddAnnotation(string key, SaJsonKeyAnnotation annotation)
 {
     _keyAnnotation.Add(key, annotation);
     KeyCounts.Add(key, 0);
 }