Beispiel #1
0
        protected internal virtual void VisitObject(JsonSchemaObject constraint)
        {
            // visit self
            VisitConstraint(constraint);

            // visit children

            if (constraint.Properties.Count > 0)
            {
                VisitObjectProperties(constraint.Properties);
            }

            if (!constraint.PatternProperties.IsNullOrEmpty())
            {
                VisitObjectPatternProperties(constraint.PatternProperties);
            }

            if (constraint.AdditionalProperties != null)
            {
                VisitObjectAdditionalProperties(constraint.AdditionalProperties);
            }

            if (constraint.PropertyNames != null)
            {
                VisitObjectPropertyNames(constraint.PropertyNames);
            }
        }
        protected internal override void VisitObject(JsonSchemaObject constraint)
        {
            base.VisitObject(constraint);

            if (!constraint.RequiredProperties.IsNullOrEmpty())
            {
                WriteObjectRequiredProperties(constraint.RequiredProperties);
            }

            if (constraint.MinProperties != null)
            {
                writer.WriteNumber(Keys.MinProperties, constraint.MinProperties.Value);
            }

            if (constraint.MaxProperties != null)
            {
                writer.WriteNumber(Keys.MaxProperties, constraint.MaxProperties.Value);
            }
        }