apigee-127 / swagger-node-runner

The heart of Swagger-Node
MIT License
102 stars 123 forks source link

CORS fitting not being configured with params in default.yaml #111

Open bergundy opened 6 years ago

bergundy commented 6 years ago

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?

theganyo commented 6 years ago

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

bergundy commented 6 years ago

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

theganyo commented 6 years ago

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.