Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

triple-slash docs accidentally merged when put in the wrong position #2388

Closed
kubukoz opened this issue Aug 29, 2024 · 0 comments · Fixed by #2390
Closed

triple-slash docs accidentally merged when put in the wrong position #2388

kubukoz opened this issue Aug 29, 2024 · 0 comments · Fixed by #2390

Comments

@kubukoz
Copy link
Contributor

kubukoz commented Aug 29, 2024

When you do this:

$version: "2"

namespace demo

structure Hello {
    @required
    /// totally a string
    s: String
    /// a number!
    i: Integer
}

The result will end up concatenating both doc strings and putting them on i:

{
    "smithy": "2.0",
    "shapes": {
        "demo#Hello": {
            "type": "structure",
            "members": {
                "s": {
                    "target": "smithy.api#String",
                    "traits": {
                        "smithy.api#required": {}
                    }
                },
                "i": {
                    "target": "smithy.api#Integer",
                    "traits": {
                        "smithy.api#documentation": "totally a string\na number!"
                    }
                }
            }
        }
    }
}

whereas if i has no /// on it, you'll rightfully get a warning about the wrong position:

image

I think the actual behavior in the original snippet should be:

  • produce the same type of warning as in the screenshot
  • don't concat the docs (ignore the comment from totally a string completely)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant