You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
toFactories
. This is because theneomerx/json-api
package uses the nameFactory
so it would be more consistent to follow the same pattern.To do:
CodecMatcherRepository
toCodecMatcherFactory
. Change the method signature tocreateCodecMatcher($apiNamespace, $schemas, $urlPrefix)
for consistency. Move it to theCodec
namespace as that is where it is inneomerx/json-api
.defaults
set, i.e. bring it inline with the schemas repository.SchemasRepository
toSchemaContainerFactory
and change method signature tocreateSchemaContainer($apiNamespace)
. Move to theSchema
namespace as that is where it is inneomerx/json-api
.defaults
for adapters to apply to all stores, and then adapters per store. Factory should be in theStore
namespace for consistency.The text was updated successfully, but these errors were encountered: