Closed anentropic closed 8 years ago
ok, I found this syntax:
+ Attributes (object)
+ *123* (UserObject, optional) - example user, id=123
+ *456* (UserObject, optional) - example user, id=456
this seems to express what I want. The only issue I have is that drafter
parses this as:
-
element: "member"
meta:
description: "example user, id=123"
attributes:
typeAttributes:
- "optional"
content:
key:
element: "string"
attributes:
variable: true
content: "123"
value:
element: "UserObject"
How do I tell it that *123*
represents a number
variable rather than string
?
@anentropic it would be
# My Object
- *134 (number)* (UserObject)
However I am not sure if other but string-based keys are supported by the parser. It definitely won't render into JSON. May I ask where do you need this / what is the use case?
Oh, I forgot that JSON keys must be strings, I was still thinking in Python
I tried the syntax above but Apiary editor complains the blueprint is invalid
Anyway, the existing syntax correctly represents the output JSON with string keys so I don't have a problem after all.
Thanks
I can't see how to specify:
I want to describe a response that looks like
etc, where the keys are ids