swagger-node-runner icon indicating copy to clipboard operation
swagger-node-runner copied to clipboard

CORS fitting not being configured with params in default.yaml

Open bergundy opened this issue 8 years ago • 3 comments

The call to create the CORS object in https://github.com/theganyo/swagger-node-runner/blob/master/fittings/cors.js#L11 passes an object that looks like:

{
  "name": "cors",
  "input": { "some": "params passed in default.yaml" }
}

Changing that line to:

  var middleware = CORS(fittingDef.input);

allows actually passing variables.

WDYT?

bergundy avatar Oct 17 '17 12:10 bergundy

Yeah, cool thought. Though it's a breaking change.

theganyo avatar Oct 17 '17 22:10 theganyo

@theganyo how is it breaking? What am I missing? Is there another way to configure the CORS middleware?

bergundy avatar Oct 21 '17 12:10 bergundy

Ah, I see. Sorry. Yes, I think you're right... the intent was to be able to configure it in the yaml, but it seems there should have been tests to verify that.

theganyo avatar Oct 23 '17 19:10 theganyo