Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

MSON: Complex samples are parsed as distinct values #286

Closed
honzajavorek opened this issue Feb 4, 2015 · 8 comments
Closed

MSON: Complex samples are parsed as distinct values #286

honzajavorek opened this issue Feb 4, 2015 · 8 comments
Labels

Comments

@honzajavorek
Copy link
Contributor

Protagonist version

"protagonist-experimental": "0.18.2"

MSON Specs

https://github.com/apiaryio/mson/blob/master/MSON%20Specification.md#44-sample

Example MSON (copy pasted from specs)

- list: *3, 4* (enum)

Result of parsing

{
  "name": {
    "literal": "...",
    "variable": false
  },
  "sections": [
    {
      "class": "memberType",
      "content": [
        {
          "class": "property",
          "content": {
            "name": {
              "literal": "list"
            },
            "valueDefinition": {
              "values": [
                {
                  "literal": "*3",
                  "variable": false
                },
                {
                  "literal": "4*",
                  "variable": false
                }
              ],
              "typeDefinition": {
                "typeSpecification": {
                  "name": "enum"
                }
              }
            }
          }
        }
      ]
    }
  ]
}

Expected

Probably sth like

                {
                  "literal": "3",
                  "variable": true
                },
                {
                  "literal": "4",
                  "variable": true
                }

Other possible option: the spec is wrong.

@pksunkara
Copy link
Contributor

I am going to look into this.

@pksunkara
Copy link
Contributor

Wrote a test case in pksunkara/286 branch which is failing currently.

@honzajavorek
Copy link
Contributor Author

👍 thanks!

@pksunkara
Copy link
Contributor

@honzajavorek But the expected output should be the following:

                {
                  "literal": "3, 4",
                  "variable": true
                }

@honzajavorek
Copy link
Contributor Author

@pksunkara That would be imho very difficult to process by subsequent tooling (aka boutique).

@zdne
Copy link
Contributor

zdne commented Apr 23, 2015

@pksunkara is this still an issue?

@pksunkara
Copy link
Contributor

@zdne Yes, we still haven't fixed this.

@abtris
Copy link
Contributor

abtris commented Oct 1, 2018

Migrated to apiaryio/drafter#639

@abtris abtris closed this as completed Oct 1, 2018
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

4 participants