Skip to content

Fix incorrect links for operation input / output members in docgen#2922

Merged
joewyz merged 5 commits intomainfrom
joewyz/docgen-link-fix
Jan 22, 2026
Merged

Fix incorrect links for operation input / output members in docgen#2922
joewyz merged 5 commits intomainfrom
joewyz/docgen-link-fix

Conversation

@joewyz
Copy link
Contributor

@joewyz joewyz commented Jan 13, 2026

Background

Current Smithy Docgen generated incorrect links for operation input / output members.
For example:

@paginated(inputToken: "nextToken", outputToken: "nextToken", pageSize: "pageSize", items: "items")
operation PaginatedOperation {
    input := {
        nextToken: String
    
        pageSize: Integer
    }

    output := {
        items: Items

        nextToken: String
    }
}

The generated link for paginated trait's token would be something like:./../shapes/PaginatedOperationInput.md#paginatedoperationinput-nexttoken. This is incorrect because we do not generate separate files for operation input / output structures.

With this fix, Smithy Docgen can produce correct link: ./PaginatedOperation.md#paginatedoperation-nexttoken
This should fix issue #2921


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@joewyz joewyz requested a review from a team as a code owner January 13, 2026 19:06
@joewyz joewyz requested a review from JordonPhillips January 13, 2026 19:06
@github-actions
Copy link
Contributor

This pull request does not contain a staged changelog entry. To create one, use the ./.changes/new-change command. For example:

./.changes/new-change --pull-requests "#2922" --type feature --description "Fix incorrect links for paginated trait in docgen"

Make sure that the description is appropriate for a changelog entry and that the proper feature type is used. See ./.changes/README or run ./.changes/new-change -h for more information.

@joewyz joewyz changed the title Fix incorrect links for paginated trait in docgen Fix incorrect links for operation input / output members in docgen Jan 13, 2026
…rators/OperationGeneratorTest.java

Co-authored-by: Kevin Stich <kevin@kstich.com>
builder.definitionFile(getDefinitionFile(serviceShape, operation));
builder.putProperty(OPERATION_PROPERTY, operation);
// Input and output structures should use the operation as its link_id
builder.putProperty(LINK_ID_PROPERTY, getLinkId(getShapeName(serviceShape, operation)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should have a -request-members or -response-members suffix, since those targets are getting generated already. That should probably be shortened to -input and -output but it's not critical.

Copy link
Contributor Author

@joewyz joewyz Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added -request-members and -response-members suffix, it would require more changes in MemberGenerator to align with the shortened suffix

Copy link
Contributor

@JordonPhillips JordonPhillips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is better since we're going to the right page now, but I wonder if the links still work

@joewyz joewyz merged commit 8edc19a into main Jan 22, 2026
16 checks passed
@joewyz joewyz deleted the joewyz/docgen-link-fix branch January 22, 2026 21:48
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 this pull request may close these issues.

3 participants