Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apiary: Is there a way to define options for parameters?

I would like to define options for Apiary parameters, I'm currently listing them in the description:

  • measurement = m (optional, string, m) ... measurement e.g. m = meters, km = kilometers, yd = yards, mi = miles
like image 662
AEQ Avatar asked Dec 19 '22 13:12

AEQ


2 Answers

You can enumerate the possible values of an URI query parameter and discuss it in the parameter discussion like so:

+ Parameters
    + measurement = `m` (optional, string) ... measurement units

        Any discussion here...

        e.g. explanation of **values** listed bellow are.

        + Values
            + `m`
            + `mi`
            + `yd`

Also see the Documenting query parameters with API Blueprint question.

like image 155
Zdenek Avatar answered Dec 26 '22 20:12

Zdenek


You can define the optional parameters in the endpoint as below:

/api/data{?measurement}
like image 36
julien bouteloup Avatar answered Dec 26 '22 20:12

julien bouteloup