2

I want to search (say) "accounts" based on "name" or "status".

So I would like to have two actions :

  • GET /persons/?q=name==Jea*
  • GET /persons/?q=status==locked

How can I document that ?

I tried an Action with multiples transactions :

### GET /accounts{?q}

+ Request by name
    +Parameters
        +q (required, FIQLQuery)
        **Only name is supported**

+ Request by status
    +Parameters
        +q (required, FIQLQuery)
        **Only status is supported**

But Apiary editor complains because :

  1. I must provide a message-body for my GET requests:

    Message-body asset is expected to be a pre-formatted code block, every of its line indented by exactly 8 spaces or 2 tabs.

  2. The + Parameters block is not recognized :

    Ignoring unrecognized block

Thanks a lot

gervais.b
  • 2,294
  • 2
  • 22
  • 46

1 Answers1

0

i can make solution that works for me.

Try this API Blueprint:

FORMAT: 1A

# requestByname

## Accounts [/accounts/?{q,type}]

### GET

+ Parameters
    + q (required, FIQLQuery)
    + type (string, `name` or `status`)

+ Request Name (application/json)

+ Response 200

        {"name": "test"}

+ Request Status (application/json)

+ Response 200

        {"status": 200}
Ladislav Prskavec
  • 4,351
  • 3
  • 19
  • 16