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

MSON aligned parameter parser trips up when inline description contains round brackets #345

Closed
kylef opened this issue Aug 12, 2015 · 6 comments
Labels

Comments

@kylef
Copy link
Member

kylef commented Aug 12, 2015

When an inline description of an MSON aligned parameter is used that contains round brackets () the parser seems to trip up and says the whole block is unrecognised.

screen shot 2015-08-12 at 21 28 28

Problematic syntax

+ Parameters
    + query (string) - This is a (short) inline description

Working alternatives

+ Parameters
    + query - This is a (short) inline description
+ Parameters
    + query (string)
        This is a (short) inline description
@kylef kylef added the bug label Aug 12, 2015
@pksunkara
Copy link
Contributor

Can you try the following and see what happens?

+ Parameters
    + query: sample (string) - This is a (short) inline description

@kylef
Copy link
Member Author

kylef commented Aug 12, 2015

That also works @pksunkara.

@pksunkara
Copy link
Contributor

@kylef The problem is that the default is old parameter style. Since the following parameter is also valid old style paramter, it will default to old style parameter and try to parse it which is giving the error.

+ query (string) - This is a (short) inline description

@kylef
Copy link
Member Author

kylef commented Aug 12, 2015

Since the following parameter is also valid old style parameter

But this isn't valid with the old syntax because it throws an error?

@pksunkara
Copy link
Contributor

Yes. So, we need to add the option of trying to parse with the other style if the recognised style throws error.

@pksunkara
Copy link
Contributor

Actually, the issue here is in trying to recognise the parameter syntax style. Instead of trying to match brackets, this line directly goes to the last closing bracket. And when the next non-empty character is not a description delimiter, the parameter doesn't get recognised as a whole.

klokane pushed a commit that referenced this issue Sep 1, 2016
MSON aligned parameter parser trips up when inline description contains round brackets
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

2 participants