drafter icon indicating copy to clipboard operation
drafter copied to clipboard

Old Parameter syntax should give warning when encountering Members

Open abtris opened this issue 9 years ago • 5 comments

@klokane opened apiaryio/snowcrash#355

As say Blueprint specification: https://github.com/apiaryio/api-blueprint/blob/master/API%20Blueprint%20Specification.md#def-uriparameters-section

Members is the optional enumeration of possible values. <type> should be surrounded by enum[] if this is present. For example, if enumeration values are present for a parameter whose type is number, then enum[number] should be used instead of number to.

But following definition is parsed without any warning or error

FORMAT: 1A
​
# Polls API Root [/]
​
## Questions collection [/questions{?page}]
​
+ Parameters
    + page (optional, number) ... The page of questions to return
        + Default: `2`, `3`

        + Members
            + 1
            + 2
            + 3

Valid definition should be+ page (optional, enum[number]) original definition should generate warning like URI parameter section for primitive types does not allows member section definition

abtris avatar Nov 18 '15 16:11 abtris

@pksunkara commented

page (optional, number) ... The page of questions to return

implies the parameter is old syntax. Which means it doesn't need the enum[] part. Members is new syntax enumeration which gets ignored since the parameter is old syntax.

+ page (optional, number) ... The page of questions to return
    + Default: 2
    + Values
        + 1
        + 2

is the actual correct thing here.

abtris avatar Nov 21 '15 06:11 abtris

@klokane commented

@XVincentX is it response to your question?

abtris avatar Nov 21 '15 09:11 abtris

@pksunkara commented

I have edited the issue to a better description and finalised the action that needs to be taken here.

abtris avatar Nov 23 '15 16:11 abtris

Guys I do not recall the question I asked, I guess it was very very old. What was that about @abtris ?

XVincentX avatar Oct 01 '18 20:10 XVincentX

I migrated all old issues from snowcrash into drafter.

abtris avatar Oct 02 '18 04:10 abtris