loopback-component-jsonapi
loopback-component-jsonapi copied to clipboard
Add json api content type as an option in loopback explorer
Currently its not possible to specify the accepts content type for json api in the loopback explorer. Its not currently possible to do this in a boot script or component but it is possible to do so globally. @bajtos has offered to land a patch in loopback to make this possible in a component/boot script which would help. See here:
https://github.com/strongloop/loopback/issues/445#issuecomment-142023238
ATM, it's not possible to customise the list of content types at route (method) level - see https://github.com/strongloop/loopback-swagger/blob/8eb73acbaae2cd600d03a95dcf55aee6f7560980/lib/specgen/route-helper.js#L161-L162.
However, you can customise this list at global level via options.consumes and options.produces passed to loopback-component-explorer, see https://github.com/strongloop/loopback-swagger/blob/8eb73acbaae2cd600d03a95dcf55aee6f7560980/lib/specgen/swagger-spec-generator.js#L22-L36
Start looking here: https://github.com/strongloop/loopback/issues/445#issuecomment-154102862
I've had a bit of a go at getting support added for this in loopback. (In loopback-swagger to be specific) It's harder than I thought and am waiting on more feedback from @bajtos
Thank you for spending so much time on this. You are actually the reason why i have decided not to drop loopback and move over to restify
Thanks @devotox! Really awesome to hear it!
has @bajtos given you any help with this yet?
@devotox not that I've heard
Yup. @bajtos has given me some ideas but will take a bit of work to submit pr to loopback etc. On Tue, 2 Feb 2016 at 19:18, Troy [email protected] wrote:
@devotox https://github.com/devotox not that I've heard
— Reply to this email directly or view it on GitHub https://github.com/digitalsadhu/loopback-component-jsonapi/issues/3#issuecomment-178732279 .