0

The ApiaryIO spec—actually the RFC to which it points—indicates that you cannot use "." in a parameter name, you need to encode it to "%2E". That's fine, but there seems to be a bug where Apiary can only handle one such encoding. For example, the following

## Notes Collection [/notes{?foo%2Ebar}]

yields the following Code Example

request = Request('http://private-d1ee7-testingnewapiary.apiary-mock.com/notes?foo.bar=foo.bar')

which is correct. However, the following

## Notes Collection [/notes{?foo%2Ebar,baz%2Ebla}]

yields this Code Example:

request = Request('http://private-d1ee7-testingnewapiary.apiary-mock.com/notes?foo%252Ebar=foo%252Ebar&baz%252Ebla=baz%252Ebla')

Notice how in the first the Code Example you see it has "foo.bar" but in the second example it has "foo%252Ebar", which is incorrect.

The downstream effect here is that the incorrect URI is sent to the API server so the response is malformatted creating an error.

How do I encode many "."-containing parameters on the URI template and still get the proper code examples?

1 Answers1

0

Will adding explicit example values for those parameters help?

For example:

## Notes Collection [/notes{?foo%2Ebar,baz%2Ebla}]
+ Parameters
    + foo%2Ebar (`42`)
    + baz%2Ebla (`24`)

Update

This seems to be a bug in the way the documentation / code samples are rendered. I have created the tracking issue here https://github.com/apiaryio/language-templates/issues/36.

Zdenek
  • 3,653
  • 27
  • 34
  • No, that doesn't help. It's still double-encoded ("%252e"): ```+ address%2Ecity (optional, string, `Austin`) ... The building's city``` becomes ```address%252Ecity=Austin```. – Jason Vertrees Jan 28 '15 at 14:43
  • what language example is this in? – Zdenek Jan 28 '15 at 14:55
  • Jason, this looks like a bug on our side, I have created the issue on to appropriate repo and will try to fix it as soon as possible! Sorry about this. – Zdenek Feb 01 '15 at 20:37