Repository: smithy-lang/smithy
Pull request #2172 (2024-03-06 15:25:35)

Fix casing of inferInlineIoSuffixes option
This fixes some casing problems. The bad casing wasn't released, so nobody is broken by this change.

---
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.



Patch:
diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java b/smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
index c22d0c520..8d0aec396 100644
--- a/smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
+++ b/smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
@@ -73,7 +73,7 @@ public final class SmithyIdlModelSerializer {
     private final SmithyIdlComponentOrder componentOrder;
     private final String inlineInputSuffix;
     private final String inlineOutputSuffix;
-    private final boolean inferInlineIOSuffixes;
+    private final boolean inferInlineIoSuffixes;
 
     /**
      * Trait serialization features.
@@ -122,7 +122,7 @@ public final class SmithyIdlModelSerializer {
         this.componentOrder = builder.componentOrder;
         this.inlineInputSuffix = builder.inlineInputSuffix;
         this.inlineOutputSuffix = builder.inlineOutputSuffix;
-        this.inferInlineIOSuffixes = builder.inferInlineIOSuffixes;
+        this.inferInlineIoSuffixes = builder.inferInlineIoSuffixes;
     }
 
     /**
@@ -218,7 +218,7 @@ public final class SmithyIdlModelSerializer {
     }
 
     private Pair<String, String> determineInlineSuffixes(Model fullModel, Collection<Shape> shapes) {
-        if (!inferInlineIOSuffixes) {
+        if (!inferInlineIoSuffixes) {
             return Pair.of(inlineInputSuffix, inlineOutputSuffix);
         }
 
@@ -329,7 +329,7 @@ public final class SmithyIdlModelSerializer {
         private SmithyIdlComponentOrder componentOrder = SmithyIdlComponentOrder.PREFERRED;
         private String inlineInputSuffix = DEFAULT_INLINE_INPUT_SUFFIX;
         private String inlineOutputSuffix = DEFAULT_INLINE_OUTPUT_SUFFIX;
-        private boolean inferInlineIOSuffixes = false;
+        private boolean inferInlineIoSuffixes = false;
 
         public Builder() {}
 
@@ -457,11 +457,11 @@ public final class SmithyIdlModelSerializer {
          * <p>The suffixes set by {@link #inlineInputSuffix(String)} and {@link #inlineOutputSuffix(String)}
          * will be the default values.
          *
-         * @param shouldInferInlineIOSuffixes Whether inline IO suffixes should be inferred for each file.
+         * @param shouldinferInlineIoSuffixes Whether inline IO suffixes should be inferred for each file.
          * @return Returns the builder.
          */
-        public Builder inferInlineIOSuffixes(boolean shouldInferInlineIOSuffixes) {
-            this.inferInlineIOSuffixes = shouldInferInlineIOSuffixes;
+        public Builder inferInlineIoSuffixes(boolean shouldinferInlineIoSuffixes) {
+            this.inferInlineIoSuffixes = shouldinferInlineIoSuffixes;
             return this;
         }
 


Test patch:
diff --git a/smithy-model/src/test/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializerTest.java b/smithy-model/src/test/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializerTest.java
index 41a18f48c..15431ecd5 100644
--- a/smithy-model/src/test/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializerTest.java
+++ b/smithy-model/src/test/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializerTest.java
@@ -294,7 +294,7 @@ public class SmithyIdlModelSerializerTest {
 
         Map<Path, String> reserialized = SmithyIdlModelSerializer.builder()
                 .shapePlacer(s -> Paths.get(s.getSourceLocation().getFilename()).getFileName())
-                .inferInlineIOSuffixes(true)
+                .inferInlineIoSuffixes(true)
                 .build()
                 .serialize(model);