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

Using an override representation class can cause errors #18

Closed
atuttle opened this issue Jan 15, 2011 · 5 comments
Closed

Using an override representation class can cause errors #18

atuttle opened this issue Jan 15, 2011 · 5 comments

Comments

@atuttle
Copy link
Owner

atuttle commented Jan 15, 2011

Because the default mime type is inspected at api startup and a custom representation class can be overridden on a per-resource basis (which doesn't necessarily have to implement the global default mime type), an exception would be thrown if the override representation class doesn't implement the default mime and none is specified.

@shiftyp
Copy link

shiftyp commented Jun 20, 2011

Does this issue also cover the reverse case where a custom representation specified in a resource implements a mime type that is not implemented by the default representation class, and the API doesn't recognize the additional mime type for requests to that resource?

@atuttle
Copy link
Owner Author

atuttle commented Jun 20, 2011

Yes, thanks for adding that.

@atuttle
Copy link
Owner Author

atuttle commented Nov 14, 2011

I think one solution to this might be an additional argument to the representationOf method. In addition to passing in the data and the custom representation class, you would specify the format that should be used (unless the class only implements one).

@atuttle
Copy link
Owner Author

atuttle commented Jun 26, 2012

After much thought, I've decided that custom representation class overrides are just a bad idea. They create more problems than they solve (do they solve any problems at all?!) and trying to work around this problem born of this abortion of a feature is just not worth it.

Instead of representation class overrides, just put every supported return format into one representation class. Problem solved!

If anyone can provide a valid use-case for overrides then we can re-open this ticket. Otherwise, consider this feature deprecated in 1.1 and slated to be removed in 2.0.

@atuttle atuttle closed this as completed Jun 26, 2012
@atuttle atuttle reopened this Oct 8, 2012
@atuttle
Copy link
Owner Author

atuttle commented Sep 20, 2013

Removed in 2.0

@atuttle atuttle closed this as completed Sep 20, 2013
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

2 participants