Skip to content

Commit fda19d6

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 fda19d6

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import software.amazon.smithy.model.shapes.ShapeId;
2222
import software.amazon.smithy.model.traits.DocumentationTrait;
2323
import software.amazon.smithy.model.traits.EnumTrait;
24-
import software.amazon.smithy.model.traits.ErrorTrait;
2524
import software.amazon.smithy.model.traits.UnitTypeTrait;
2625
import software.amazon.smithy.model.traits.synthetic.SyntheticEnumTrait;
2726
import software.amazon.smithy.utils.CaseUtils;
@@ -36,9 +35,10 @@
3635
final class SchemaGenerator implements Consumer<Shape> {
3736
private static final Logger LOGGER = Logger.getLogger(SchemaGenerator.class.getName());
3837

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

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

0 commit comments

Comments
 (0)