Open gtrevg opened 5 years ago
The variable default value in OAS is being set to the variable name, not the variable's default value.
#%RAML 1.0 title: MyServer protocols: [ HTTP, HTTPS ] baseUri: http://{myServerURI}/{version} baseUriParameters: myServerURI: description: The server URL default: localhost version: v1
oas-raml-converter -f RAML -t OAS30 myserver.raml
{ "openapi": "3.0.0", "info": { "title": "MyServer", "version": "v1" }, "servers": [ { "url": "http://{myServerURI}/{version}", "variables": { "myServerURI": { "default": "localhost" }, "version": { "default": "v1" } } }, { "url": "https://{myServerURI}/{version}", "variables": { "myServerURI": { "default": "localhost" }, "version": { "default": "v1" } } } ], "paths": {}, "components": { "schemas": {}, "responses": {}, "parameters": {}, "examples": {}, "requestBodies": {}, "headers": {}, "securitySchemes": {}, "links": {}, "callbacks": {} } }
{ "openapi": "3.0.0", "info": { "title": "MyServer", "version": "v1" }, "servers": [ { "url": "http://{myServerURI}/{version}", "variables": { "myServerURI": { "default": "myServerURI" }, "version": { "default": "version" } } }, { "url": "https://{myServerURI}/{version}", "variables": { "myServerURI": { "default": "myServerURI" }, "version": { "default": "version" } } } ], "paths": {}, "components": { "schemas": {}, "responses": {}, "parameters": {}, "examples": {}, "requestBodies": {}, "headers": {}, "securitySchemes": {}, "links": {}, "callbacks": {} } }
Thanks
The variable default value in OAS is being set to the variable name, not the variable's default value.
Given
Expected
Actual
Thanks