documentComponents method Null safety

void documentComponents(
  1. APIDocumentContext context
)

Tells this object to add its components to context.

You may register components with context in this method. The order in which components are registered does not matter.

Example:

    class Car implements APIComponentDocumenter {
      @override
      void documentComponents(APIDocumentContext context) {
        context.schema.register("Car", APISchemaObject.object({
          "make": APISchemaObject.string(),
          "model": APISchemaObject.string(),
          "year": APISchemaObject.integer(),
        }));
      }
    }

See APIDocumentContext for more details.

Implementation

void documentComponents(APIDocumentContext context);