| | | 1 | | namespace Kestrun.Hosting.Options; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Customization options for the OpenAPI metadata generated for the SignalR hub endpoint. |
| | | 5 | | /// </summary> |
| | | 6 | | public sealed record SignalROptions |
| | | 7 | | { |
| | | 8 | | /// <summary> |
| | | 9 | | /// The default path for the SignalR hub endpoint. |
| | | 10 | | /// </summary> |
| | | 11 | | public const string DefaultPath = "/signalr/{hub}"; |
| | | 12 | | |
| | | 13 | | /// <summary> |
| | | 14 | | /// The default name for the SignalR hub. |
| | | 15 | | /// </summary> |
| | | 16 | | public const string DefaultHubName = "NotificationsHub"; |
| | | 17 | | |
| | | 18 | | /// <summary> |
| | | 19 | | /// The default description for the SignalR hub endpoint. |
| | | 20 | | /// </summary> |
| | | 21 | | public const string DefaultDescription = "Establishes a SignalR connection. The server may upgrade to WebSockets or |
| | | 22 | | |
| | | 23 | | /// <summary> |
| | | 24 | | /// The default summary for the SignalR hub endpoint. |
| | | 25 | | /// </summary> |
| | | 26 | | public const string DefaultSummary = "Notifications SignalR Hub"; |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// The default OpenAPI tags for the SignalR hub endpoint. |
| | | 30 | | /// </summary> |
| | | 31 | | public const string DefaultTag = "SignalR"; |
| | | 32 | | /// <summary> |
| | | 33 | | /// The path for the SignalR hub endpoint. |
| | | 34 | | /// </summary> |
| | 0 | 35 | | public string Path { get; set; } = DefaultPath; |
| | | 36 | | |
| | | 37 | | /// <summary> |
| | | 38 | | /// Customization options for the OpenAPI metadata generated for the SignalR hub endpoint. |
| | | 39 | | /// </summary> |
| | 0 | 40 | | public string[] DocId { get; set; } = OpenApi.OpenApiDocDescriptor.DefaultDocumentationIds; |
| | | 41 | | |
| | | 42 | | /// <summary> |
| | | 43 | | /// Gets a default configuration for the SignalR hub OpenAPI metadata. |
| | | 44 | | /// </summary> |
| | 0 | 45 | | public static SignalROptions Default { get; } = new(); |
| | | 46 | | |
| | | 47 | | /// <summary> |
| | | 48 | | /// OpenAPI summary for the endpoint. |
| | | 49 | | /// </summary> |
| | 0 | 50 | | public string? Summary { get; init; } = DefaultSummary; |
| | | 51 | | |
| | | 52 | | /// <summary> |
| | | 53 | | /// OpenAPI description for the endpoint. |
| | | 54 | | /// </summary> |
| | 0 | 55 | | public string? Description { get; init; } = DefaultDescription; |
| | | 56 | | |
| | | 57 | | /// <summary> |
| | | 58 | | /// Name of the SignalR hub. |
| | | 59 | | /// </summary> |
| | 0 | 60 | | public string? HubName { get; init; } = DefaultHubName; |
| | | 61 | | |
| | | 62 | | /// <summary> |
| | | 63 | | /// OpenAPI tags for the endpoint. |
| | | 64 | | /// </summary> |
| | 0 | 65 | | public IEnumerable<string> Tags { get; init; } = [DefaultTag]; |
| | | 66 | | |
| | | 67 | | /// <summary> |
| | | 68 | | /// If true, the OpenAPI documentation for this endpoint will be skipped. |
| | | 69 | | /// </summary> |
| | 0 | 70 | | public bool SkipOpenApi { get; set; } |
| | | 71 | | |
| | | 72 | | /// <summary> |
| | | 73 | | /// If true, includes the SignalR negotiate endpoint in OpenAPI documentation. |
| | | 74 | | /// </summary> |
| | 0 | 75 | | public bool IncludeNegotiateEndpoint { get; set; } = false; |
| | | 76 | | } |