-
Notifications
You must be signed in to change notification settings - Fork 285
Closed
Milestone
Description
Microsoft.OpenAPI NuGet v1.2.2
Serializing to OASv3 outputs the extension as expected. The v2 spec seems to allow it.
Repro:
var doc = new OpenApiDocument()
{
Paths = new OpenApiPaths()
};
doc.Paths.Add("/bar", new OpenApiPathItem()
{
Operations = { { OperationType.Post, new OpenApiOperation()
{
RequestBody = new OpenApiRequestBody()
{
Extensions = { { "x-ms-foo", new OpenApiBoolean(true) } }
}
} } }
});
Console.Out.Write(doc.SerializeAsJson(OpenApiSpecVersion.OpenApi2_0));Actual:
{
"swagger": "2.0",
"info": { },
"paths": {
"/bar": {
"post": {
"consumes": [ ],
"parameters": [
{
"in": "body",
"name": "body",
"schema": { }
}
],
"responses": { }
}
}
}
}Expected:
{
"swagger": "2.0",
"info": { },
"paths": {
"/bar": {
"post": {
"consumes": [ ],
"parameters": [
{
"in": "body",
"name": "body",
"schema": { },
"x-ms-foo": true
}
],
"responses": { }
}
}
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels