7.1.8-beta.1
Pre-release
Pre-release
·
2 commits
to feature/issue-216-media-types
since this release
Pre-release for #216 — media type (content type) & file size validation for IFormFile uploads. Tracks PR #218.
New File-level FluentValidation rules (MicroElements.OpenApi.FluentValidation.FileUpload):
RuleFor(x => x.File)
.NotNull()
.FileContentType("image/jpeg", "image/png")
.MaxFileSize(2 * 1024 * 1024);Also: .MinFileSize(long), .FileSizeBetween(long, long). They enforce at runtime and drive OpenAPI.
| Backend | content type + size in description |
encoding.contentType |
|---|---|---|
| Swashbuckle | ✅ | ✅ (net8/9 = OAS 3.0; net10 = OAS 3.1) |
| NSwag | ✅ | ✅ via FluentValidationOperationProcessor (encodingType — NSwag limitation) |
| Microsoft.AspNetCore.OpenApi | ✅ | ❌ not emitted |
Additive / opt-in — no existing document output changes. See CHANGELOG and PR #218.
Pre-release built from branch
feature/issue-216-media-types(not yet merged to master).