Skip to content

Commit ae73f12

Browse files
Write error trait to schema
This removes the error trait from the filter that filters out what traits are written into the schema. This trait is needed when serializing exceptions, as there is no access to the actual value when the structure is being created.
1 parent cca5234 commit ae73f12

File tree

1 file changed

+3
-2
lines changed
  • codegen/smithy-python-codegen/src/main/java/software/amazon/smithy/python/codegen

1 file changed

+3
-2
lines changed

codegen/smithy-python-codegen/src/main/java/software/amazon/smithy/python/codegen/SchemaGenerator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@
3636
final class SchemaGenerator implements Consumer<Shape> {
3737
private static final Logger LOGGER = Logger.getLogger(SchemaGenerator.class.getName());
3838

39-
// Filter out traits that already exist as generated parts of the class, such as documentation.
39+
// Filter out traits that would overly bloat the definition, which are already part of the
40+
// class, such as documentation.
4041
private static final Set<ShapeId> DEFAULT_TRAIT_FILTER = Set.of(
41-
DocumentationTrait.ID, ErrorTrait.ID, EnumTrait.ID, SyntheticEnumTrait.ID
42+
DocumentationTrait.ID, EnumTrait.ID, SyntheticEnumTrait.ID
4243
);
4344

4445
private static final Symbol UNIT_SYMBOL = Symbol.builder()

0 commit comments

Comments
 (0)