en en en en en fr en en en en en en en en en en en en en en en en ceb jv la en en en en kn es km en en en en ceb ko en hbs_lat hbs_lat en en kn es en en km en km en km en km tr km en km kn km en km kn en pt ko la en uz ceb la en en en kv en bg jv kn lt ceb jv en en en jv en kn en la ko en bcl kv bg hbs_lat it ceb hbs_lat en en en en la jv lt kk jv kn kn lt ceb en en en en ko jv en kn kn kn yue kn kn lt la en bcl hbs_lat en hbs_lat en en en ko jv en lt hu jv kn kn kn lt en lt en lt pt en en uz ceb pms kv en en bcl hbs_lat en en en en la jv lt kk jv kn kn kn kn en la ko en bcl hbs_lat it ceb hbs_lat en en en en la jv lt kk jv kn kn lt ceb en en en en ko jv en kn kn kn yue kn lt la en bcl hbs_lat en hbs_lat en en en ko jv en lt hu jv kn kn kn lt en lt en lt en kn en en en en hbs_lat en
Swagger SDK - ColdBox Relax
The ColdBox SwaggerSDK is a dependency of the Relax module and is available to allow you to provided consumers of your API with information on paths, methods, expectations and available parameters.
Hypermedia design patterns, usually provided within the content of OPTIONS requests to your endpoint, allow you to provide autodiscovery and consumption assistance on-the-fly.
For convenience, built-in methods are available within Relax to simplify the loading and parsing of your existing API documentation.
An example, leveraging an OPTIONS request for an endpoint (and using the conventions of the Coldbox REST API skeleton), might look like:
//Pet Routes - collections and additions
//Pet Routes - entity methods
Now we add an options method to our "Pets" handler to serve the documentation
public function options( event, rc, prc ){
petOptions = getInstance( "[email protected]" ).loadAPI( 'petstore' );
if( structKeyExists( rc, "id" )){
prc.response.setData( petOptions.paths[ "/pets/{id}" ] );
prc.response.setData( petOptions.paths[ "/pets" ] );
This will serve information on the requested path of the petstore API as a JSON response to an OPTIONS request (using the collection example):
"description": "Returns all pets from the system that the user has access to\nNam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia.\n\nSed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien.\n",
"description": "tags to filter by",
"description": "maximum number of results to return",
"description": "Creates a new pet in the store. Duplicates are allowed",
"description": "Pet to add to the store",
Hypermedia design patterns in your API responses, allow for self-discovery and ease development for API consumption.