[Coldbox 4.3.0], [Relax 3.0.1+121],[Swagger 1.0.2-snapshot] Generating Swagger JSON

37 views
Skip to first unread message

Matt Graff

unread,
Oct 26, 2017, 12:05:07 PM10/26/17
to ColdBox Platform
Hello-

I am working in the relax module and would like to move away from the Relax Programmatic DSL. I have installed cbswagger module but cannot figure out how to actually use it to export my API JSON using the auto-discovery. If I use a Relax.cfc it asks for it to point to an existing JSON file or using the DSL in the actual Relax.cfc.  I am just wondering how I get that JSON created based on the metadata in my API?  

On https://coldbox-relax.ortusbooks.com/cbswagger-companion-module.html it says "cbSwagger will automatically introspect your API handlers provided by your routing configuration" How do I do this?

Any help would be much appreciated!

Thanks,
Matt 

Luis Majano

unread,
Oct 30, 2017, 7:02:25 PM10/30/17
to ColdBox Platform
Hi Matt,

Once you install the `cbSwagger` module, then go to your app using `/cbswagger`  That will export your API as a swagger json document.


Luis Majano
CEO
Ortus Solutions, Corp
--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coldbox/a5dc5809-113a-49db-a195-b0b81cb4eb91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matt Graff

unread,
Oct 31, 2017, 11:45:21 AM10/31/17
to ColdBox Platform
Thank you Luis!  I figured it was something simple I was missing. I was trying to access the swagger-sdk thinking that was the module. I installed the cbswagger module and have it working. I think I found a bug though:

File: Models\RoutesParser.cfc
Line: 103 should just be: route[ "moduleInvocationPath" ] = moduleConventionPath;

as it is now...trying to listToArray an array:

var moduleConventionPath = listToArray( variables.controller.getColdboxSettings().modulesConvention, "/" );
arrayAppend( moduleConventionPath, route.module );
route[ "moduleInvocationPath" ] = listToArray( moduleConventionPath, "." );
If you prefer I can put in the ticket...just need tracker URL...

Thanks again,
Matt
Reply all
Reply to author
Forward
0 new messages