You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge documentation of same inline modules (#4008)
When two inline modules with the same name are generated from different
parts of the codebase, their documentation should be merged. However,
other metadata must match exactly, as it is an error for one part of the
codebase to define an inline module with pub visibility while another
defines it with pub(crate) visibility.
This PR enables documentation merging while maintaining strict
validation of other metadata fields.
Currently, the following sample model fails to generate code because
both `SomeList` and `member` are generated in the same inline module but
with different doc comments:
```smithy
@documentation("Outer constraint has some documentation")
@Length(max: 3)
list SomeList {
@Length(max: 8000)
member: String
}
```
Co-authored-by: Fahad Zubair <[email protected]>
Copy file name to clipboardExpand all lines: codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/RustCrateInlineModuleComposingWriter.kt
+59-10Lines changed: 59 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -352,25 +352,74 @@ class InnerModule(private val moduleDocProvider: ModuleDocProvider, debugMode: B
Copy file name to clipboardExpand all lines: codegen-server/src/test/kotlin/software/amazon/smithy/rust/codegen/server/smithy/ConstraintsMemberShapeTest.kt
0 commit comments