James Messinger

Results 225 comments of James Messinger

@meytal127 - You can workaround this using standard Express middleware. You could add a middleware function to remove any null fields from the request body _before_ the `parseRequest()` middleware, or...

If your API is served from the root directory, then your `basePath` should be empty (unset), _not_ a forward slash. You should only set `basePath` if your API is served...

Hmmm... I didn't realize Swagger Express was doing that. It's _technically_ incorrect, per the spec, but I'll add code to Swagger Express Middleware to handle it.

A PR would be greatly appreciated. I've got lots of other stuff on my plate right now, so I haven't been able to work on this project in months. :(

Currently the solution is to remove the `basePath` option, since it shouldn't be just a `/`.

This is actually done by the [Parse Request middleware](https://github.com/BigstickCarpet/swagger-express-middleware/blob/master/docs/middleware/parseRequest.md#parse-request-middleware), which is a [dependency](https://github.com/BigstickCarpet/swagger-express-middleware/blob/master/docs/middleware/validateRequest.md#dependencies) of the Validate Request middlware. Here's the relevant documentation: [**Phase 2 - Swagger parsing**](https://github.com/BigstickCarpet/swagger-express-middleware/blob/master/docs/middleware/parseRequest.md#phase-2---swagger-parsing) If `req.body` —...

Yeah, I can see how that would be confusing. I'll re-open this issue to remind me to add that info to the docs.

@swissspidy - Yes, the request body is validated against the schema in your Swagger API. So, in your example, if the body doesn't contain a `name` property, then an HTTP...

While this is a cool idea, and I like the blog post you linked to, I don't think this falls under the scope of what I want to include in...

For the first part... I don't like the idea of creating a CORS-ish middleware for non-CORS requests. Seems like a pretty specific use case and not general-purpose enough for a...