- Added logic to handle assembly load conflicts that would work for both .Net Framework and .Net Core run times.
- All of the type load logic is moved up so all the required type information is fetched before we actually proceed with generation.
- Updated contracts for filters to include list of generation errors, that would be populated by each filter as it processes various xElements.
- Added newtonsoft to handle serialization.
- Other cascading changes.
- Updated major version of the package.
P.S. This commit brings lots of breaking changes.
Allow Sample API endpoints to be hit.
- Fix multiple small bugs in sample APIs:
- Modify web.config to allow PUT and DELETE to be hit. MVC by default only allows GET and POST.
- Remove the front slash '/' and the query param from the attribute-based routing since they are prohibited.
- Register the MVC attribute-based routing in RouteConfig.cs
- Rename the controllers. MVC requires the controllers to end with suffix Controller. If we don't do this, we cannot hit the endpoints :(
- Fix wrong parameters in SampleV4Controller.
1) Modify web.config to allow PUT and DELETE to be hit. MVC by default only allows GET and POST.
2) Remove the front slash '/' and the query param from the attribute-based routing since they are prohibited.
3) Register the MVC attribute-based routing in RouteConfig.cs
4) Rename the controllers. MVC requires the controllers to end with suffix `Controller`. If we don't do this, we cannot hit the endpoints :(
5) Fix wrong parameters in SampleV4Controller.
- Added open api document generation settings, to enable configuring property name in OpenAPIDocument and added it as optional input to Generator.
- Added interface for resolving property name and added default and camel case implementation of it
- Unit test for changes.
- Bug fix for issue where if full api document had duplicate paths, it was not added to variant document even if that document doesn't contain duplicate
- Bug fix to not remove paths with duplicate path error as the duplicate paths were never added to the document.
Code changes
- To handle case where both base class and child class have property with same name.
- Throw error when legitimate duplicate properties are found.
undocumented path parameters need to be moved in "ValidateInAttributeFilter"
Description: Undocumented path parameters need to be moved in "ValidateInAttributeFilter" so it gets executed after alternate tags with no matching param tags are converted to param tags.
Otherwise for documentation like below, undocumented path error is thrown:
<member name="M:Microsoft.OpenApi.CSharpAnnotations.DocumentGeneration.Tests.SampleApis.Controllers.SampleControllerV1.SamplePut(System.String,Microsoft.OpenApi.CSharpAnnotations.DocumentGeneration.Tests.Contracts.SampleObject1)">
<summary>
Sample put
</summary>
<group>Sample V1</group>
<verb>PUT</verb>
<!-- Use alternative param tags with no corresponding param tags. -->
<url>http://localhost:9000/V1/samples/{id}</url>
<header name="sampleHeaderParam1" cref="T:System.Single">Header param 1</header>
<header name="sampleHeaderParam2" cref="T:System.String">Header param 2</header>
<header name="sampleHeaderParam3" cref="T:System.String">Header param 3</header>
<pathParam name="id" cref="T:System.String">The object id</pathParam>
<requestType>
<see cref="T:Microsoft.OpenApi.CSharpAnnotations.DocumentGeneration.Tests.Contracts.SampleObject1"/>Sample object
</requestType>
<!-- ////////////////////////// -->
<returns>The sample object 1</returns
* When legacy tags are provided remove param tags for which in attributes are not specified.
* Changes to split populate in filter into two to allow mix use of alternate and recommended tags.