apiaryio / mson

Markdown Syntax for Object Notation
MIT License
903 stars 180 forks source link

invalid value format for 'number' type #81

Open basickarl opened 7 years ago

basickarl commented 7 years ago

I'm getting the error:

[BS] File changed: .tmp/blueprint.apib
>> Line 0: invalid value format for 'number' type. please check mson specification for valid format (warning code 4)
>> Context

With the following markdown:

+ Response 200 (application/vnd.api+json)

    Received on successful update or insert.

    + Attributes
        + posts (array)
            + name: Apiary
            + founded: 2011 (number) - The year in which the company was founded
Chrumo commented 7 years ago

+1

kylef commented 7 years ago

The error here is a little mis-leading as the parser has struggled to understand the blueprint.

The specific data structure you have here is a key-value property directly under an array. This would could be compared to something like {"posts": ["name": "Apiary", "founded": 2011]} in JSON, which obviously doesn't make any sense.

I think you instead mean the following:

+ Response 200 (application/vnd.api+json)

    Received on successful update or insert.

    + Attributes
        + posts (array)
            + (object)
                + name: Apiary
                + founded: 2011 (number) - The year in which the company was founded
aiyanbo commented 7 years ago

+1