Skip to content

Commit f726862

Browse files
committed
Support smithy models in bundles
1 parent 32a5de8 commit f726862

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

model-bundle/model-bundle-api/src/main/java/software/amazon/smithy/modelbundle/api/ModelBundles.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ public static Service getService(SmithyBundle smithyBundle) {
3636
}
3737

3838
private static Model getModel(SmithyBundle bundle) {
39+
// TODO: model the type in the returned bundle
40+
var suffix = bundle.getModel().startsWith("$version") ? "smithy" : "json";
3941
var modelAssemble = new ModelAssembler().putProperty(ModelAssembler.ALLOW_UNKNOWN_TRAITS, true)
40-
.addUnparsedModel("bundle.json", bundle.getModel())
42+
.addUnparsedModel("bundle." + suffix, bundle.getModel())
4143
.disableValidation();
4244
var additionalInput = bundle.getAdditionalInput();
4345
Model model;

model-bundle/model-bundle-api/src/main/java/software/amazon/smithy/modelbundle/api/PluginProviders.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ private PluginProviders(Builder builder) {
1919
public BundlePlugin getPlugin(String identifier, Document input) {
2020
var provider = providers.get(identifier);
2121
if (provider == null) {
22-
throw new NullPointerException("no auth provider named " + identifier);
22+
throw new NullPointerException("No plugin provider named " + identifier);
2323
}
2424

2525
return provider.createBundlePlugin(input);

0 commit comments

Comments
 (0)