Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

MSON: Complex samples are parsed as distinct values #639

Open
abtris opened this issue Feb 4, 2015 · 7 comments
Open

MSON: Complex samples are parsed as distinct values #639

abtris opened this issue Feb 4, 2015 · 7 comments
Labels

Comments

@abtris
Copy link
Contributor

abtris commented Feb 4, 2015

@honzajavorek opened apiaryio/snowcrash#286

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.

@abtris
Copy link
Contributor Author

abtris commented Feb 5, 2015

@pksunkara commented

I am going to look into this.

@abtris
Copy link
Contributor Author

abtris commented Feb 5, 2015

@pksunkara commented

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

@abtris
Copy link
Contributor Author

abtris commented Feb 5, 2015

@honzajavorek commented

👍 thanks!

@abtris
Copy link
Contributor Author

abtris commented Feb 6, 2015

@pksunkara commented

@honzajavorek But the expected output should be the following:

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

@abtris
Copy link
Contributor Author

abtris commented Feb 6, 2015

@honzajavorek commented

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

@abtris
Copy link
Contributor Author

abtris commented Apr 23, 2015

@zdne commented

@pksunkara is this still an issue?

@abtris
Copy link
Contributor Author

abtris commented Apr 23, 2015

@pksunkara commented

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

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

1 participant