-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Always attempt model interop transforms
We previously did not attempt to perform model interop transforms if a model had errors. For example, if a model referred to an unknown trait, the model wouldn't use the interop transformation. Some use cases might choose to ignore unknown traits and other errors by _not_ unwrapping the assembled model and instead directly accessing the result from ValidatedResult. In these cases, the model would have not gone through the interop transform, resulting in an unexpect model (for example, if performing a diff against a 1.0 and 2.0 model, the upgrade won't run and causes the models to appear to be wildly different).
- Loading branch information
Showing
4 changed files
with
70 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
.../src/test/resources/software/amazon/smithy/model/loader/invalid-1.0-model-upgraded.smithy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
$version: "1.0" | ||
|
||
namespace smithy.example | ||
|
||
integer MyInteger | ||
|
||
structure Foo { | ||
bar: Integer, | ||
baz: MyInteger, | ||
|
||
@box | ||
bam: PrimitiveInteger, | ||
|
||
// An invalid trait doesn't break the loading process or prevent upgrades. | ||
@thisTraitDoesNotExist | ||
boo: String, | ||
|
||
// An invalid target doesn't break the loading process or prevent upgrades. | ||
bux: InvalidTarget | ||
} |