Class OperationGenerator

java.lang.Object
software.amazon.smithy.docgen.generators.OperationGenerator
All Implemented Interfaces:
Consumer<GenerateOperationDirective<DocGenerationContext,DocSettings>>

public final class OperationGenerator extends Object implements Consumer<GenerateOperationDirective<DocGenerationContext,DocSettings>>
Generates documentation for operations.

The output of this can be customized in a number of ways. To add details to or re-write particular sections, register an interceptor with SmithyIntegration.interceptors(C). The following sections are guaranteed to be present:

  • ShapeSubheadingSection: Enables adding additional details that are inserted right after the shape's heading, before modeled docs.
  • ShapeDetailsSection: Enables adding additional details that are inserted directly after the shape's modeled documentation.
  • ShapeSection: Three versions of this section will appear on the page. The first is for the operation shape itself, which enables re-writing or adding details to the entire page. The other two are for the input and output shapes, which enable modifying the documentation for just the input and output sections.
  • ErrorsSection: This section will contain a listing of all the errors the operation might return. If a synthetic error needs to be applied to an operation, it is better to simply add it to the shape with SmithyIntegration.preprocessModel(software.amazon.smithy.model.Model, S).
  • ProtocolSection Enables adding traits that are specific to a particular protocol. This section will only be present if there are protocol traits applied to the service. If there are multiple protocol traits, this section will appear once per protocol.
  • ProtocolsSection Enables modifying the tab group containing all the protocol traits for all the protocols.
Additionally, if the operation's input or output shapes have members the following sections will also be present:
  • MemberSection: enables modifying documentation for an individual input or output member.
  • ShapeMembersSection: Two versions of this section will appear on the page, one for the operation's input shape members and one for the operation's output shape members. These enable re-writing or editing those sections.
If the examples trait has been applied to the operation, it will also have the following sections:
  • ExamplesSection: enables modifying the entire examples section.
  • ExampleSection: enables modifying a singular example, including the snippets in every discovered language.

To change the intermediate format (e.g. from markdown to restructured text), a new DocFormat needs to be introduced via DocIntegration.docFormats(software.amazon.smithy.docgen.DocSettings).

See Also: