File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -211,12 +211,15 @@ private void renderStructureNamespace(StructuredMemberWriter structuredMemberWri
211
211
return ;
212
212
}
213
213
214
- structuredMemberWriter .writeMemberValidators (writer );
215
-
216
214
writer .addImport ("ValidationFailure" , "__ValidationFailure" , "@aws-smithy/server-common" );
217
215
writer .openBlock ("export const validate = ($L: $L): __ValidationFailure[] => {" , "}" ,
218
216
objectParam , symbol .getName (),
219
217
() -> {
218
+ // TODO: move this somewhere so it only gets run once.
219
+ // Putting it at the top of the namespace can result in runtime errors when
220
+ // you have mutually recursive structures because the validator of one will
221
+ // be defined before the validator of the other exists at all.
222
+ structuredMemberWriter .writeMemberValidators (writer );
220
223
structuredMemberWriter .writeValidate (writer , objectParam );
221
224
}
222
225
);
You can’t perform that action at this time.
0 commit comments