Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

RAML 1.0 to OAS 3.0 doesn't convert baseUriParameters default value #56

Open
gtrevg opened this issue Mar 27, 2019 · 0 comments
Open

RAML 1.0 to OAS 3.0 doesn't convert baseUriParameters default value #56

gtrevg opened this issue Mar 27, 2019 · 0 comments

Comments

@gtrevg
Copy link

gtrevg commented Mar 27, 2019

The variable default value in OAS is being set to the variable name, not the variable's default value.

Given

#%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

Expected

{
  "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": {}
  }
}

Actual

{
  "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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant