Closed
Description
Microsoft.OpenAPI.dll v 1.2.3
To reproduce the issue you will need to change regional settings to a culture that uses comma (",") as decimal symbol, i.e. English (Belgium). When outputting JSON the decimal symbol should be dot (".").
I'm attaching a sample specification (input.txt) that has single definition with a few floating properties. If you run the following unit test it will produce the invalid JSON (output.txt):
[TestMethod]
public void Test()
{
var reader = new OpenApiStringReader();
var doc = reader.Read(System.IO.File.ReadAllText("input.txt"), out OpenApiDiagnostic d);
using (var stringWriter = new System.IO.StringWriter(CultureInfo.CurrentCulture))
{
OpenApiDocumentWriter.Write(textWriter: stringWriter,
document: doc,
version: OpenApiSpecVersion.OpenApi3_0,
format: OpenApiFormat.Json);
var json = stringWriter.ToString();
// This will throw an error
JObject jobject = JObject.Parse(json);
}
}