-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathArrayBuilder.cs
More file actions
37 lines (32 loc) · 894 Bytes
/
ArrayBuilder.cs
File metadata and controls
37 lines (32 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
namespace NeuroSdk.Json.Builders
{
public sealed class ArrayBuilder : SchemaBuilder<IEnumerator<object>>
{
public ArrayBuilder()
{
Schema.Type = JsonSchemaType.Array;
}
public ArrayBuilder Items<TBuilder>(Func<JsonSchemaBuilders, SchemaBuilder<TBuilder>> build)
{
Schema.Items = build(new JsonSchemaBuilders()).Build();
return this;
}
public ArrayBuilder MinItems(int value)
{
Schema.MinItems = value;
return this;
}
public ArrayBuilder MaxItems(int value)
{
Schema.MaxItems = value;
return this;
}
public ArrayBuilder UniqueItems(bool value = true)
{
Schema.UniqueItems = value;
return this;
}
}
}