Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
McpMultiSelectParameterAttribute.cs
1using System;
3
5{
10 [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.ReturnValue |
11 AttributeTargets.Property | AttributeTargets.Field,
12 Inherited = true, AllowMultiple = false)]
14 {
22 : base(Title, Description)
23 {
24 this.MinItems = null;
25 this.MaxItems = null;
26 }
27
36 int? MinItems, int? MaxItems)
37 : base(Title, Description)
38 {
39 this.MinItems = MinItems;
40 this.MaxItems = MaxItems;
41 }
42
46 public int? MinItems { get; }
47
51 public int? MaxItems { get; }
52
57 public override void Annotate(Dictionary<string, object?> Schema)
58 {
59 base.Annotate(Schema);
60
61 Schema["type"] = "array";
62
63 if (this.MinItems.HasValue)
64 Schema["minItems"] = this.MinItems.Value;
65
66 if (this.MaxItems.HasValue)
67 Schema["maxItems"] = this.MaxItems.Value;
68 }
69 }
70}
Provides meta-data about a multi-select parameter (Enumeration value with FlagsAttribute defined....
McpMultiSelectParameterAttribute(string? Title, string? Description)
Provides meta-data about a multi-select parameter (Enumeration value with FlagsAttribute defined....
McpMultiSelectParameterAttribute(string? Title, string? Description, int? MinItems, int? MaxItems)
Provides meta-data about a string-valued parameter.
override void Annotate(Dictionary< string, object?> Schema)
Annotates a schema object with information in the attribute.