| | | 1 | | /// <summary> |
| | | 2 | | /// Specifies metadata for an OpenAPI Request Body component. Can be applied to parameters |
| | | 3 | | /// to contribute entries under components.requestBodies. |
| | | 4 | | /// </summary> |
| | | 5 | | [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] |
| | | 6 | | public sealed class OpenApiRequestBodyAttribute : KestrunAnnotation |
| | | 7 | | { |
| | | 8 | | /// <summary>Description for the request body.</summary> |
| | 0 | 9 | | public string? Description { get; set; } |
| | | 10 | | |
| | | 11 | | /// <summary>Media type. Defaults to application/json.</summary> |
| | 0 | 12 | | public string[] ContentType { get; set; } = ["application/json"]; |
| | | 13 | | |
| | | 14 | | /// <summary>Whether the request body is required.</summary> |
| | 0 | 15 | | public bool Required { get; set; } |
| | | 16 | | |
| | | 17 | | /// <summary> |
| | | 18 | | /// Inline example object for the media type (optional). If omitted and the member has a |
| | | 19 | | /// default value, the generator will use that default as the example. |
| | | 20 | | /// </summary> |
| | 0 | 21 | | public object? Example { get; set; } |
| | | 22 | | |
| | | 23 | | /// <summary> |
| | | 24 | | /// When true, the generator will emit an inline schema object for the request body instead |
| | | 25 | | /// of a <c>$ref</c> to <c>components.schemas</c>. This applies whether the schema is resolved |
| | | 26 | | /// from a CLR type or from a string-based schema reference; in both cases the resolved schema |
| | | 27 | | /// will be inlined where supported. |
| | | 28 | | /// </summary> |
| | 0 | 29 | | public bool Inline { get; set; } |
| | | 30 | | } |