Skip to content

Commit dfef5ae

Browse files
committed
Fix load jsonschema with refs
1 parent a7a79fd commit dfef5ae

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/ApiCodeGenerator.Core/ApiDocumentProvider.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ public ApiDocumentProvider(IFileProvider fileProvider, HttpClient httpClient)
106106
}
107107
}
108108

109+
data.Schema = data.Schema.Replace("#/definitions/", $"#/components/schemas/{data.Name}/definitions/");
109110
var content = $"{{\"openapi\":\"3.0.0\",\"components\":{{\"schemas\":{{\"{data.Name}\":{data.Schema}}}}}}}";
110111
return FromContent(content, null);
111112
}

0 commit comments

Comments
 (0)