Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsed Refract of parameters isn't consistent with attributes - parser introduces value which isn't present in markup #286

Closed
honzajavorek opened this issue Apr 8, 2016 · 1 comment
Labels

Comments

@honzajavorek
Copy link
Contributor

I'm parsing the 07. Parameters.md example blueprint. There's following markup:

+ Parameters

    + limit (number, optional) - The maximum number of results to return.
        + Default: `20`

Using drafter -f json (v2.3.0-pre.1), it's parsed as

{
  "element": "member",
  "meta": {
    "description": "The maximum number of results to return."
  },
  "attributes": {
    "typeAttributes": [
      "optional"
    ]
  },
  "content": {
    "key": {
      "element": "string",
      "content": "limit"
    },
    "value": {
      "element": "number",
      "attributes": {
        "default": "20"
      },
      "content": 0
    }
  }
}

Notice the "content": 0 part. Nobody specified value of the parameter should be 0 in the original markup. If I try to provide following:

+ Attributes

    + limit (number, optional) - The maximum number of results to return.
        + Default: `20`

Then it's parsed as:

{
  "element": "object",
  "content": [
    {
      "element": "member",
      "meta": {
        "description": "The maximum number of results to return."
      },
      "attributes": {
        "typeAttributes": [
          "optional"
        ]
      },
      "content": {
        "key": {
          "element": "string",
          "content": "limit"
        },
        "value": {
          "element": "number",
          "attributes": {
            "default": 20
          }
        }
      }
    }
  ]
}

i.e. correctly, just with the default value.

@pksunkara pksunkara added the bug label Apr 8, 2016
@pksunkara
Copy link
Contributor

Similarily, we have issues with

# GET /{id}
+ Parameters
    + id
# GET /{id}
+ Parameters
    + id (boolean)

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

No branches or pull requests

2 participants