| | | 1 | | /// <summary> |
| | | 2 | | /// Declares a reusable example on a specific media type of a response, |
| | | 3 | | /// mapping a local example key to a components/examples reference. |
| | | 4 | | /// </summary> |
| | | 5 | | /// <remarks> |
| | | 6 | | /// Create an example reference specifying the media type. |
| | | 7 | | /// </remarks> |
| | | 8 | | [AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)] |
| | | 9 | | public sealed class OpenApiResponseExampleRefAttribute : KestrunAnnotation, IOpenApiResponseAttribute, IOpenApiExampleAt |
| | | 10 | | { |
| | | 11 | | /// <summary> |
| | | 12 | | /// The HTTP status code for the response. |
| | | 13 | | /// </summary> |
| | 4 | 14 | | public string StatusCode { get; set; } = "default"; |
| | | 15 | | /// <summary>Local name under content[contentType].examples</summary> |
| | 6 | 16 | | public required string Key { get; set; } |
| | | 17 | | |
| | | 18 | | /// <summary>Id under #/components/examples/{ReferenceId}</summary> |
| | 13 | 19 | | public required string ReferenceId { get; set; } |
| | | 20 | | |
| | | 21 | | /// <summary>Media type bucket (e.g., application/json, application/xml)</summary> |
| | 0 | 22 | | public string[]? ContentType { get; set; } |
| | | 23 | | |
| | | 24 | | /// <summary> |
| | | 25 | | /// When true, embeds the example directly instead of referencing it. |
| | | 26 | | /// </summary> |
| | 7 | 27 | | public bool Inline { get; set; } |
| | | 28 | | } |