Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Type of a body object is sometimes not processed by the library. #46

Open
jarrodek opened this issue Dec 8, 2016 · 0 comments
Open
Labels

Comments

@jarrodek
Copy link
Contributor

jarrodek commented Dec 8, 2016

Source RAML: https://github.com/raml-org/raml-examples/blob/master/others/alainn-mobile-shopping/api.raml

This is very rare but I've noticed that in this case the type is not handled properly.

For the POST /mobile-tokens/{mobileType} which is defined as:

/mobile-tokens/{mobileType}:
  uriParameters:
    mobileType:
      type: string
      enum: [ios, android]
  post:
    body:
      type:
        properties:
          token: string
        example:
          token: afdasfas23lkesf

the output object is:

{
body: [
  {
    "name": "application/json",
    "displayName": "application/json",
    "required": true,
    "type": {
      "name": "type",
      "displayName": "type",
      "type": "object",
      "required": true,
      "properties": [
        {
          "name": "token",
          "displayName": "token",
          "type": "string",
          "required": true,
          "key": "token"
        }
      ],
      "examples": [
        "{\n  \"token\": \"afdasfas23lkesf\"\n}"
      ]
    },
    "key": "application/json"
  }
]
}

The problem is that the type property should equals object and the type properties should have been promoted to parent object.

@jstoiko jstoiko added the 0.1.x label Aug 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants