Skip to content

Add trait to declare types for metadata#3078

Open
JordonPhillips wants to merge 2 commits into
mainfrom
typed-metadata
Open

Add trait to declare types for metadata#3078
JordonPhillips wants to merge 2 commits into
mainfrom
typed-metadata

Conversation

@JordonPhillips
Copy link
Copy Markdown
Contributor

This adds a new trait to declare types for metadata keys. Values for these keys will be validated against the shape targeted by the trait.

While this enables modeling of the suppressions and validators keys, actually adding those to the model will be done later.


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

This adds a new trait to declare types for metadata keys. Values for
these keys will be validated against the shape targeted by the trait.

While this enables modeling of the suppressions and validators keys,
actually adding those to the model will be done later.
@JordonPhillips JordonPhillips requested a review from a team as a code owner April 30, 2026 10:15
@JordonPhillips JordonPhillips requested a review from sugmanue April 30, 2026 10:15
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: should we totally blank file for valid test error files?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: same as the previous comment on valid test error files.

import software.amazon.smithy.model.shapes.ShapeId;
import software.amazon.smithy.model.shapes.StringShape;

public class MetadataTraitTest {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Should we have a test for conflict key defined in different files?

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.

2 participants