Marcus Ilgner
Marcus Ilgner

Reputation: 7241

API Blueprint: Semantic Issue "no value(s) specified"

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?

Upvotes: 1

Views: 1753

Answers (3)

daremachine
daremachine

Reputation: 2798

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)

Upvotes: 4

izi
izi

Reputation: 1

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.

Upvotes: 0

Jonny
Jonny

Reputation: 16338

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.

Upvotes: 0

Related Questions