conduitcommand line tool to generate an OpenAPI document for your application.
conduit documentcommand in your project's directory, and it prints the JSON document to your console.
pubspec.yaml. If you want to override the derived values, or provide values that can't be derived, use options like
conduit document --helpfor all options.
conduit documentcommand, it creates an empty
APIDocumentthat objects in your application will populate. Your application goes through its normal initialization process (i.e.,
entryPoint). Controllers and service objects are then told to register components. For example, all
ManagedObjects register themselves as a reusable schema component. After components are registered, the controllers in an application are told to create path operations that define the requests they handle.
conduit document --helpto use a different file.
APIComponentDocumenter.documentComponents. Controllers - which implement this method - automatically document their components as long as they are linked to your application's entry point. Other types of objects that implement this method will be automatically documented if they are declared as a property of your
PathControllerall automatically document their components.
documentComponentsin your app channel to tell that object to register components. You must call the superclass' implementation.
/users) and its request method (e.g.,
GET). Each operation describes how to send a request to the server, like which headers or query parameters to include. Responses describe the status code, headers and body that can be sent. Each controller implements
APIOperationDocumenter.documentOperationsto define this information for the requests it handles.
ResourceControlleralready implement this method. You typically only override this method when creating your own middleware. For more information on documenting middleware, see this guide.
ResourceControllers, request parameters are derived from your bindings, but you still need to provide the possible responses. For more information on documenting endpoint controllers, see this guide.