Open Source Web Application Framework for ASP.NET Core. Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET and the ASP.NET Core platforms. Provides the fundamental infrastructure, production-ready startup templates, application modules, UI themes, tooling, guides and documentation.
I have noticed a problem reported elsewhere but so far unchanged where the swagger.json is corrupt. This is especially true for things like PagedResultDto objects and you'll note within the name of the object there are "`" tick marks.
In the _HttpApiHostModule.cs file, we see the following line:
options.CustomSchemaIds(type => type.FullName);
Being a previous user of AspNetZero, there is a function called CustomDefaultSchemaIdSelector() within SwaggerExtensions.cs which seems to do what we need here. I have incorporated the code within _HttpApiHostModule.cs by changing the above line to:
Is there an existing issue for this?
Description
I have noticed a problem reported elsewhere but so far unchanged where the swagger.json is corrupt. This is especially true for things like PagedResultDto objects and you'll note within the name of the object there are "`" tick marks.
Please see below a sample of the created JSON:
In the _HttpApiHostModule.cs file, we see the following line:
options.CustomSchemaIds(type => type.FullName);
Being a previous user of AspNetZero, there is a function called CustomDefaultSchemaIdSelector() within SwaggerExtensions.cs which seems to do what we need here. I have incorporated the code within _HttpApiHostModule.cs by changing the above line to:
This seems to work well for me, and I now have a valid JSON file I can pass into my swagger generator.
Reproduction Steps
Expected behavior
Correct swagger.json file should be created with no illegal characters.
Actual behavior
Current setup produces incorrect JSON.
Regression?
No response
Known Workarounds
No response
Version
8.1.1
User Interface
Angular
Database Provider
EF Core (Default)
Tiered or separate authentication server
None (Default)
Operation System
macOS
Other information
No response