OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Can't setup swagger - Cannot read property 'parameters' of undefined

  • Thread starter Thread starter Norayr Ghukasyan
  • Start date Start date
N

Norayr Ghukasyan

Guest
I am having a problem with setting up the swagger into my node.js application. I am using swagger-jsdoc and swagger-ui-express for creating documentation. Here are the versions

"swagger-jsdoc": "3.5.0", "swagger-ui-express": "4.1.3"

Below is the configs, which I pass to swagger-jsdoc.

Code:
openapi: 3.0.0
info:
  description: test
  version: 3.0.0
  title: U-CRM api documentation
  termsOfService: http://swagger.io/terms/
servers:
  - url: 'https://localhost:5000'
    description: Local server
tags:
- name: U-CRM
  description: CRM for university
components:
  parameters:
    $ref: 'components/parameters/index.yml'
  schemas:
    $ref: 'components/schemas/index.yml'
paths:
  $ref: '#/paths/index.yml'

After all, I get an error

Cannot read property 'parameters' of undefined

Actually, it is surprising to me, as I read swagger docs carefully. What could be the problem?

<p>I am having a problem with setting up the swagger into my node.js application. I am using <code>swagger-jsdoc</code> and <code>swagger-ui-express</code> for creating documentation. Here are the versions</p>

<blockquote>
<p>"swagger-jsdoc": "3.5.0", "swagger-ui-express": "4.1.3"</p>
</blockquote>

<p>Below is the configs, which I pass to swagger-jsdoc.</p>

<pre><code>openapi: 3.0.0
info:
description: test
version: 3.0.0
title: U-CRM api documentation
termsOfService: http://swagger.io/terms/
servers:
- url: 'https://localhost:5000'
description: Local server
tags:
- name: U-CRM
description: CRM for university
components:
parameters:
$ref: 'components/parameters/index.yml'
schemas:
$ref: 'components/schemas/index.yml'
paths:
$ref: '#/paths/index.yml'
</code></pre>

<p>After all, I get an error</p>

<blockquote>
<p>Cannot read property 'parameters' of undefined</p>
</blockquote>

<p>Actually, it is surprising to me, as I read swagger docs carefully.
What could be the problem?</p>
 

Latest posts

Top