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

Allow packages to add configuration to API definitions #29

Closed
6 tasks
lindyhopchris opened this issue Nov 8, 2016 · 1 comment
Closed
6 tasks

Allow packages to add configuration to API definitions #29

lindyhopchris opened this issue Nov 8, 2016 · 1 comment

Comments

@lindyhopchris
Copy link
Member

We have the need to add configuration to an API definition from multiple packages rather than a single configuration file. This is because we are composing APIs from separate Composer packages, that each need to add their configuration to a specific API's definition. This isn't a major change or too much added complexity - the interfaces just need to be updated to allow partial config to be added.

At the same time it would be good to rename Repositories to Factories. This is because the neomerx/json-api package uses the name Factory so it would be more consistent to follow the same pattern.

To do:

  • Rename CodecMatcherRepository to CodecMatcherFactory. Change the method signature to createCodecMatcher($apiNamespace, $schemas, $urlPrefix) for consistency. Move it to the Codec namespace as that is where it is in neomerx/json-api.
  • Codec matcher factory needs to support codecs per API definition and a defaults set, i.e. bring it inline with the schemas repository.
  • Need to be able to add partial configuration to the code matcher factory - i.e. add to the configuration.
  • Rename SchemasRepository to SchemaContainerFactory and change method signature to createSchemaContainer($apiNamespace). Move to the Schema namespace as that is where it is in neomerx/json-api.
  • Need to be able to add partial configuration to the schemas factory - i.e. add to the configuration.
  • Need a store factory that builds a store for a specific API. Again, the config needs to follow the same pattern of defaults for adapters to apply to all stores, and then adapters per store. Factory should be in the Store namespace for consistency.
@lindyhopchris lindyhopchris added this to the 0.7.0 milestone Nov 8, 2016
@lindyhopchris lindyhopchris removed this from the 0.7.0 milestone Feb 27, 2017
@lindyhopchris
Copy link
Member Author

Closing this as no longer required. In the laravel-json-api package, ResourceProviders have been added that allow packages to add resources to an API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant