Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outdated provider signature w/ Buzzard #83

Closed
alexisabril opened this issue Nov 6, 2017 · 2 comments
Closed

Outdated provider signature w/ Buzzard #83

alexisabril opened this issue Nov 6, 2017 · 2 comments

Comments

@alexisabril
Copy link
Contributor

feathers-swagger uses the Auk & prior signature to create a new provider:

providers.push((path, service) => {});

Usage:
https://github.com/feathersjs-ecosystem/feathers-swagger/blob/master/src/index.js#L76

Reference in Auk:
https://github.com/feathersjs/feathers/blob/3756f99af7680b6e9e77b70d6e2f46efba1a6839/src/application.js#L49

This breaks in Buzzard, due to the swapping of path and service:

providers.push((service, path) => {});

Reference in Buzzard:
https://github.com/feathersjs/feathers/blob/d4688ca9874b242a9b453caddf117af27f8a0b01/lib/application.js#L115

A fix is to just swap the two parameters, however, I'm unsure how the Feathers team is handling 2.0 -> 3.0 breaking changes.

@alexisabril
Copy link
Contributor Author

From a discussion with @daffl: https://feathersjs.slack.com/archives/G62JKS5GF/p1510012938000055

const configurePlugin = (service, path) => {
  service.docs = service.docs || {};

  // Load documentation from service, if available.
  const doc = service.docs;

  // ...
}

if(app.version && app.version >= 3.0.0) {
  app.mixins.push(configurePlugin);
} else {
  app.providers.push((path, service) => configurePlugin(service, path));
}

daffl pushed a commit that referenced this issue Nov 8, 2017
Adding test for Buzzard provider API.
Refactoring mixin/plugin to be a separate function, allowing input parameters to swap depending on Feathers version.
@daffl
Copy link
Member

daffl commented Nov 8, 2017

Closed via #84

@daffl daffl closed this as completed Nov 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants