-
Notifications
You must be signed in to change notification settings - Fork 49
Hal tries to extract entity when content negotiation is set to Json (then fails with exception) #38
Comments
Now I cannot remember what my ideas were. :-/ @jdelisle -- can you pull the current master branch and let me know if it still poses a problem? My guess is it does -- which would likely require that we change |
@jdelisle I've got a workaround: Use/create a different object for your entity than is listed in the configuration for the service. This will ensure that we don't call You have two ways of accomplishing that:
The first will definitely work -- if the entity type is not in the metadata map, then it won't attempt to serialize it. I think you might be suggesting that the latter option does not work. If that's the case, let's open an issue on zfcampus/zf-apigility-admin to fix that. Now, where it all falls down... if you want to allow serialization BOTH to plain JSON as well as HAL, as that would require that the entity type be in the metadata map for those cases where HAL is going to be used. Is that a scenario you are considering? |
Yeah, I believe either can work. The only problem with the second one is the admin recreating the entry in the metadata map on a Json resource. For the meantime anyway, I can just use a different entity. Should I still file an issue on zfcampus/zf-apigility-admin? It seems to me like it would be a good idea not to impose those entries. I'm only using JSON serialization at the moment, so I wouldn't need it in the metadata map. |
@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. |
Closing, as the real issue is on zf-apigility-admin. |
Resolution as mentioned below:
Transcript from IRC:
The text was updated successfully, but these errors were encountered: