The following section covers the components of Ruby frameworks and their library components that NightVision’s API Discovery capability can detect and use to generate OpenAPI documentation. If a component that you use is not supported, please get in touch with our support team at support@nightviz.ai, and we can add this as a new feature.
| Library Component | Description |
|---|
| ActionController::Base | The base class for all controllers in Rails, providing shared functionality such as rendering and redirects. |
| ActionController::Parameters | Provides a way to handle strong parameters to prevent unwanted attributes from being used in ActiveRecord operations. |
| ActionDispatch::Routing::RouteSet | Manages the routing rules in a Rails application and is responsible for mapping incoming requests to controllers and actions. |
| resources | Defines standard RESTful routes for a collection of resources, including actions like index, create, new, edit, show, update, and destroy. |
| resource | Similar to resources, but used for a singular resource which doesn’t require index or create routes. |
| namespace | Groups controllers under a specific namespace and routes the incoming requests accordingly. |
| member | A routing method that adds more routes to a single resource using standard HTTP verbs which act on a specific member. |
| collection | A routing method that adds additional routes to a collection of resources, not just a single resource. |
| get | Defines a route for a GET request to a specified path mapped to a controller action. |
| post | Defines a route for a POST request to a specified path which typically handles the creation of a resource. |
| put | Defines a route for a PUT request to a specified path which typically handles the updating of a resource. |
| patch | Defines a route for a PATCH request, often used interchangeably with PUT, to update a specific resource. |
| delete | Defines a route for a DELETE request to remove a specific resource. |
| draw | Method used within the routes.rb file to draw routes using a block of routing definitions. |
| Library Component | Description |
|---|
| Grape::DSL::Routing::ClassMethods | Class that provides major part of Grape routing related DSL |
| resource | Similar to resources, but used for a singular resource which doesn’t require index or create routes. |
| namespace | Groups controllers under a specific namespace and routes the incoming requests accordingly. |
| get | Defines a route for a GET request to a specified path mapped to a controller action. |
| post | Defines a route for a POST request to a specified path which typically handles the creation of a resource. |
| put | Defines a route for a PUT request to a specified path which typically handles the updating of a resource. |
| patch | Defines a route for a PATCH request, often used interchangeably with PUT, to update a specific resource. |
| delete | Defines a route for a DELETE request to remove a specific resource. |
| mount | Mounts another Grape API or Rack application at a specified path within the current API. |
| version | Specifies the API version, allowing you to define versioned routes and handle different versions of your API endpoints. |
| params | Defines parameters for the route, specifying expected inputs and validations. |
| prefix | Sets a prefix for all routes within the API, effectively changing the base path for all endpoints. |