danielgtaylor / aglio

An API Blueprint renderer with theme support that outputs static HTML
4.75k stars 480 forks source link

Is it possible to use Generic Named Types (decorators)? #326

Open 11mb opened 7 years ago

11mb commented 7 years ago

Is it possible to use Generic Named Types as described here: https://github.com/apiaryio/mson/blob/master/MSON%20Specification.md

and here: https://apiblueprint.org/documentation/mson/specification.html#53-generic-named-type

example:

# Address Decorator (*T*)
    - address

# Person (object)
   - `first_name`
   - `last_name`

Use as:

- `decorated_person` (Address Decorator(Person))

Implies the same structure as:

- decorated_person (object)
- `first_name`
- `last_name`
- address

When I use it in my document, aglio throws the following error:

message: 'Error parsing input: base type \'Address Decorator(Person)\' is not defined in the document'

zkmoney commented 7 years ago

@11mb Same here. Did you have any luck with this?

11mb commented 7 years ago

@zkmoney unfortunately, no. I ended up with duplicated code in my document.

zkmoney commented 7 years ago

That is a shame. Thank you for the update

On Thu, Apr 20, 2017 at 3:21 AM 11mb notifications@github.com wrote:

@zkmoney https://github.com/zkmoney unfortunately, no. I ended up with duplicated code in my document.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/danielgtaylor/aglio/issues/326#issuecomment-295608049, or mute the thread https://github.com/notifications/unsubscribe-auth/ATM25bWNJF5RUvRogkbdEjF9h-ktenHpks5rxweBgaJpZM4MqIaJ .

-- Zachary Kilgore Senior Engineer @ Raise Marketplace, Inc.

njlittle commented 7 years ago

:+1: for this, not sure if #321 is a duplicate or not though