Skip to content

Use default response for mock if statusCode response not available #120

@penx

Description

@penx

Further to apigee-127/sway/issues/166

I think that the following lines:

https://github.com/theganyo/swagger-node-runner/blob/7f85797e74ee8a182ae9458ac8e2eb4db9c7a6c3/fittings/swagger_router.js#L120

Mean that, if a 200 statusCode is requested, but the spec does not explicitly list a 200 response, the mock does not use the default.

Instead I think this should read:

      var response  = operation.getResponse(statusCode) || operation.getResponse('default');
      var mock = response.getExample(mimetype);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions