Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Invalid Inheritance issue #52

Open
jenschude opened this issue Feb 22, 2017 · 1 comment
Open

Invalid Inheritance issue #52

jenschude opened this issue Feb 22, 2017 · 1 comment
Labels

Comments

@jenschude
Copy link

When using the RAML below in Osprey and with the workaround from #50 I get following error:

Error: Invalid inheriance array -> [{:type "array", :items {:type "any"}}]
    at /workspace/osprey-raml1.0/node_modules/datatype-expansion/node/datatype_expansion/canonical_form.js:582:12
    at cljs.core.MultiFn.call.G__10851__3 (/workspace/osprey-raml1.0/node_modules/datatype-expansion/node/cljs/core.js:33372:108)
    at cljs.core.MultiFn.call.G__10851 [as call] (/workspace/osprey-raml1.0/node_modules/datatype-expansion/node/cljs/core.js:33628:20)
    at /workspace/osprey-raml1.0/node_modules/datatype-expansion/node/datatype_expansion/canonical_form.js:530:138
    at /workspace/osprey-raml1.0/node_modules/datatype-expansion/node/cljs/core.js:17998:135
    at /workspace/osprey-raml1.0/node_modules/datatype-expansion/node/cljs/core.js:7639:96
    at Function.cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3 (/workspace/osprey-raml1.0/node_modules/datatype-expansion/node/cljs/core.js:7640:3)
    at Function.cljs.core.reduce.cljs$core$IFn$_invoke$arity$3 (/workspace/osprey-raml1.0/node_modules/datatype-expansion/node/cljs/core.js:7744:29)
    at Function.cljs.core.mapv.cljs$core$IFn$_invoke$arity$2 (/workspace/osprey-raml1.0/node_modules/datatype-expansion/node/cljs/core.js:17997:52)
    at cljs$core$mapv (/workspace/osprey-raml1.0/node_modules/datatype-expansion/node/cljs/core.js:17978:23)

Btw the error message should state Invalid inheritance ;)

#%RAML 1.0
title: Example API
types:
    PagedQueryResponse:
        type: object
        properties:
            count:
                type: integer
            total:
                type: integer
            offset:
                type: integer
            results:
                type: Resource[]
    ProductPagedQueryResponse:
        type: PagedQueryResponse
        properties:
            results:
                type: Product[]
    Resource:
        type: object
        properties:
            id:
                type: string
            version:
                type: integer
            createdAt:
                type: datetime
            lastModifiedAt:
                type: datetime
    Product:
        type: Resource
        properties:
            key?:
                type: string
/products:
  get:
    queryParameters:
      sort:
        enum: [username, name]
    responses:
      200:
        body:
          application/json:
            type: ProductPagedQueryResponse

When removing the results property from PagedQueryResponse the RAML works.

@goodevilgenius
Copy link

Removing the results from ProductPagedQueryResponse also fixes it.

I think the problem is that it doesn't recognize Product[] as extending from Resource[].

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

No branches or pull requests

3 participants