CopyPastor

Detecting plagiarism made easy.

Score: 0.9418697470319107; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2023-11-05
by mohammadAli

Original Post

Original - Posted on 2017-11-15
by Ghebrehiywet



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Every class in the swagger JSON must have a unique schemaId.
Swashbuckler tries to just use the class name as a simple schemaId, however if you have two classes in different namespaces with the same name (as you do) this will not work.
As the error suggests, you can use the config setting "UseFullTypeNameInSchemaIds*" for a potential workaround (Update: not available in recent versions)
In newer versions you can achieve the same behavior via options.CustomSchemaIds(x => x.FullName).
Here is an example:

services.ConfigureSwaggerGen(options => { //your custom configuration goes here ... // UseFullTypeNameInSchemaIds replacement for .NET Core options.CustomSchemaIds(x => x.FullName); });
Every class in the swagger JSON must have a unique schemaId.
Swashbuckler tries to just use the class name as a simple schemaId, however if you have two classes in different namespaces with the same name (as you do) this will not work.
As the error suggests, you can use the config setting "UseFullTypeNameInSchemaIds*" for a potential workaround (Update: not available in recent versions)
In newer versions you can achieve the same behavior via options.**CustomSchemaIds**(x => x.FullName).
Here is an example:
services.ConfigureSwaggerGen(options => { //your custom configuration goes here
...
// UseFullTypeNameInSchemaIds replacement for .NET Core options.CustomSchemaIds(x => x.FullName); });
for more information [http://wegotcode.com/microsoft/swagger-fix-for-dotnetcore/][1]

[1]: http://wegotcode.com/microsoft/swagger-fix-for-dotnetcore/

        
Present in both answers; Present only in the new answer; Present only in the old answer;