-
Notifications
You must be signed in to change notification settings - Fork 17
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
[Question] Any hints on best way to support swagger response/model parsers? #4
Comments
Hi @rromanchuk, unfortunately I haven't found any simple way to provide such support. But the big problem with this approach is : Impossible to figure the attribute type directly from the serializer. If your serializer serializes a database model, then we have to manage the dependencies with the different ORMs... like you said, that's a headache. I'll keep you posted if I manage to find a better solution, meanwhile, feel free to share any ideas you might have on that matter |
@rromanchuk I think you might be interested by this branch I've been working on. There is also an open pull request but it needs some testing and some reviews before merging. When you have time, would you let me know if it is any close to answer your question? # Gemfile
gem 'grape_fast_jsonapi', git: 'git://github.com/EmCousin/grape_fast_jsonapi.git', branch: 'feature/swagger_model_parser' |
@EmCousin that's what i figured. i know it kind of defeats the entire purpose, but i'm almost tempted to make non-jsonapi decorator just for documentation purposes, although good luck to me keeping that maintained. In context of my client code, the jsonapi response is actually obfuscated away and is flattened to be used in mapping the local object graph. I'm basically just trying to avoid (or non backend developers) having to look at serializer files to look at which properties/datatypes are returned. I mean i might be even overthinking it, i think swagger has an |
sweet, looking now! |
closing, tracked in #5 |
Basically i want to be able to support https://github.com/ruby-grape/grape-swagger#response-documentation-
It looks like you can provide custom parsers, but I haven't really dug much more into this
https://github.com/ruby-grape/grape-swagger#model_parsers
Just wondering if you have tried adding response support for swagger + grape + fast_jsonapi, or if there is an approach that isn't going to end up being a major headache?
The text was updated successfully, but these errors were encountered: