Esempio n. 1
0
        private void AddHeaderAnnotation()
        {
            for (var i = 0; i < _numAnnotationColumns; i++)
            {
                var annotation = SaJsonKeyAnnotation.CreateFromProperties(ValueTypes[i], Categories[i], Descriptions[i]);

                JsonSchema?.AddAnnotation(_tags[i + NumRequiredColumns], annotation);
            }
        }
Esempio n. 2
0
        public void OutputKeyAnnotation_AsExpected()
        {
            var sb         = new StringBuilder();
            var jsonSchema = new SaJsonSchema(sb);

            jsonSchema.AddAnnotation("name", SaJsonKeyAnnotation.CreateFromProperties(SaJsonValueType.String, 0, null));
            jsonSchema.OutputKeyAnnotation("name");
            Assert.Equal("\"name\":{\"type\":\"string\"}", sb.ToString());
        }