Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashing on in-line schema, moving under definitions resolves it #10

Open
netmilk opened this issue Oct 23, 2018 · 1 comment
Open

Crashing on in-line schema, moving under definitions resolves it #10

netmilk opened this issue Oct 23, 2018 · 1 comment

Comments

@netmilk
Copy link

netmilk commented Oct 23, 2018

The Error

$ morphling bash
Container ID is:
584d6828db74
Bashing into Morphling.. Type exit to exit.
root@584d6828db74:/usr/app# pm2 log
[TAILING] Tailing last 15 lines for [all] processes (change the value with --lines option)
  0|server  | Error in getDB TypeError: Cannot read property 'replace' of undefined
  0|server  |     at getReferencesAndCount (/usr/app/src/utils/createRouterFromSwagger.js:189:46)
  0|server  |     at /usr/app/src/utils/createRouterFromSwagger.js:125:29
  0|server  |     at dispatch (/usr/app/node_modules/koa-router/node_modules/koa-compose/index.js:44:32)
  0|server  |     at next (/usr/app/node_modules/koa-router/node_modules/koa-compose/index.js:45:18)
  0|server  |     at /usr/app/node_modules/koa-router/lib/router.js:345:16
  0|server  |     at dispatch (/usr/app/node_modules/koa-router/node_modules/koa-compose/index.js:44:32)
  0|server  |     at /usr/app/node_modules/koa-router/node_modules/koa-compose/index.js:36:12
  0|server  |     at dispatch (/usr/app/node_modules/koa-router/lib/router.js:350:31)
  0|server  |     at dispatch (/usr/app/node_modules/koa-compose/index.js:42:32)
  0|server  |     at dispatch (/usr/app/node_modules/koa-router/lib/router.js:332:32)
  0|server  | (node:17) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.

The OpenAPI 2 document

swagger: "2.0"

info:
  version: 1.0.0
  title: Simple API
  description: A simple API to learn how to write OpenAPI Specification

schemes:
  - https

host: simple.api
basePath: /


paths:
  /persons:
    get:
      summary: Gets some persons
      description: Returns a list containing all persons.
      responses:
        200:
          description: A list of Person
          schema:
            type: array
            items:
              required:
                - username
              properties:
                firstName:
                  type: string
                lastName:
                  type: string
                username:
                  type: string

@netmilk netmilk changed the title Crashing on in-line schemas, moving under definitions resolves it Crashing on in-line schema, moving under definitions resolves it Oct 23, 2018
@vroudge
Copy link
Contributor

vroudge commented Oct 23, 2018

Thanks for the feedback! Would you be willing to submit a PR on this?

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

No branches or pull requests

2 participants