apiaryio / api-blueprint

API Blueprint
https://apiblueprint.org
MIT License
8.65k stars 2.14k forks source link

Types defined in Data Structures not handled like those in Attributes #295

Closed alfaguru closed 8 years ago

alfaguru commented 8 years ago

If I define a type in an Attributes section of a resource, then it appears as expected in requests and responses when referenced.

But I have some common data types that are not resources (for example, the "pager" object of a list response). I tried defining these in a Data Structures section, and the types are recognised syntactically but in the generated requests and responses any instances of these types appear as empty objects.

As a workaround I created a group section for common data and created dummy resources with fake URLs, then added an Attributes section for each, removing them from Data Structures. My requests and responses are now generated as expected but this is not an ideal solution, clearly.

Is this a known issue?

zdne commented 8 years ago

Is this a known issue?

Yup, Apiary is still running on an older version of the API Blueprint parser. The latest includes the fix however it hasn't been deployed to the whole Apiary just yet.

zdne commented 8 years ago

@alfaguru see https://github.com/apiaryio/api-blueprint/issues/191

pksunkara commented 8 years ago

@alfaguru Can you paste the sample blueprint you have this problem on? This might be already know to us but I can't say for sure until I see the blueprint. Thanks.

pksunkara commented 8 years ago

Note: Might be an issue already know for which a PR is in the pipeline. https://github.com/apiaryio/drafter/pull/199

pksunkara commented 8 years ago

This has been fixed long ago. Closing this.