mulesoft / oas-raml-converter

(DEPRECATED) Converts between OAS and RAML API specifications
https://mulesoft.github.io/oas-raml-converter/
MIT License
73 stars 48 forks source link

raml array of objects in query parameters converts to array of string #36

Open ricardomelocastro opened 6 years ago

ricardomelocastro commented 6 years ago

In my raml definition I have an endpoint with query parameters described as follows:

queryParameters:
      financial_documents:
        description: list of financial document to get information in the format ["type,series,doc,statusflag","type2,series2,doc2,statusflag2"]
        type: array
        items: ATDFinancialDocumentKey
        minItems: 1
        maxItems: 15
        example: | 
         [{"type":"REC","series":"REC2017","number":"1","statusFlag":"C"}]

when converting to oas20 I get the following:

"parameters": [
          {
            "minItems": 1,
            "maxItems": 15,
            "description": "list of financial document to get information in the format [\"type,series,doc,statusflag\",\"type2,series2,doc2,statusflag2\"]",
            "type": "array",
            "items": {
              "type": "string"
            },
            "in": "query",
            "name": "financial_documents",
            "required": true
          }
        ]

Is this the default behaviour? I would expect the financial_documents query parameter to be converted with a reference to a definition. Something like:

"parameters": [
          {
            "minItems": 1,
            "maxItems": 15,
            "description": "list of financial document to get information in the format [\"type,series,doc,statusflag\",\"type2,series2,doc2,statusflag2\"]",
            "type": "array",
            "items": {
              "$ref": "#/definitions/ATDFinancialDocumentKey"
            },
            "in": "query",
            "name": "financial_documents",
            "required": true
          }
        ]