-
Notifications
You must be signed in to change notification settings - Fork 271
Closed
Labels
Needs: Attention 👋priority:p1High priority but not blocking. Causes major but not critical loss of functionality SLA <=7daysHigh priority but not blocking. Causes major but not critical loss of functionality SLA <=7days
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);
}
}
Metadata
Metadata
Assignees
Labels
Needs: Attention 👋priority:p1High priority but not blocking. Causes major but not critical loss of functionality SLA <=7daysHigh priority but not blocking. Causes major but not critical loss of functionality SLA <=7days