Skip to content

1.0.0-preview.2

Pre-release
Pre-release

Choose a tag to compare

@hlib-zinchenko hlib-zinchenko released this 13 Nov 17:15
· 12 commits to main since this release

Second preview, with fixes from adopting 1.0.0-preview.1 in a real API.

Changes

  • SortableDto.ValidateAll(assemblies) skips abstract types, so a base class can mark properties [Sortable] for the DTOs that inherit them without failing startup.
  • New SortableDto.ValidateAll(IEnumerable<Type>) checks just the DTOs you pass: SortableDto.ValidateAll([typeof(OrderDto), typeof(CustomerDto)]). Use it when some types have [Sortable] properties but are never sorted, such as a DTO that only inherits them.
  • Every PagedData<T> and PagingMetadata property is required, so an OpenAPI document (Microsoft.AspNetCore.OpenApi 10 and 11, checked) lists them all as required, with no schema transformer of your own. Both types also read back from JSON now.
    • The existing constructors still work, and are the way to build a page: they work out TotalPages and HasNextPage.
    • The new parameterless constructors are for serializers and object initializers.
    • TotalPages and HasNextPage are now set by the constructor, no longer computed when read.

Packages

Full changelog: v1.0.0-preview.1...v1.0.0-preview.2