| | | 1 | | /// <summary> |
| | | 2 | | /// OpenAPI XML metadata for properties and classes. |
| | | 3 | | /// Use this attribute to configure XML-specific serialization details in OpenAPI 3.2+. |
| | | 4 | | /// Apply to: |
| | | 5 | | /// <list type="bullet"> |
| | | 6 | | /// <item><description>Class (object-level): set XML name, namespace, and prefix for the entire schema.</description></i |
| | | 7 | | /// <item><description>Property (member-level): set XML name, whether it's an attribute, wrapping behavior, etc.</descri |
| | | 8 | | /// </list> |
| | | 9 | | /// </summary> |
| | | 10 | | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inhe |
| | | 11 | | public sealed class OpenApiXmlAttribute : KestrunAnnotation |
| | | 12 | | { |
| | | 13 | | /// <summary> |
| | | 14 | | /// Replaces the name of the element/attribute used for the described schema property. |
| | | 15 | | /// When applied to arrays, applies to the individual items (not the array wrapper). |
| | | 16 | | /// </summary> |
| | 28 | 17 | | public string? Name { get; set; } |
| | | 18 | | |
| | | 19 | | /// <summary> |
| | | 20 | | /// The absolute URI of the namespace definition. |
| | | 21 | | /// Example: "http://example.com/schema/v1" |
| | | 22 | | /// </summary> |
| | 22 | 23 | | public string? Namespace { get; set; } |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// A prefix for the name (used with namespace). |
| | | 27 | | /// Example: "sample" would result in "sample:elementName" |
| | | 28 | | /// </summary> |
| | 20 | 29 | | public string? Prefix { get; set; } |
| | | 30 | | |
| | | 31 | | /// <summary> |
| | | 32 | | /// Declares whether the property is rendered as an XML attribute instead of an element. |
| | | 33 | | /// Only applies to properties, not to arrays or complex types. |
| | | 34 | | /// Default: false (rendered as element). |
| | | 35 | | /// </summary> |
| | 20 | 36 | | public bool Attribute { get; set; } |
| | | 37 | | |
| | | 38 | | /// <summary> |
| | | 39 | | /// Indicates whether array items should be wrapped in an enclosing element. |
| | | 40 | | /// Only applies to array properties. |
| | | 41 | | /// Default: false (unwrapped). |
| | | 42 | | /// </summary> |
| | 20 | 43 | | public bool Wrapped { get; set; } |
| | | 44 | | } |