drafter icon indicating copy to clipboard operation
drafter copied to clipboard

Unrecognized param

Open abtris opened this issue 10 years ago • 6 comments

@Neamar opened apiaryio/snowcrash#90

(not sure i'm posting on right repo, since i'm using API blueprint from @danielgtaylor Aglio)

My API allow for parameters prefixed with "@", for instance "@name=". However, describing such an endpoint result in the following error:

>> Line 134: ignoring unrecognized list item, expected parameter discussion, e.g. '<parameter name> ... lorem ipsum' (warning code 5)

Where line 134 is:

+ Parameters
    + @meta (optional, string, `John`) ... Full text search on `meta` key.  Replace `meta` with the name of the meta you wish to search on.

However, i believe such a parameter is actually valid HTTP. Would it be possible to improve snowcrash to handle this use case ? (and possibly more exotic charsets).

I tried to HTML escape / encodeURIComponent without success.

abtris avatar Mar 24 '14 14:03 abtris

@Almad commented

I believe this is related to apiaryio/api-blueprint#69

abtris avatar Mar 24 '14 14:03 abtris

@Almad commented

@Neamar I think @ is only allowed as %40. This makes things a bit complicated as we have to decide where and who should encode the special character.

This is currently a bit in limbo. I agree that for users, @ should be allowed as it is, but in case of some characters, it may lead to ambiguous interpretations of a resource.

However, for now, there is a problem with precent-encoded values as well. I do think those should be fixed as well -- in spec as well in snowcrash.

abtris avatar Mar 24 '14 14:03 abtris

@Neamar commented

Ok. So for now, there is no workarounds ? :(

On Mon, Mar 24, 2014 at 3:24 PM, Almad [email protected] wrote:

@Neamar https://github.com/Neamar I think @ is only allowed as %40. This makes things a bit complicated as we have to decide where and who should encode the special character.

This is currently a bit in limbo. I agree that for users, @ should be allowed as it is, but in case of some characters, it may lead to ambiguous interpretations of a resource.

However, for now, there is a problem with precent-encoded values as well. I do think those should be fixed as well -- in spec as well in snowcrash.

Reply to this email directly or view it on GitHubhttps://github.com/apiaryio/snowcrash/issues/90#issuecomment-38449993 .

abtris avatar Mar 26 '14 17:03 abtris

@zdne commented

@Neamar

This is a good question

Currently a parameter identifier is expected to conform to:

#define PARAMETER_IDENTIFIER "([[:alnum:]_.-]+)"

But as of RFC 6570 variables it should be:

varname  =  varchar *( ["."] varchar )
varchar    =  ALPHA / DIGIT / "_" / pct-encoded

This is a bug and should be fixed in Snow Crash. An explicit note on URI template variables might be added to API Blueprint spec (most likely 1B).

abtris avatar Apr 02 '14 11:04 abtris

@zdne commented

See https://github.com/apiaryio/snowcrash/issues/107

abtris avatar Jul 09 '14 14:07 abtris

@zdne commented

To be addressed with apiaryio/snowcrash#61

abtris avatar Jul 24 '14 08:07 abtris