1

apiary shows me how to add descriptions to the parameter. However, what I need is having descriptions on the value.

For example /users{?skills}. I have my own skill codes for this parameter

'1' means can speak English

'2' means can swim

'3' means can drive

Adding them after the parameter description is way to do it. What if I have tones of skill codes? And the formatting of this approach is ugly. How can i achieve it?

Zdenek
  • 3,653
  • 27
  • 34
ATNASGDWNGTH
  • 876
  • 11
  • 26

1 Answers1

0

There is currently no way to achieve it by using standard instruments of API Blueprint.

Neither

+ Values
    + `A - means something`
    + `B`
    + `C`

or

+ Values
    + `A` means something
    + `B`
    + `C`

will work correctly. I filed a feature request under API Blueprint's repository. If you want to be part of the design process and help us to get the best solution to your problem, you can track it and comment under it.

Appearance

I understand that rendering of this feature isn't very nice in standard docs.

enter image description here

However, in "beta new docs", it looks much better. Try it out - in settings, turn on following switch:

enter image description here

Then the rendering should look like this (two states):

enter image description here

enter image description here

Using tables

When in troubles with API Blueprint, you can always use plain old Markdown in endpoint's description to supplement or substitute what's missing. E.g. you can freely use tables as an addition or replacement to the Values section:

# My API

## Sample [/endpoint{?id}]

Description.

| Value        | Meaning          |
| ------------ |:----------------:|
| A            | Alaska           |
| B            | Bali             |
| C            | Czech Republic   |

+ Parameters

    + id (string)

        Description...

        | Value        | Meaning          |
        | ------------ |:----------------:|
        | A            | Alaska           |
        | B            | Bali             |
        | C            | Czech Republic   |

        Description...

        + Values
            + `A`
            + `B`
            + `C`

Rendering of tables in old and new docs:

enter image description here

enter image description here

Honza Javorek
  • 8,566
  • 8
  • 47
  • 66