Exemple #1
0
        public JsonSchemaProperty?Visit(IArrayField field, Args args)
        {
            if (args.Level > MaxDepth)
            {
                return(null);
            }

            var itemSchema = SchemaBuilder.Object();

            var nestedArgs = args.Increment();

            foreach (var nestedField in field.Fields.ForApi(args.WithHiddenFields))
            {
                var nestedProperty = nestedField.Accept(this, nestedArgs);

                if (nestedProperty != null)
                {
                    nestedProperty.Description = nestedField.RawProperties.Hints;
                    nestedProperty.SetRequired(nestedField.RawProperties.IsRequired);

                    itemSchema.Properties.Add(nestedField.Name, nestedProperty);
                }
            }

            return(SchemaBuilder.ArrayProperty(itemSchema));
        }
Exemple #2
0
        public JsonSchemaProperty?Visit(IField <ComponentsFieldProperties> field, Args args)
        {
            if (args.Level > MaxDepth)
            {
                return(null);
            }

            var itemSchema = SchemaBuilder.Object();

            BuildComponent(itemSchema, field, field.Properties.SchemaIds, args);

            return(SchemaBuilder.ArrayProperty(itemSchema));
        }
Exemple #3
0
        public JsonSchemaProperty?Visit(IArrayField field)
        {
            var itemSchema = SchemaBuilder.Object();

            foreach (var nestedField in field.Fields.ForApi(withHiddenFields))
            {
                var nestedProperty = nestedField.Accept(this);

                if (nestedProperty != null)
                {
                    nestedProperty.Description = nestedField.RawProperties.Hints;
                    nestedProperty.SetRequired(nestedField.RawProperties.IsRequired);

                    itemSchema.Properties.Add(nestedField.Name, nestedProperty);
                }
            }

            return(SchemaBuilder.ArrayProperty(itemSchema));
        }
Exemple #4
0
 public JsonSchemaProperty?Visit(IField <AssetsFieldProperties> field, Args args)
 {
     return(SchemaBuilder.ArrayProperty(SchemaBuilder.String()));
 }
Exemple #5
0
        public JsonSchemaProperty?Visit(IField <AssetsFieldProperties> field)
        {
            var itemSchema = schemaResolver("AssetItem", SchemaBuilder.Guid());

            return(SchemaBuilder.ArrayProperty(itemSchema));
        }
Exemple #6
0
        public JsonSchemaProperty?Visit(IField <TagsFieldProperties> field)
        {
            var itemSchema = schemaResolver("ReferenceItem", SchemaBuilder.String());

            return(SchemaBuilder.ArrayProperty(itemSchema));
        }
        public JsonSchemaProperty?Visit(IField <AssetsFieldProperties> field, Args args)
        {
            var itemSchema = args.SchemaResolver("AssetItem", SchemaBuilder.String());

            return(SchemaBuilder.ArrayProperty(itemSchema));
        }