77import static software .amazon .smithy .python .codegen .SymbolProperties .OPERATION_METHOD ;
88
99import java .util .List ;
10- import java .util .Optional ;
11-
1210import software .amazon .smithy .model .traits .InputTrait ;
1311import software .amazon .smithy .model .traits .OutputTrait ;
14- import software .amazon .smithy .model .traits .StreamingTrait ;
1512import software .amazon .smithy .python .codegen .GenerationContext ;
1613import software .amazon .smithy .python .codegen .integrations .PythonIntegration ;
1714import software .amazon .smithy .python .codegen .sections .*;
@@ -87,14 +84,7 @@ public void append(PythonWriter pythonWriter, OperationSection section) {
8784 fileWriter .write ("=================\n Input:\n =================\n \n " );
8885 fileWriter .write (".. autoclass:: " + inputSymbolName + "\n :members:\n " );
8986 fileWriter .write ("=================\n Output:\n =================\n \n " );
90- if (section .isStream ()) {
91- var streamShape =
92- context .model ().expectShape (output .getAllMembers ().get ("stream" ).getId ());
93- var streamName = context .symbolProvider ().toSymbol (streamShape ).toString ();
94- fileWriter .write (".. autodata:: " + streamName + " \n \n " );
95- } else {
96- fileWriter .write (".. autoclass:: " + outputSymbolName + "\n " + ":members:\n \n " );
97- }
87+ fileWriter .write (".. autoclass:: " + outputSymbolName + "\n :members:\n " );
9888 });
9989 }
10090 }
@@ -119,15 +109,7 @@ public void append(PythonWriter pythonWriter, StructureSection section) {
119109 var symbol = context .symbolProvider ().toSymbol (shape );
120110 String docsFileName = String .format ("docs/models/%s.rst" ,
121111 symbol .getName ());
122-
123- boolean isStreaming = Optional .ofNullable (shape .getAllMembers ().get ("body" ))
124- .map (member -> context .model ().expectShape (member .getTarget ()))
125- .map (memberShape -> memberShape .hasTrait (StreamingTrait .class ))
126- .orElse (false );
127- // Input and output shapes are typically skipped since they are generated
128- // on the operation's page. The exception to this is the output of
129- // streaming operations where we have a different output shape defined.
130- if (!shape .hasTrait (InputTrait .class ) && !shape .hasTrait (OutputTrait .class ) || isStreaming ) {
112+ if (!shape .hasTrait (InputTrait .class ) && !shape .hasTrait (OutputTrait .class )) {
131113 context .writerDelegator ().useFileWriter (docsFileName , "" , writer -> {
132114 writer .write (generateHeader (symbol .getName ()));
133115 writer .write (".. autoclass:: " + symbol .toString () + "\n :members:\n " );
0 commit comments