apiaryio / mson

Markdown Syntax for Object Notation
MIT License
903 stars 180 forks source link

Use existing type definition in a One Of definition #86

Open njlittle opened 7 years ago

njlittle commented 7 years ago

Hi, and sorry for the API blueprint minimum example, I'd like to use a predefined type definition in a One Of definition, e.g.

FORMAT: 1A

# Data Structures

## Foo

+ foo
+ bar

# Group Foo

## GET /api/foo

+ Response 200 (application/json)

    + Attributes
        + One Of
            + baz
            + Properties
                + Include Foo

However, when I do so and run the result through aglio I get this error:

12:40 $ aglio -i foo.apib -o foo.html
>> { code: 4,
  message: 'Error parsing input: mixin base type should be the same as parent base type. objects should contain object mixins. arrays should contain array mixins',
  location: [],
  input: 'FORMAT: 1A\n\n# Data Structures\n\n## Foo\n\n+ foo\n+ bar\n\n# Group Foo\n\n## GET /api/foo\n\n+ Response 200 (application/json)\n\n    + Attributes\n\n        + One Of\n            + baz\n            + Properties\n                + Include Foo\n' }

Is there any way around this so I can re-use existing type definitions like this?

kamil-babula commented 6 years ago

i am trying to write something similar, i have tried everything but so far i was unsuccesful.

any suggestions?