Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions src/NSwag.Commands/NSwagDocumentBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,7 @@ protected static async Task<TDocument> LoadAsync<TDocument>(
where TDocument : NSwagDocumentBase, new()
{
var data = File.ReadAllText(filePath);
data = TransformLegacyDocument(data, out var requiredLegacyTransformations);

if (requiredLegacyTransformations)
{
// Save now to avoid transformations
var document = LoadDocument<TDocument>(filePath, data);
await document.SaveAsync();
}
data = TransformLegacyDocument(data, out var _);

if (applyTransformations)
{
Expand Down Expand Up @@ -513,12 +506,6 @@ private static string TransformLegacyDocument(string data, out bool saveFile)
saveFile = true;
}

if (data.Contains("\"noBuild\":") && !data.Contains("RequireParametersWithoutDefault", StringComparison.OrdinalIgnoreCase))
{
data = data.Replace("\"noBuild\":", "\"requireParametersWithoutDefault\": true, \"noBuild\":");
saveFile = true;
}

if (data.Contains("assemblyTypeToSwagger"))
{
data = data.Replace("assemblyTypeToSwagger", "typesToSwagger");
Expand Down