Skip to content

Conversation

@ianbotsf
Copy link
Contributor

Issue #

(none)

Description of changes

Annotates mapper-generated declarations with @GeneratedApi and sets that as a "non-public marker" for the purposes of API validation.

Examples

Examples of updated generated schemas are present in the PR in SchemaGeneratorPluginTest.kt.

Generated operations are a little harder to see in PR so check out dynamodb-mapper.api to see which members are no longer validated. Despite no longer appearing in the API dump, the members are still present in the generated operation. For example:

public interface ScanRequest<T> {
    public companion object { }

    @GeneratedApi
    public val consistentRead: Boolean?
    public val exclusiveStartKey: T?
    public val filter: BooleanExpr?
    @GeneratedApi
    public val limit: Int?
    @GeneratedApi
    public val returnConsumedCapacity: ReturnConsumedCapacity?
    @GeneratedApi
    public val segment: Int?
    @GeneratedApi
    public val select: Select?
    @GeneratedApi
    public val totalSegments: Int?
}

public class ScanRequestBuilder<T> {
    @GeneratedApi
    public var consistentRead: Boolean? = null
    public var exclusiveStartKey: T? = null

    public var filter: BooleanExpr? = null

    public fun filter(block: Filter.() -> BooleanExpr?) {
        filter = FilterImpl.run(block)
    }

    @GeneratedApi
    public var limit: Int? = null
    @GeneratedApi
    public var returnConsumedCapacity: ReturnConsumedCapacity? = null
    @GeneratedApi
    public var segment: Int? = null
    @GeneratedApi
    public var select: Select? = null
    @GeneratedApi
    public var totalSegments: Int? = null

    public fun build(): ScanRequest<T> {
        // implementation omitted
    }
}

Companion PR: smithy-lang/smithy-kotlin#1471

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

@ianbotsf ianbotsf requested a review from a team as a code owner December 17, 2025 22:46
@ianbotsf ianbotsf added the no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly. label Dec 17, 2025
@ianbotsf ianbotsf added the acknowledge-api-break Acknowledge that a change is API breaking and may be backwards-incompatible. Review carefully! label Dec 17, 2025
@github-actions
Copy link

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK

Comment on lines +5 to +8
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: The copyright header isn't at the top of the file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

acknowledge-api-break Acknowledge that a change is API breaking and may be backwards-incompatible. Review carefully! no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants