APIDocumentContext
is 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 APIComponentDocumenter
and implementing its abstract method. For example, the following code registers a reusable schema object:ManagedObject
s are registered as schema objects. The other types of components are: responses, request bodies, parameters, headers, security schemes, and callbacks.getObjectWithType
.APIComponentDocumenter
and are declared properties of your ApplicationChannel
. (See this guide for other options.)ManagedObject
subclasses in your application.ManagedContext
as a property of your ApplicationChannel
will automatically document the managed objects of your application as schema components.Serializable
object is bound to a request body in a ResourceController
, it will automatically be documented as a schema component. By default, the properties of the Serializable
object are reflected on to produce this component. To override this behavior and provide your own component documentation, implement the following method in your Serializable
subclass:Serializable
type is not bound to a resource controller operation, you must register it yourself. This typically occurs by overriding documentComponents
in the controller that uses the type.