If an underscore is both in an Attribute
name and its example value, the parser treats the whole line as the attribute name with a null value.
For example this blueprint:
# GET /message
+ Response 200 (text/plain)
+ Attributes
+ some_thing: an_example_thing
Parsed by Drafter results in this:
_version: "3.0"
metadata: []
name: ""
description: ""
element: "category"
resourceGroups:
-
name: ""
description: ""
resources:
-
element: "resource"
name: ""
description: ""
uriTemplate: "/message"
model: {}
parameters: []
actions:
-
name: ""
description: ""
method: "GET"
parameters: []
attributes:
relation: ""
uriTemplate: ""
content: []
examples:
-
name: ""
description: ""
requests: []
responses:
-
name: "200"
description: ""
headers:
-
name: "Content-Type"
value: "text/plain"
body: ""
schema: ""
content:
-
element: "dataStructure"
name: null
typeDefinition:
typeSpecification:
name: null
nestedTypes: []
attributes: []
sections:
-
class: "memberType"
content:
-
content:
name:
literal: "some_thing: an_example_thing"
description: ""
valueDefinition:
values: []
typeDefinition:
typeSpecification:
name: null
nestedTypes: []
attributes: []
sections: []
class: "property"
content: []
content:
-
element: "category"
content:
-
element: "resource"
name: ""
description: ""
uriTemplate: "/message"
model: {}
parameters: []
actions:
-
name: ""
description: ""
method: "GET"
parameters: []
attributes:
relation: ""
uriTemplate: ""
content: []
examples:
-
name: ""
description: ""
requests: []
responses:
-
name: "200"
description: ""
headers:
-
name: "Content-Type"
value: "text/plain"
body: ""
schema: ""
content:
-
element: "dataStructure"
name: null
typeDefinition:
typeSpecification:
name: null
nestedTypes: []
attributes: []
sections:
-
class: "memberType"
content:
-
content:
name:
literal: "some_thing: an_example_thing"
description: ""
valueDefinition:
values: []
typeDefinition:
typeSpecification:
name: null
nestedTypes: []
attributes: []
sections: []
class: "property"
content: []
Similarly, this is mis-parsed by Apiary, and is syntax highlighted incorrectly.
Hey, If you read the MSON spec, you can see that _ is a reserved character. Please use backticks to escape the whole word. Here is an example:
+ `some_thing`: `an_example_thing`
Please note that there is an UX improvement planned at #210
Guys we can do this:
+ Parameters
+ `grant_type`: `refresh_token` (string, required) - Tipo de concess茫o
Works great!
Seems not really. If both parameter and value have underscores, JSON is being rendered incorrectly. Like
+ aaa_bbb: `ccc_ddd` (string, required) - Example
Yes, in that case, you need to surround aaa_bbb
with `
Most helpful comment
Hey, If you read the MSON spec, you can see that _ is a reserved character. Please use backticks to escape the whole word. Here is an example:
Please note that there is an UX improvement planned at #210