loopback-component-jsonapi icon indicating copy to clipboard operation
loopback-component-jsonapi copied to clipboard

Add json api content type as an option in loopback explorer

Open digitalsadhu opened this issue 10 years ago • 7 comments

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

digitalsadhu avatar Sep 22 '15 19:09 digitalsadhu

Start looking here: https://github.com/strongloop/loopback/issues/445#issuecomment-154102862

digitalsadhu avatar Nov 13 '15 09:11 digitalsadhu

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

digitalsadhu avatar Nov 13 '15 14:11 digitalsadhu

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

devotox avatar Jan 26 '16 11:01 devotox

Thanks @devotox! Really awesome to hear it!

digitalsadhu avatar Jan 26 '16 15:01 digitalsadhu

has @bajtos given you any help with this yet?

devotox avatar Feb 02 '16 17:02 devotox

@devotox not that I've heard

tsteuwer avatar Feb 02 '16 18:02 tsteuwer

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 .

digitalsadhu avatar Feb 02 '16 22:02 digitalsadhu