Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

add action pipeline support #132

Closed
wants to merge 1 commit into from
Closed

Conversation

mgutz
Copy link

@mgutz mgutz commented Jun 13, 2014

This allows action to be an array of middleware instead of a single handler. For example, we have middleware to do oauth2 scope checks, role checks etc.

var operation = {
  spec: {...},
  action: [
    authorize({ scope: 'rwx:verification', audience: 'api' }),
    function (req, res) {
      // do work here   
    }
  ]
};

@fehguy
Copy link
Contributor

fehguy commented Jun 17, 2014

@jsdevel this looks good, any concerns?

// convert .{format} to .json, make path params happy
var fullPath = spec.path.replace(self.formatString, self.jsonSuffix).replace(/\/{/g, "/:").replace(/\}/g, "");
// convert .{format} to .json, make path params happy, remove trailing slash
var fullPath = spec.path.replace(self.formatString, self.jsonSuffix)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mgutz even though this is just formatting, I would prefer to see it in a separate commit.

@jsdevel
Copy link
Contributor

jsdevel commented Jun 17, 2014

@fehguy thanks for the include!

Ideally I'd like to see express leveraged to the max, but in this case I'm not sure how else we would go about it. @mgutz can you think of any other way we could accomplish this without changing swagger?

Overall, I feel these changes provide a lot of value and I'm also thankful that @mgutz provided tests!

@ablankenship10
Copy link

+1 on added value, definitely a must have.

@tcbeutler
Copy link
Contributor

Could really use this for route specific middleware...

@fehguy
Copy link
Contributor

fehguy commented Sep 11, 2014

Hi folks, we've been pretty busy with the swagger 2.0 release, which was Monday. Getting back to this shortly

@cheerfulstoic
Copy link

Any progress? ;)

@plumpNation
Copy link

Is this going in soon?

@fehguy
Copy link
Contributor

fehguy commented Jan 12, 2015

Not soon, we are discussing the architecture for the port to swagger spec 2.0 (per #180). At the same time looking at what changes an updated design (such as apigee-127, swagger-n) provide, and if we should work on those projects.

@ericrini
Copy link

+1 are you guys not accepting pull requests?

@plumpNation
Copy link

I have achieved this using the excellent middleware-flow module. I'm pretty sure it achieves the same thing.

@fehguy
Copy link
Contributor

fehguy commented Jun 3, 2015

Closing as #207 will completely replace the implementation in this project.

@fehguy fehguy closed this Jun 3, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants