laminas-api-tools / api-tools-admin

Laminas API Tools Admin module
https://api-tools.getlaminas.org/documentation
BSD 3-Clause "New" or "Revised" License
13 stars 21 forks source link

The metadata map is being re-populated on updates to the service #47

Open michalbundyra opened 4 years ago

michalbundyra commented 4 years ago

This causes issues with resources returning Json representations.

weierophinney:

@jdelisle Yes, please open an issue on zfcampus/zf-apigility-admin; basically, we shouldn't be re-populating the metadata map on updates to the service, and that's the problem you're having.

See https://github.com/zfcampus/zf-hal/issues/38


Originally posted by @jdelisle at https://github.com/zfcampus/zf-apigility-admin/issues/209

michalbundyra commented 4 years ago

This will be harder than I thought to achieve. We actually do need to repopulate the metadata map in instances where the entity or collection are changed, or the hydrator. I'm not sure if we'll be able to resolve this; we may need to instead document workarounds.


Originally posted by @weierophinney at https://github.com/zfcampus/zf-apigility-admin/issues/209#issuecomment-49944154

michalbundyra commented 4 years ago

Okay, I'm going to go back to the alternative you suggested in https://github.com/zfcampus/zf-hal/issues/38#issuecomment-49212676:

Create a different entity type in your service [than the one defined in the metadata map], and make sure your resource class returns entities using that type.


Originally posted by @jdelisle at https://github.com/zfcampus/zf-apigility-admin/issues/209#issuecomment-49946298