| | | 1 | | /// <summary> |
| | | 2 | | /// Specifies metadata for an OpenAPI Request Body component. Can be applied to classes, |
| | | 3 | | /// properties, or fields to contribute entries under components.requestBodies. |
| | | 4 | | /// </summary> |
| | | 5 | | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inher |
| | | 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, emit an inline schema object instead of a $ref. If SchemaRef is provided and |
| | | 25 | | /// a matching schema exists in components, that schema will be embedded; otherwise the generator |
| | | 26 | | /// will try to infer an inline schema when possible. |
| | | 27 | | /// </summary> |
| | 0 | 28 | | public bool Inline { get; set; } |
| | | 29 | | } |