Questions tagged [swagger-tools]

19 questions
24
votes
2 answers

"discriminator" in polymorphism, OpenAPI 2.0 (Swagger 2.0)

Referencing OpenAPI 2.0, Schema Object, or Swagger 2.0, Schema Object, and the definition of discriminator field as: Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema…
Musa Haidari
  • 1,929
  • 5
  • 25
  • 51
9
votes
1 answer

swagger tools error handler middleware not catching errors

overview My custom errorHandler middleware is not catching the swagger-tools request validator error. Instead, the swagger tools HTML error is sent back to the client. How can I get my errorHandler middleware to catch the swagger tools validation…
Chris Covney
  • 619
  • 1
  • 6
  • 10
3
votes
1 answer

Swagger Tools Production Build Node js

We implemented the swagger in our nodeJs application. As of now we are created production build using webpack and remove the controller and services file. bin/www.js const YAML = require('yamljs'); const swaggerTools =…
Raja Sekar
  • 89
  • 2
  • 3
  • 13
3
votes
1 answer

Swagger with custom configuration not loading params

I had been using Swagger with custom configuration and directory structure in node application. Here is snippet of my app.js var swaggerConfig = { appRoot: config.get('app_root'), configDir: 'swagger/config', swaggerFile:…
Nazar Hussain
  • 4,930
  • 5
  • 35
  • 63
2
votes
0 answers

Is there better way to implement OAuth security in swagger-tools API?

I prepared Swagger 2.0 definition for my API implemented on node.js/connect. I added security definitions: securityDefinitions: BasicAuth: type: basic OAuth2: type: oauth2 flow: accessCode authorizationUrl:…
mackojar
  • 21
  • 3
2
votes
0 answers

Combine multifile yaml in Javascript

I have my yaml files split up according to a structure like this: . ├── index.yaml ├── info │ └── index.yaml ├── definitions │ └── index.yaml │ └── User.yaml └── paths ├── index.yaml ├── bar.yaml └── foo.yaml index.yaml: swagger:…
TovrikTheThird
  • 369
  • 1
  • 5
  • 13
2
votes
1 answer

Terminate outgoing http requests when incoming client http request is terminated

Overview of app I have a node.js server application implemented with the express.js 4 module and the node.js core http module. At a high level, the app takes incoming client http messages, makes various http calls (using http module) to other…
Chris Covney
  • 619
  • 1
  • 6
  • 10
2
votes
1 answer

Swagger-UI Customization in Swagger-Tools

I want to be able to modify swagger-ui and it is currently beng served through the instance in swagger tools, which is the current dist folder of swagger-ui. I would like to modify the templates and more through main/templates which swagger tools…
user3221287
  • 307
  • 3
  • 9
2
votes
1 answer

Changing response code on request param validation failure with Swagger 2.0

I'm using Apigee 127 on top of swagger to create a REST API. This is the head of the configuration file swagger.yaml: swagger: 2.0 info: version: "0.0.1" title: LMS API Gateway # during dev, should point to your local machine host: localhost #…
Henrique Barcelos
  • 7,114
  • 1
  • 34
  • 61
1
vote
0 answers

Swagger-node - Capturing multer "Unexpected Field" error

I'm using swagger-node v0.7.5 for a small project that involves uploading a file. The file to be uploaded has been declared in the YAML file and it works as expected, but with the following wrinkle I haven't been able to solve. If the client sends…
1
vote
0 answers

How do I make sure APIs have been documented in Swagger file before starting Express app?

My node application creates three different express servers, each one listening on a different port. Each server has a different set of APIs, with some in common between the three servers. There is also a swagger.yaml file that should contain…
1
vote
1 answer

Swagger-codegen generated code having issues Routing requests with parameters in path

I created my api definition using swagger and have generated the server code using Swagger-tools in NodeJs. The SwaggerRouter handles all routes properly excepts the routes with ID. For example , routes like /v1/factoris/self /v1/factoris/create are…
0
votes
0 answers

Correct process to map api gateway to a swagger api

Lets say I have a nodejs app, and I have swagger tools integrated into it so that theres a swagger UI, swagger validation, swagger.json etc etc. I can deploy this to ECS Fargate and things would be fine. However if I want to put an API gateway in…
1977
  • 1,697
  • 2
  • 20
  • 25
0
votes
0 answers

How to migrate node app to aws api gateway

We have a nodejs application running on aws fargate. INside the app we use swagger 2.0 and render the swagger ui at /docs. The swagger defines our security scheme so that some endpoints can require a bearer jwt token in the Authroization header.…
1977
  • 1,697
  • 2
  • 20
  • 25
0
votes
1 answer

Possible to return 401 instead of 403 for expired token?

I want to be able to return a 401 on JWT token expiry (which I believe is the correct response?) but it returns a 403 no matter what here is where I tell swagger tools to use my bearer token verification…
1977
  • 1,697
  • 2
  • 20
  • 25
1
2