6.0.0 Preview 1 #811
Replies: 9 comments 35 replies
-
Changelog has incorrect url :) Same for other url, like examples link |
Beta Was this translation helpful? Give feedback.
-
I'm curious about this change:
Can someone elaborate on the history behind this? Is this now not a Microsoft project/product anymore? |
Beta Was this translation helpful? Give feedback.
-
I've tried to integrate it with my project
|
Beta Was this translation helpful? Give feedback.
-
Just in case somebody will need it, native support for IFormFile/IFormFileCollection binding in minimal API will be available only in .net 7 (dotnet/aspnetcore#34303) but adding unused IFormFile to minimal API request will add this parameter to Swagger |
Beta Was this translation helpful? Give feedback.
-
Is there any way to make OData work with Minimal API, ie without Controllers? With OpenApi as well |
Beta Was this translation helpful? Give feedback.
-
Why did you choose
instead of
|
Beta Was this translation helpful? Give feedback.
-
Can you add\rewrite example for OpenApi with C# records? It's not always possible to find the correct way for specifying new way of Required attribute with new typs, so extending example will be a great help NEW: OLD
|
Beta Was this translation helpful? Give feedback.
-
Really great work! Do you have an ETA for 6.0.0 official release? |
Beta Was this translation helpful? Give feedback.
-
How can I add custom route string for methods? |
Beta Was this translation helpful? Give feedback.
-
This is the first preview release, which includes support for .NET 6.0. Be sure to follow the announcement for more background and the roadmap for in-depth review of the release.
The wiki has not been updated, but it's a work in progress. While the wiki has been useful and informative, it is reaching the limits of what is possible. Consideration is being made to lift the current wiki into a fully-fledged documentation website. All of the examples have been updated and include new examples such as Minimal APIs. This is currently the best place to start and review how things have changed.
Features
services.AddHttpClient("test").AddApiVersion(1.0)
ILogger
ASP.NET Core
Enhancements
All Platforms
Span<T>
, noRegex
, fewer allocations, etc)ApiVersion
and related attributes now allowsdouble
(ex:new ApiVersion(1.0)
,[ApiVersion(1.0)]
)ApiVersion.Status
now allows.
(ex:2.0-beta.1
,2022-04-01-preview.1
)ApiVersion.Parse
is supplanted byIApiVersionParser
viaApiVersionParser.Default
ApiVersion
possible (ex: you can add, parse, and format a patch or revision version component if you really want it)404
,405
, and415
are now properly returned in accordance with configured versioning methods without requiring additional configuration or customizationNamespaceParser
NamespaceParser.Default
for the same old out-of-the-box implementation.NET 6.0
ApiVersion
supportsISpanFormattable
ASP.NET Web API
UrlHelper.WithoutApiVersion()
extension (useful when generating links from versioned to version-neutral routes)ASP.NET Core
IUrlHelper.WithoutApiVersion()
extension (useful when generating links from versioned to version-neutral endpoints)Fixes
All of the open issues that could be fixed, have been fixed in this release. These will listed in the forthcoming 5.1 release, but it includes 65+ issues. I will accept reported issues and backport them to 5.1 if they are applicable.
Breaking Changes
This release is essentially a reset and rewrite so many things will be broken from
5.x
. The most obvious issues will be new packages. Here is the mapping of old packages to new packages:The second obvious big change will be different namespaces. All previous
Microsoft.*
namespaces are nowAsp.Versioning.*
. If you are a library author that targets multiple platforms, this should make things easier going forward; it certainly made it easier in the project itself. Extension methods continue to use the same namespace as the type they correspond to.Significant individual changes:
IApiVersionReader.Read
now returnsIReadOnlyList<string>
instead ofstring?
IReportApiVersions.Report
now accepts the entire response instead of just headersIErrorResponseProvider
no longer exists; it is supplanted byIProblemDetailsFactory
and Problem Details (RFC 7807)ApiVersionMetadata
type:GetApiVersionModel(ApiVersionMapping) → GetApiVersionMetadata()
GetApiVersionModel() → ApiVersionMetadata.Map(ApiVersionMapping.Explicit)
MappingTo(ApiVersion) → ApiVersionMetadata.MappingTo(ApiVersion)
IsMappedTo(ApiVersion) → ApiVersionMetadata.IsMappedTo(ApiVersion)
Routing behavior has changed to more accurately return
404
,405
, or415
when appropriate.400
is still returned in known, invalid requests such as an unspecified API version when required.For ASP.NET Core, the setup is now a fluent interface of chained configuration options:
Future Release
The following are features and enhancements still under consideration before the final release:
Feedback
I want to hear your feedback. What do you like? What do you not like? I want to give the community a chance to play with the latest bits and provide any final thoughts before committing to the final release. Now would be the time for any other name changes or other significant refactoring that could cause additional disruption going forward.
Administrative
TL;DR
5.x
patchesThis discussion was created from the release 6.0.0 Preview 1.
Beta Was this translation helpful? Give feedback.
All reactions