1

I've got a resource with multiple parameters, and a single action with one extra. How can I write this with the minimal repeats?

Something like this, but that actually works:

## Items [/item{?type}]

+ Parameters
    + type (enum[string], optional)
        + Default: foo
        + Members
            + foo
            + bar

### List [GET {&from}]

+ Parameters
    + page (integer, optional)
        + Default: 1

All other actions should list type, while the GET should list both type and page.

OrangeDog
  • 36,653
  • 12
  • 122
  • 207
  • There is no simple way at the moment. The feature you'd like to see is the usage of MSON in Parameters and Headers https://github.com/apiaryio/api-blueprint-rfcs/pull/3 which is not implemented yet but is high on the roadmap so it might land soon(TM). –  Feb 06 '17 at 16:11
  • @wvi I'm not sure that it is. The MSON in Parameters already works, it just replaces instead of extends the parent. – OrangeDog Feb 06 '17 at 16:41
  • Hey there @OrangeDog, if I define a data structure with certain values, is it possible to change those values (but retain all structure, type and descriptions) in references to that data structure. I.e. if I made a `Person` object with *`name`*: `James Smith (string) - First and last name of person` and *`age`*: `32 (number) - Age of person`. Is it possible to instantiate a new `Person` who's `name` is `Jane Doe` and `Age` is `26` such that API Blueprint recalls that `Jane Doe` is a string with description "First and last name of person" and `Age` is a number with description "Age of person"? – zelusp Sep 14 '18 at 02:11
  • @OrangeDog [I elaborate here](https://stackoverflow.com/q/52335828/3491991) per chance it's useful/you could help. Thanks in advance :) – zelusp Sep 14 '18 at 16:24

0 Answers0