Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Use existing type definition in a One Of definition #86

Open
njlittle opened this issue Sep 13, 2017 · 1 comment
Open

Use existing type definition in a One Of definition #86

njlittle opened this issue Sep 13, 2017 · 1 comment

Comments

@njlittle
Copy link

njlittle commented Sep 13, 2017

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
Copy link

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

any suggestions?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants