Skip to content
This repository has been archived by the owner on Apr 11, 2018. It is now read-only.

Switch off body validation #27

Open
balazsnemeth opened this issue Jun 9, 2016 · 3 comments
Open

Switch off body validation #27

balazsnemeth opened this issue Jun 9, 2016 · 3 comments

Comments

@balazsnemeth
Copy link

Can I scitch off the data validation for a path, or globally?

Actually, even if I override a post, the body validation is still happaning, and I would like to override post to avoid body validation.

@balazsnemeth balazsnemeth changed the title Switch off validation Switch off body validation Jun 9, 2016
@JamesMessinger
Copy link
Owner

Not in Swagger Server, but you can do that by using Swagger Express Middleware directly.

@balazsnemeth
Copy link
Author

balazsnemeth commented Jun 9, 2016

Can I access it with my swagger object:

var swagger = require('swagger-server'),

I mean something like

swagger.middleware.validateRequest(false)

or this is not as simple?

Sorry for my dummy question, I'm a FE developer just I need to mock my backend for a while, and I choosed swagger-server but that body validation makes my mocking so difficult :(

@JamesMessinger
Copy link
Owner

That's a great idea! Currently, Swagger Server abstracts the middleware away, so there's no way for you to directly access it. But I like the idea of providing a way to turn middleware on/off, edit its settings, etc.

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

No branches or pull requests

2 participants