Questions tagged [swagger-node-express]

Swagger module for the Express web application framework for Node.js

Swagger module for the Express web application framework for Node.js

40 questions
35
votes
11 answers

No operations defined in spec! - I get this error even though the swagger is setup and the end points are defined

I am trying to setup swagger on top of my node application using the swagger npm package. I have my end points and swagger setup perfect(atleast almost perfect), I did do quiet a lot of research on whats going wrong but I couldn't find the trace.…
Saranya Garimella
  • 465
  • 1
  • 5
  • 12
22
votes
2 answers

How do I get started with swagger-ui

What is swagger-ui and what is the use of it? I have visited http://swagger.io/, but I need more information. Please guide me.
6
votes
3 answers

Error returning boolean in Swagger-Node

I'm new to swagger-node and I am creating an API method that returns data of type boolean. The yaml of the method is: /IsBooting: get: summary: "Returns if the device is booting" description: "Returns true when is in booting state" …
Ruben Aguilar
  • 1,205
  • 11
  • 19
4
votes
1 answer

Angular 13 : has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource

Can someone help me please, I have a problem in CORS policy and I have no access to the backend of the site. This is the code I use in the backend (node.js): app.use(cors({ Access_Control_Allow_Origin: "*", origin:"*", …
4
votes
0 answers

Update Swagger during runtime

In my internship we are developing an API for a website to control various products. Each product has a so called connector that exposes the different endpoints that can be used for that product. When we add a new product, we have to restart the…
Jules
  • 546
  • 2
  • 11
  • 36
4
votes
2 answers

Implementing a void in swagger documentation

I can't figure out how to implement a swagger (using a swagger-node-express project) function in node that just returns the response code For instance for this swagger path: /api/user/create: x-swagger-router-controller: api get: operationId:…
Daan Luttik
  • 2,781
  • 2
  • 24
  • 37
3
votes
0 answers

Swagger UI running in Docker uses internal port; can't use try out function

Using swagger-node I setup a project using Express and swagger-ui-express. Dockerfile FROM node:8-alpine WORKDIR /opt/app COPY package*.json ./ RUN yarn install COPY . . CMD [ "yarn", "start" ] docker-compose.yaml version: "3" services: app: …
Robert Strauch
  • 12,055
  • 24
  • 120
  • 192
3
votes
0 answers

Swagger define default header value for a response in swagger.yaml

I'm using swagger-express-mw (swagger-node https://github.com/swagger-api/swagger-node) for api and I would like to set one header field to a specific value for all the api endpoints. Instead of setting it in code for each endpoint, I would like to…
Ville Miekk-oja
  • 18,749
  • 32
  • 70
  • 106
3
votes
1 answer

Is it possible to add a login page before Swagger ui?

I need to add a separate login page before Swagger UI for authentication from another server. From this request I will get a key which I have to add in the header of every req from swagger UI. I'm using a node server and swagger-tool with swagger…
3
votes
0 answers

Swagger is using API version out of date

I'm trying to use Swagger to document my API. Currently I threw together a quick express app using node. I'm using swagger-node-express and trying to setup a basic GET following their example about the Pet store. I getting the following error when…
Ryan Gill
  • 1,728
  • 2
  • 13
  • 27
3
votes
1 answer

anyOf: {$ref} in swagger JSON schema definition

I try to use swagger for describing a JSON API. So far it looks good, but I can't figure out how to use the anyOf structure for defining an array of different object types in a JSON answer. The following JSON Schema is valid, and it should describe…
TheEye
  • 9,280
  • 2
  • 42
  • 58
2
votes
1 answer

How to deploy node.js application and node.js express applicaion on IIS

I have created Node.js application on Visual studio 2019, and I want to deploy it on IIS. How I can deploy node.js application and Node.js express applications on IIS on local system I have tried many solutions but none of them completely helpful…
2
votes
0 answers

Swagger-ui 3.x not creating index.html after building dist

I'm trying to using swagger-ui to document my node.js API. I have cloned the latest repository (3.x) into my repository. When i run sudo npm run build to create the dist folder, it generates several files but it doesn't create index.html . The files…
2
votes
1 answer

How to bind a helper stub to swagger-node with supertest?

I am using Swagger Node with express and I initialized the skeleton project. Swagger project create hello-world Then inside the hello-world/api/controllers/hello_world.js I added a small modification to require a helper hello_helper.js and call its…
Quinma
  • 1,436
  • 2
  • 17
  • 39
1
vote
1 answer

Change swagger mock default response

I'm currently using Swagger node.js and I am able to get a response through swagger with the mock option enabled (swagger project start -m) However, when I hit the API, the mock response is very primitive. "description": "Sample text", …
Omri L
  • 739
  • 4
  • 12
1
2 3