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

Non-JSON MIME types #170

Open
multimeric opened this issue Sep 13, 2019 · 0 comments · May be fixed by #171
Open

Non-JSON MIME types #170

multimeric opened this issue Sep 13, 2019 · 0 comments · May be fixed by #171

Comments

@multimeric
Copy link
Contributor

I realise this has been discussed briefly at #13. However, we don't yet have a good solution.

The problem is this: I want my API to input and output data in both CSV and JSON format. When dealing with JSON I of course want to use the JSON API spec, and flask-rest-jsonapi should deal with that perfectly. The problem is, I don't want to duplicate all my code to also support CSV. I want the URLs, the schemas, and the models to be exactly the same as the JSON API. The only difference is that I want a hook that runs before loading and after dumping JSON data, when the Accept/Content Type header is csv, in order to convert to/from JSON. Is this possible?

@multimeric multimeric changed the title Non-JSON Accept MIME types Non-JSON MIME types Sep 13, 2019
@multimeric multimeric linked a pull request Sep 16, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant