Open texastony opened 6 months ago
While it seems very weird to support a trait named @javadoc
on other languages, I understand the motivation here that existing projects have used @javadoc
with plaintext content that doesn't use any CommonMark markup, and therefore is fine to use for other languages.
I think instead that smithy-dafny should support @documentation
but with a validator that asserts that the content of each instance doesn't have any markup, and replace @javadoc
with @documentation
in existing models.
I am happy with that proposal!! If #247 is refactored to your proposed scope, this issue can be resolved as a duplicate.
Alternatively, #247 can be left alone and we could revise this issue to be your proposal.
Yes let's do that, since it would still be good to fully support @documentation
with markup in the future.
Issue
Currently, the Java generated code contains documentation from the Smithy Model that is annotated with
@javadoc
..NET generated code does not.
Thus, products that use Smithy-Dafny for .NET do not get API documentation, AND these products are harder to use in .NET.
Fix
Since
@javadoc
only supports plaintext content, we can decide that smithy-dafny supports the standard@documentation
trait but only if it does not contain any markup. We can add a validator that producesWARNING
events for any@documentation
traits that contain markup. Then we can just replace@javadoc
with@documentation
in existing models and deprecate the former.Original proposed fix:
Refactor the .NET generation logic to respect
@javadoc
.This is related to https://github.com/smithy-lang/smithy-dafny/issues/247, but does not go as far.