All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Fixed License
- Add symbols NuGet package
- PR #176 update NuGet packages
- PR #178 dependency cleanup
- PR #179 introduce Swashbuckle.AspNetCore.Filters.Abstractions package so that IExamplesProvider can be consumed without Swashbuckle dependency.
- Target .NET 5.0
- Microsoft.SourceLink.GitHub NuGet reference
- Issue #174 remove ExcludeObsoletePropertiesResolver and NewtonsoftJson dependency.
- Issue #171 support auto example for
ProducesDefaultResponseType
.
- PR #161 restore NewtonsoftJson dependency.
- Issue #132 Support
[System.Text.JsonPropertyNameAttribute]
. This is a breaking change which rewrote how the examples are generated. Instead of explicitly using Newtonsoft'sJsonConvert.SerializeObject()
, I now use whichever JSON serializer is registered with the MVC pipeline, i.e. duringservices.AddControllers()
.
- contractResolver and jsonConverter parameters from
[SwaggerRequestExampleAttribute]
. - contractResolver and jsonConverter parameters from
[SwaggerResponseExampleAttribute]
. Microsoft.AspNetCore.Mvc.NewtonsoftJson
dependency.
- If you are using
options.IgnoreObsoleteProperties();
and you want your Examples to not have the obsolete properties, then you will need to register my custom NewtonsoftExcludeObsoletePropertiesResolver
, e.g.
services.AddControllers()
.AddNewtonsoftJson(opt =>
{
opt.SerializerSettings.ContractResolver = new ExcludeObsoletePropertiesResolver(opt.SerializerSettings.ContractResolver);
- #154 Upgrade to Microsoft.OpenApi 1.2.2 because 1.2.0 had breaking changes
- Add
services.AddSwaggerExamples()
extension method to allow examples without automatic annotation
- #115 Added workaround for request examples when SerializeAsV2 = true
- #148 AddSwaggerExamplesFromAssemblies method does not scan for IMultipleExamplesProvider implementations
- PR #147 add support for multiple request and response examples. Thanks to @tomkludy and @pozy for the contribution.
- PR #140 add extension methods AddSwaggerExamplesFromAssemblyOf and AddSwaggerExamplesFromAssemblies
- Fix #136 use either XmlSerializer or DataContractSerializer to output XML examples, depending on what is configured. Thanks to @CumpsD and @ridingwolf for the PR.
- Use Swashbuckle.AspNetCore 5.0.0
- PR #110, where using IgnoreObsoleteProperties option causes PascalCase to be emitted instead of camelCase.
- Use Swashbuckle.AspNetCore 5.0.0-rc5
- Issue #106 SecurityRequirementsOperationFilter removes existing OpenApiSecurityRequirements
- PR #104 add optional format parameter to the SwaggerResponseHeaderAttribute
- Issue #98 check schemaGeneratorOptions.IgnoreObsoleteProperties when generating json examples
- PR #103 - Response Headers filter can now take an array of status codes
- Issue #101, Exception with SecurityRequirementsOperationFilter when you have already added a 401 or a 403
- Issue #99, JSON examples were encoded JSON
- Remove IExamplesProvider interface. Only support IExamplesProvider
- Use Swashbuckle.AspNetCore 5.0.0-rc2
- Support .NET Core 3.0 preview 5
- Use Swashbuckle.AspNetCore 5.0.0-beta
- Drop support for .NET Standard 1.6 and .NET Framework, since Swashbuckle.AspNetCore doesn't support them any more
- Only set request example on the operation, no longer set it on the type. This means you can have different request examples for different operations which use the same request type, which is an often requested feature.
- XML examples
- Removed AuthorizationInputOperationFilter
- Removed DescriptionOperationFilter
- Removed AddFileParamTypesOperationFilter
- Repository URL in NuGet package
- Issue #89 - use Json.NET SerializationBinder property when generating examples. Thanks @dmitry-baryshev for the PR.
- Marked AddFileParamTypesOperationFilter as Obsolete, because Swashbuckle 4.0 supports IFormFile directly.
- Issue #84 - allow security schema to have a name other than "oauth2" via configuration
- Issue #80 - allow interfaces when resolving IExampleProvider
- Issue #69
- Only set request examples on the schema registry object. The request parameter will only be set if a schema registry object is not found. This fix prevents a warning in Redoc. Thanks @Leon99 for the pull request.
- Issue #72 do not override SerializerSettings.NullValueHandling because underlying issue seems to have been fixed
- Issue #67 3rd time
- Support Swashbuckle.AspNetCore 4.0.0 for .NET Framework 4.6.1 projects
- Issue #67 again
- Support Swashbuckle.AspNetCore 4.0.0 for .NET Framework 4.6.1 projects
- Issue #67
- Support Swashbuckle.AspNetCore 4.0.0 for .NET Standard 2.0 projects
- Fix issue #63
- Add an optional true/false value to the AddHeaderOperationFilter to determine whether the header is required or not.
- Issue #60
- No longer support .NET Framework 4.5.1 because it doesn't work with Scrutor (because Scrutor is unsigned)
- Support .NET Framework 4.6.1
- Support .NET Standard 2.0 (still support 1.6 too)
- Mark DescriptionOperationFilter as obsolete, because you can accomplish the same thing with summary tags
- It is no longer necessary to specify a ProducesResponseType or SwaggerResponse attribute in order to get response examples, so long as it is obvious what Type your action method returns.
- Add generic version of SecurityRequirementsOperationFilter and AppendAuthorizeToSummaryOperationFilter so that
they can be used with other attributes. Reason: a client had implemented their own
TypeFilterAttribute
which did Authorization but wasn't anAuthorizeAttribute
- Issue #54 where child objects weren't having their descriptions set if parent property was missing
[Description]
- Issue #54 where arrays of child objects weren't having their description set
- Fix bug where generic types weren't being automatically annotated
- Automatic annotation of request and response examples
- Dependency on Scrutor 2.2.2
- How ExamplesOperationFilter is installed - see Installation section of the Readme
- SecurityRequirementsOperationFilter to correctly set bearer token stuff when using
[Authorize]
- Fix bug with DescriptionOperationFilter where Description not set if using a DefaultContractResolver
- Fix where Examples doesn't work on ASP.NET Core 2.0
- Port of bug #36 from Swashbuckle.Examples
- Rename from Swashbuckle.AspNetCore.Examples
- Dependency on Swashbuckle.AspNetCore 3.0 instead of 1.0