2014-12-17 4 views
1

Этот ресурс чертежа дает мне проблемы.Определение ресурса API Blueprint не работает правильно

#Group Data Ingress 

## Inbound SMS [/api/v1/inboundSMS{?number,message,key}] 

### Receive [GET] 

+ Request 

    + Parameters 

     + number (int) ... The number the sms originated from 
     + message (string) ... The message content 
     + key (string) ... The inbound authentication key as defined in the application configuration 

+ Response 200 (text/plain) 

    + Body 

      OK 

Как вы можете видеть его простой запрос GET, т.е. http://my-host.com/api/v1/inboundSMS?number=123&message=hello%20world&key=SECRETKEY

Но я адресности ошибку от apiary.io

Line: 543 (The request line) Empty request message-body. 
Line: 545 (The parameters line) Ignoring unrecognized block. 

Как это запрос GET нет сообщений поэтому я не знаю, почему его жалуются на то, что он пропал без вести.

ответ

1

Эта ошибка объясняется тем, что вы определили «запрос» без заголовков или тела. Раздел «Параметры» находится вне «Запроса».

Вы можете удалить раздел запроса и добавить раздел Параметры на внешнем уровне, следует удалить эту ошибку:

## Inbound SMS [/api/v1/inboundSMS{?number,message,key}] 

### Receive [GET] 

+ Parameters 

    + number (int) ... The number the sms originated from 
    + message (string) ... The message content 
    + key (string) ... The inbound authentication key as defined in the application configuration 

+ Response 200 (text/plain) 

    + Body 

      OKAY 

Вы также можете переместить раздел Параметры к ресурсу вместо размещения его в действии , Таким образом, он будет использоваться для всех действий внутри ресурса.

## Inbound SMS [/api/v1/inboundSMS{?number,message,key}] 

+ Parameters 

    + number (int) ... The number the sms originated from 
    + message (string) ... The message content 
    + key (string) ... The inbound authentication key as defined in the application configuration 

### Receive [GET] 

+ Response 200 (text/plain) 

    + Body 

      OKAY