Skip to content

Commit

Permalink
Remove unused UseDocumentProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
RicoSuter committed Nov 13, 2023
1 parent 50609a8 commit cc16278
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ public static IServiceCollection AddSwaggerDocument(this IServiceCollection serv
{
serviceCollection.AddSingleton<OpenApiDocumentProvider>();
serviceCollection.AddSingleton<IConfigureOptions<MvcOptions>, OpenApiConfigureMvcOptions>();

// Used by UseDocumentProvider CLI setting
serviceCollection.AddSingleton<IOpenApiDocumentGenerator>(s => s.GetRequiredService<OpenApiDocumentProvider>());

// Used by the <c>dotnet-getdocument</c> tool from the Microsoft.Extensions.ApiDescription.Server package.
Expand Down
6 changes: 0 additions & 6 deletions src/NSwag.Commands/NSwagDocumentBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -515,12 +515,6 @@ private static string TransformLegacyDocument(string data, out bool saveFile)
saveFile = true;
}

if (data.Contains("\"noBuild\":") && !data.ToLowerInvariant().Contains("UseDocumentProvider".ToLowerInvariant()))
{
data = data.Replace("\"noBuild\":", "\"useDocumentProvider\": false, \"noBuild\":");
saveFile = true;
}

if (data.Contains("\"noBuild\":") && !data.ToLowerInvariant().Contains("RequireParametersWithoutDefault".ToLowerInvariant()))
{
data = data.Replace("\"noBuild\":", "\"requireParametersWithoutDefault\": true, \"noBuild\":");
Expand Down
1 change: 0 additions & 1 deletion src/NSwag.Sample.NET60/nswag.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"schemaNameGeneratorType": null,
"contractResolverType": null,
"serializerSettingsType": null,
"useDocumentProvider": true,
"documentName": "v1",
"aspNetCoreEnvironment": null,
"createWebHostBuilderMethod": null,
Expand Down
1 change: 0 additions & 1 deletion src/NSwag.Sample.NET60Minimal/nswag.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"schemaNameGeneratorType": null,
"contractResolverType": null,
"serializerSettingsType": null,
"useDocumentProvider": true,
"documentName": "v1",
"aspNetCoreEnvironment": null,
"createWebHostBuilderMethod": null,
Expand Down
1 change: 0 additions & 1 deletion src/NSwag.Sample.NET70/nswag.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"schemaNameGeneratorType": null,
"contractResolverType": null,
"serializerSettingsType": null,
"useDocumentProvider": true,
"documentName": "v1",
"aspNetCoreEnvironment": null,
"createWebHostBuilderMethod": null,
Expand Down
1 change: 0 additions & 1 deletion src/NSwag.Sample.NET80/nswag.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"schemaNameGeneratorType": null,
"contractResolverType": null,
"serializerSettingsType": null,
"useDocumentProvider": true,
"documentName": "v1",
"aspNetCoreEnvironment": null,
"createWebHostBuilderMethod": null,
Expand Down
1 change: 0 additions & 1 deletion src/NSwag.Sample.NETCore31/nswag.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"schemaNameGeneratorType": null,
"contractResolverType": null,
"serializerSettingsType": null,
"useDocumentProvider": true,
"documentName": "v1",
"aspNetCoreEnvironment": null,
"createWebHostBuilderMethod": null,
Expand Down

0 comments on commit cc16278

Please sign in to comment.