Build Status

Welcome to the Coldbox Swagger Module

This module automatically generates OpenAPI ( fka Swagger ) documenation from your configured application and module routes. This module utilizes the v3.0 OpenAPI Specification


Apache License, Version 2.0.




  • Adobe CF 10+
  • Lucee 4.5+
  • ColdBox 4+


To operate, the module requires that SES routing be enabled in your application. For more information read the official documentation.

Install cbSWagger ( via Commandbox )

box install cbswagger

Note: Omit the box from your command, if you are already in the Commandbox interactive shell

Configure cbSwagger to auto-detect your API Routes

By default, cbSwagger looks for routes beginning with api. By adding a cbSwagger configuration key to your Coldbox configuration, you can add additional metadata to the OpenAPI JSON produced by the module entry point. A full configuration example is provided below:

cbswagger = {
	// The route prefix to search.  Routes beginning with this prefix will be determined to be api routes
	//A base path prefix for your API - leave blank if all routes are configured to the root of the site
	//The API host
	// Information about your API
		//The contact email address
		//A title for your API
		//A descritpion of your API
		//A url to the License of your API
		//A terms of service URL for your API
		//The version of your API
	//An array of all of the request body formats your your API is configured to consume
	"consumes": ["application/json","multipart/form-data","application/x-www-form-urlencoded"],
	//An array of all of the response body formats your API delivers
	"produces": ["application/json"]

Handler Introspection & Documentation attributes

cbSwagger will automatically introspect your API handlers provided by your routing configuration. You may provide additional function attributes, which will be picked up and included in your documentation. Some notes on function attributes:

  • Attributes which are not part of the swagger path specification should be prefixed with an x-, x-attributes are an official part of the OpenAPI Specification and may be used to provide additional information for your developers and consumers
  • You may also provide paths to JSON files which describe complex objects which may not be expressed within the attributes themselves. This is ideal to provide an endpoint for parameters and responses If the atttribute ends with .json, this will be included in the generated OpenAPI document as a $ref include.


//(POST) /api/v1/users
function add( event, rc, prc )
	description="Adds a new user"
	x-SomeAdditionalInfo="Here is some additional information on this path"

	...[ Your code here ]...


Copyright Since 2016 Ortus Solutions, Corp

####HONOR GOES TO GOD ABOVE ALL Because of His grace, this project exists. If you don't like this, then don't read it, its not for you.

"Therefore being justified by faith, we have peace with God through our Lord Jesus Christ: By whom also we have access by faith into this grace wherein we stand, and rejoice in hope of the glory of God. And not only so, but we glory in tribulations also: knowing that tribulation worketh patience; And patience, experience; and experience, hope: And hope maketh not ashamed; because the love of God is shed abroad in our hearts by the Holy Ghost which is given unto us. ." Romans 5:5


"I am the way, and the truth, and the life; no one comes to the Father, but by me (JESUS)" Jn 14:1-12



  • Add $ref sanitization and inherited metadata introspection
  • Add the ability to handle arrays returned from $ref keys. Prepends moudule routing to operation id
  • ACF syntax corrections and add better throw for attempts to parse component with syntax errors


  • Normalization to new module templates
  • HTTP Verbs should be lower case #1


  • Exception when handler or module does not exist in a route.


  • Overall syntax Ortus standards
  • Some var scoping issues
  • Added persistence and injections to services
  • Added more documentation to handler, services and readme
  • Added swagger-sdk as a module dependency


  • Add module introspection
  • Forgebox integration updates


  • Initial Module Release


$ box install cbswagger
  • Oct 01 2016 08:56 AM
  • Oct 18 2017 06:29 AM
  • 473
  • 696
  • 499