-
Notifications
You must be signed in to change notification settings - Fork 54
URI Template without leading slash doesn't get recognized #459
Comments
This is intentional if I remember. We use the leading slash to recognise that it's an uri. Otherwise, we can't distinguish from normal text and uri. |
@pksunkara I'd say it's not very hard to detect it's meant to be an URI in this case. Something like:
If we want to be strict, we could add:
I think it's very easy to do the error of not having the leading slash and it's not very clear from the parser output what's the problem with such blueprint. Maybe if parser detects a heading according to rules I described, it could still ignore it, but add a warning, which says the blueprint contains something which 99% looks like user mistake and user can fix it with leading slash. |
I think it should produce a warning helping to see if it is intentional or not. |
We should already be causing a warning for this in some cases: https://github.com/apiaryio/snowcrash/blob/master/src/ActionParser.h#L548. For some reason this case is not being check as it is not an action. |
It is sometimes hard to recognise some cases. |
Linking together apiaryio/snowcrash#269 |
Given following API Blueprint
I get following output from Drafter:
Drafter completely ignores the
User Authentication [GET v6/auth]
section. This isn't very user-friendly. It's quite clear user just forgot to start the URI Template with a leading slash character. Drafter should be able to read such markup with a warning. Fixing the markup to# User Authentication [GET /v6/auth]
works.This is a follow-up to a real, user-reported developer experience glitch: apiaryio/dredd#261 Possibly related also to #350
The text was updated successfully, but these errors were encountered: