api-blueprint icon indicating copy to clipboard operation
api-blueprint copied to clipboard

Improve UX around MSON reserved characters

Open kylef opened this issue 10 years ago • 10 comments

There have been many issues reported by users who have forgotten to escape reserved characters. This even catches people working on the parser for MSON itself https://github.com/apiaryio/snowcrash/issues/338 (myself included).

We should find a way to improve the experience around this, either with improved warnings in the parser (snowcrash) or improved MSON documentation making this clearer.

kylef avatar Jun 10 '15 17:06 kylef

:+1: On Jun 10, 2015 7:17 PM, "Kyle Fuller" [email protected] wrote:

There have been many issues reported by users who have forgotten to escape reserved characters. This even catches people working on the parser for MSON itself #338 (myself included).

We should find a way to improve the experience around this, either with improved warnings in the parser (snowcrash) or improved MSON documentation making this clearer.

— Reply to this email directly or view it on GitHub https://github.com/apiaryio/api-blueprint/issues/210.

honzajavorek avatar Jun 10 '15 19:06 honzajavorek

:+1:

Almad avatar Jun 11 '15 00:06 Almad

:+1:

zdne avatar Jun 11 '15 09:06 zdne

If anyone has any suggestions on how to improve the experience around the reserved characters please let me know.

kylef avatar Jul 22 '16 00:07 kylef

@kylef how does actually currently parser decides when the attribute name ends?

Almad avatar Jul 22 '16 10:07 Almad

When it sees a colon or a hyphen or an open parentheses.

pksunkara avatar Jul 22 '16 12:07 pksunkara

@pksunkara I don't think that's entirely true given underscores can break it as well.

Almad avatar Jul 22 '16 12:07 Almad

Underscore doesn't stop the parsing, it searches for the second underscore and treats the whole thing as a markdown italic.

+ name_a: b gives name_a + name_a_: b gives name_a_ + name_a: b_ gives name_a: b_ which is probably not the users' intention.

pksunkara avatar Jul 22 '16 12:07 pksunkara

@pksunkara so Markdown parsing happens before structural parsing?

Almad avatar Jul 22 '16 12:07 Almad

Yes. It's also related to Variable Property Name a bit. If you look at the example there, you can see why I want to give preference to _ & *.

pksunkara avatar Jul 22 '16 12:07 pksunkara