APIDocumentContextis created and passed to every documentation method. The context stores the document being created, but more importantly, is a container for reusable components. You may register components by implementing
APIComponentDocumenterand implementing its abstract method. For example, the following code registers a reusable schema object:
ManagedObjects are registered as schema objects. The other types of components are: responses, request bodies, parameters, headers, security schemes, and callbacks.
APIComponentDocumenterand are declared properties of your
ApplicationChannel. (See this guide for other options.)
ManagedObjectsubclasses in your application.
ManagedContextas a property of your
ApplicationChannelwill automatically document the managed objects of your application as schema components.
Serializableobject is bound to a request body in a
ResourceController, it will automatically be documented as a schema component. By default, the properties of the
Serializableobject are reflected on to produce this component. To override this behavior and provide your own component documentation, implement the following method in your
Serializabletype is not bound to a resource controller operation, you must register it yourself. This typically occurs by overriding
documentComponentsin the controller that uses the type.