1

In my blueprint I'm defining a data structure and try to use it like so

+ Attributes

    + error: (Error Details, required)

Data structure definition at the end of the document:

# Data Structures

## Error Details
+ code : 1234 (number, required) - see list of error codes
+ message: User not found (string, required) - a human-readable error message

The resulting sample response body looks just like expected but the validation on apiary.io shows semantic issues for each of the places where I use constructs like this, saying "No value(s) specified".

Am I doing something wrong or is it a problem with the apiary.io parser?

Marcus Ilgner
  • 6,935
  • 2
  • 30
  • 44

3 Answers3

4

I had the same problem and solved it by

  1. omitting the colon

  2. separating the object definition and type (see owner in this example):

    Company (object)

    • name: Company name (string)
    • owner (OwnerResponse) (object)
Community
  • 1
  • 1
daremachine
  • 2,678
  • 2
  • 23
  • 34
0

Attribute section can be also defined as + Attributes <Type Definition> (specification), so defining + Attributes (Error Details, required) should fix the given semantic issue.

Edit:

You have to omit a colon between attribute's name and its type, when an example value is not defined:

+ Attributes

    + error (Error Details, required)

Missed that before, sorry.

Rob Bednark
  • 25,981
  • 23
  • 80
  • 125
izi
  • 1
  • 1
  • Unfortunately that would only work in this very specific instance. If the attribute type is, for example, an enum, it doesn't. I want to avoid repeating the enum definition in multiple places but specifying a sample value would duplicate that value in the list of allowed values on apiary.io, too. – Marcus Ilgner Mar 16 '17 at 15:21
0

A similar answer to other current answers, but none the less this fixed it for me.

No good:

+ Attributes
    + `status`: OK
    + `data`:
        + 5 (Channeldata)
        + 7 (Channeldata)

Fix:

+ Attributes
    + `status`: OK
    + `data`
        + 5 (Channeldata)
        + 7 (Channeldata)

As others have noted, losing a colon in the right place can fix things.

Jonny
  • 15,955
  • 18
  • 111
  • 232