This repository was archived by the owner on Nov 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
This repository was archived by the owner on Nov 8, 2024. It is now read-only.
Confusing AST for enum examples #734
Copy link
Copy link
Open
Labels
Description
Suppose such doc:
# My API
# Data Structures
# Plan
+ kind (string)
+ Sample: free
Drafter generates such AST for samples section
samples:
element: "array"
content:
-
element: "string"
content: "free"
It's logically correct: samples for string element is an array of strings.
Suppose such doc:
# My API
# Data Structures
# Plan
+ kind (enum)
+ free
+ premium
+ Sample: free
Drafter generates such AST for samples section:
...
samples:
element: "array"
content:
-
element: "enum"
content:
element: "string"
attributes:
typeAttributes:
element: "array"
content:
-
element: "string"
content: "fixed"
content: "free"
I think element: "enum" is incorrect in this case. Samples for such enum should be strings from the set "free", "premium", but not a new enum type which contains single string element. So in my opinion correct sample should be something like:
samples:
element: "array"
content:
-
element: "string"
content: "free"
Reactions are currently unavailable