drafter
drafter copied to clipboard
Old Parameter syntax should give warning when encountering Members
@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
@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.
@pksunkara commented
I have edited the issue to a better description and finalised the action that needs to be taken here.
Guys I do not recall the question I asked, I guess it was very very old. What was that about @abtris ?
I migrated all old issues from snowcrash into drafter.