Skip to content

chore(TestModels): Add constraints inside list, map and union#485

Closed
rishav-karanjit wants to merge 13 commits into
main-1.xfrom
rishav-dotnet-union-constraint
Closed

chore(TestModels): Add constraints inside list, map and union#485
rishav-karanjit wants to merge 13 commits into
main-1.xfrom
rishav-dotnet-union-constraint

Conversation

@rishav-karanjit
Copy link
Copy Markdown
Member

@rishav-karanjit rishav-karanjit commented Jul 23, 2024

Issue #, if available:

Description of changes:
This PR adds constraints inside list (ListWithConstraint), map (MapWithConstraint) and union (UnionWithConstraint) in the test model.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@rishav-karanjit rishav-karanjit changed the title PR to test codegen for constraints inside list, union and map constraints inside list, union and map Jul 25, 2024
@rishav-karanjit rishav-karanjit changed the title constraints inside list, union and map chore: constraints inside list, union and map Jul 25, 2024
@rishav-karanjit rishav-karanjit changed the title chore: constraints inside list, union and map chore(TestModels): constraints inside list, union and map Jul 25, 2024
@rishav-karanjit rishav-karanjit changed the title chore(TestModels): constraints inside list, union and map chore(TestModels): Add constraints inside list, map and union Jul 25, 2024

@length(min: 1, max: 10)
list ListWithConstraint {
member: MyString
Copy link
Copy Markdown
Member Author

@rishav-karanjit rishav-karanjit Aug 12, 2024

Choose a reason for hiding this comment

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

Self commenting a note posterity:
MyString has constraint @length(min: 1, max: 10)

Other aggregate shapes that was added also has similar constraint

@alex-chew
Copy link
Copy Markdown
Contributor

It would be good to also add a constraint within multiple levels of structures, to ensure that we're not only validating input structures. For example

structure GetConstraintsInput {
  ... // existing members omitted for brevity
  inner: InnerStructure,
}

structure InnerStructure {
  str: NonEmptyString,
}

@rishav-karanjit rishav-karanjit deleted the rishav-dotnet-union-constraint branch August 28, 2025 17:27
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