Edub
Edub

Reputation: 540

Blueprint API show all possible values for Enum in Response Body

When writing an API-Deocumentation for an rest-service I came across an problem where I wanted to list all the possible Values which could be returned as a response.

In the case below it would be the "state" field which could contain any possible value of a enumeration and I wanted to sum up which possible states there are.

I could not find an easy and nice way to do it with apiblueprint. Is there a way to display sections collapsed by default and expand them when additional information is needed?

Here is the Sample code I have:

## Sample [/Sample?{id}]
Get all the information for the sample

+ Parameters
   + id = `0` (Integer, optional) ... The Id of the resource to get

+ Model (application/json)

  + Body

            {
                "name": "Name of the Resource",
                "state": "deleted"
            }

### Retrieve the sample data of the system [GET]
+ Response 200
  [ProviderConfiguration][]

I need something like "Values" for the parameters section but for the Body part to describe the state in the Body section e.g.

<collapsible>   
+ state (EnumType) ... current state of the sample object
  + Values
     + `active`
     + `inactive`
     + `deleted`
</collapsible>

Upvotes: 3

Views: 2857

Answers (1)

Honza Javorek
Honza Javorek

Reputation: 8816

Unfortunately, this is not yet possible with API Blueprint. However, it's planned - see https://github.com/apiaryio/api-blueprint/issues/25 and https://github.com/apiaryio/mson.

Upvotes: 2

Related Questions