Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
McpUriParameterAttribute.cs
1using System;
3
5{
9 [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.ReturnValue |
10 AttributeTargets.Property | AttributeTargets.Field,
11 Inherited = true, AllowMultiple = false)]
13 {
20 : base(Title, Description)
21 {
22 this.ContentType = null;
23 }
24
32 int MaxLength)
34 {
35 this.ContentType = null;
36 }
37
46 int MinLength, int MaxLength)
48 {
49 this.ContentType = null;
50 }
51
58 public McpUriParameterAttribute(string? Title, string? Description, string ContentType)
59 : base(Title, Description)
60 {
61 this.ContentType = ContentType;
62 }
63
72 int MaxLength, string ContentType)
74 {
75 this.ContentType = ContentType;
76 }
77
87 int MinLength, int MaxLength, string ContentType)
89 {
90 this.ContentType = ContentType;
91 }
92
96 public string? ContentType { get; set; }
97
102 public override void Annotate(Dictionary<string, object?> Schema)
103 {
104 base.Annotate(Schema);
105
106 Schema["format"] = "uri";
107
108 if (!string.IsNullOrEmpty(this.ContentType))
109 Schema["mimeType"] = this.ContentType;
110 }
111
116 public override void GetHtmlInputAttributes(Dictionary<string, string> Attributes)
117 {
118 base.GetHtmlInputAttributes(Attributes);
119 Attributes["type"] = "url";
120 }
121 }
122}
McpUriParameterAttribute(string? Title, string? Description)
Provides meta-data about a URI-valued parameter.
McpUriParameterAttribute(string? Title, string? Description, int MaxLength)
Provides meta-data about a string-valued parameter.
override void GetHtmlInputAttributes(Dictionary< string, string > Attributes)
Gets HTML input attributes for the parameter, if any.
string? ContentType
Content-Type of the content the URI points to.
override void Annotate(Dictionary< string, object?> Schema)
Annotates a schema object with information in the attribute.
McpUriParameterAttribute(string? Title, string? Description, int MaxLength, string ContentType)
Provides meta-data about a string-valued parameter.
McpUriParameterAttribute(string? Title, string? Description, string ContentType)
Provides meta-data about a URI-valued parameter.
McpUriParameterAttribute(string? Title, string? Description, int MinLength, int MaxLength)
Provides meta-data about a string-valued parameter.
McpUriParameterAttribute(string? Title, string? Description, int MinLength, int MaxLength, string ContentType)
Provides meta-data about a string-valued parameter.