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

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

Open
ricardomelocastro opened this issue May 15, 2018 · 0 comments

Comments

@ricardomelocastro
Copy link

ricardomelocastro commented May 15, 2018

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
          }
        ]
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