| | | 1 | | /// <summary> |
| | | 2 | | /// Specifies metadata for an OpenAPI Header component. Can be applied to classes, |
| | | 3 | | /// properties, or fields to contribute entries under components.headers. |
| | | 4 | | /// </summary> |
| | | 5 | | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inher |
| | | 6 | | public sealed class OpenApiHeaderAttribute : KestrunAnnotation |
| | | 7 | | { |
| | | 8 | | /// <summary> |
| | | 9 | | /// The HTTP status code (e.g., "200", "400", "404"). |
| | | 10 | | /// This is only used when applied to method parameters to |
| | | 11 | | /// associate the property with a specific response. |
| | | 12 | | /// </summary> |
| | 0 | 13 | | public string? StatusCode { get; set; } |
| | | 14 | | |
| | | 15 | | /// <summary>Optional component key override. If omitted, generator will use class/member naming rules.</summary> |
| | 3 | 16 | | public required string? Key { get; set; } |
| | | 17 | | |
| | | 18 | | /// <summary>Header description.</summary> |
| | 2 | 19 | | public string? Description { get; set; } |
| | | 20 | | |
| | | 21 | | /// <summary>Whether the header is required.</summary> |
| | 2 | 22 | | public bool Required { get; set; } |
| | | 23 | | |
| | | 24 | | /// <summary>Whether the header is deprecated.</summary> |
| | 2 | 25 | | public bool Deprecated { get; set; } |
| | | 26 | | |
| | | 27 | | /// <summary>Whether the header allows empty value.</summary> |
| | 2 | 28 | | public bool AllowEmptyValue { get; set; } |
| | | 29 | | |
| | | 30 | | /// <summary>Serialization style hint.</summary> |
| | 1 | 31 | | public OaParameterStyle Style { get; set; } = OaParameterStyle.Simple; |
| | | 32 | | |
| | | 33 | | /// <summary>Explode flag for serialization.</summary> |
| | 2 | 34 | | public bool Explode { get; set; } |
| | | 35 | | |
| | | 36 | | /// <summary>Schema reference (components.schemas) for the header value.</summary> |
| | 1 | 37 | | public required string Type { get; set; } |
| | | 38 | | |
| | | 39 | | /// <summary> |
| | | 40 | | /// Format hint for the header value (e.g., "date-time", "uuid"). |
| | | 41 | | /// </summary> |
| | 0 | 42 | | public string? Format { get; set; } |
| | | 43 | | |
| | | 44 | | /// <summary>Inline example for header value.</summary> |
| | 3 | 45 | | public object? Example { get; set; } |
| | | 46 | | |
| | | 47 | | /// <summary> |
| | | 48 | | /// When true, indicates that the header value allows reserved characters. |
| | | 49 | | /// </summary> |
| | 2 | 50 | | public bool AllowReserved { get; set; } |
| | | 51 | | |
| | | 52 | | /// <summary> |
| | | 53 | | /// Optional reference to an example component (e.g., "ExampleUser"). |
| | | 54 | | /// </summary> |
| | 0 | 55 | | public string? ExampleRef { get; set; } |
| | | 56 | | |
| | | 57 | | /// <summary> |
| | | 58 | | /// Optional reference to a schema component (e.g., "HeaderSchema"). |
| | | 59 | | /// </summary> |
| | 3 | 60 | | public string? SchemaRef { get; set; } |
| | | 61 | | } |