James Messinger

Results 225 comments of James Messinger

Good point! Thanks for the link to the W3C spec too, that's very helpful. This is definitely a bug and will be fixed.

Just to clarify... requests don't get "changed" to `OPTIONS` by CORS. The `OPTIONS` request is a separate request that occurs prior to the normal request. So, if a script in...

The Swagger Spec allows you to use `$ref` to re-use anything in your API spec. So you could just define the `OPTIONS` method once, and then reference it everywhere else...

The [default behavior of the Mock middleware](https://github.com/BigstickCarpet/swagger-express-middleware/blob/master/docs/middleware/mock.md#default-behavior) is not quite smart enough to determine your desired behavior in this case. It seems like a pretty reasonable and do-able expectation though,...

Oh yeah, that's right. The `default` and `example` functionality is just for `GET` requests. But you can still customize the behavior by [modifying the response](https://github.com/BigstickCarpet/swagger-express-middleware/blob/master/docs/middleware/mock.md#modifying-the-response) or [skip the Mock middleware...

@walshe - Swagger Express Middleware just throws errors, which can be handled using standard [Express error-handling middleware](https://expressjs.com/en/guide/error-handling.html). You can handle the error however you want, including changing the response code...

Yeah, I agree that the error messages aren't very user-friendly or easy to parse. The errors [ultimately come from tv4](https://github.com/APIDevTools/swagger-express-middleware/blob/9d19da25f83d46c69628a4fe9dc461de98f272cf/lib/helpers/json-schema.js#L201-L213), which is the JSON Schema validator that I use under...

This is by design. REST is about [resources](https://github.com/BigstickCarpet/swagger-express-middleware/blob/master/docs/exports/Resource.md), not endpoints. If a resource doesn't exist, then the proper response code is 404, _not_ 500 or 204. In the case of...

@alex-dow - Agreed. `/pets` is a _collection_ wheras `/pets/{petName}` is a _resource_, so Swagger-Express-Middleware treats them differently. Collections never return a 404. If the collection is empty (i.e. there's no...

Hi, @Santinell. Sorry for taking so long to reply. I just started a new job, so my schedule has been super busy lately. o_O I'm currently in the process of...