Skip to content

Commit 52abcad

Browse files
CopilotAniruddh25
andcommitted
Fix test failure: Use correct entity name in schema assertions
- Changed schema key from "books_NoAutoPK" to "book_NoAutoPK" to match entity name in config - Entity is named "book" (line 201), not "books" (which is the table name) - Schemas are named after entity name, not source table name - Added assertion for "book_NoPK" schema as well for completeness - Fixes RequestBodySchemas_OnlyGeneratedForMutationOperations test failure Co-authored-by: Aniruddh25 <[email protected]>
1 parent 496b65d commit 52abcad

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/Service.Tests/OpenApiDocumentor/RoleSpecificEndpointTests.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,11 @@ public async Task RequestBodySchemas_OnlyGeneratedForMutationOperations()
155155
"Should have PATCH");
156156
// Request body schemas should be present for mutation operations
157157
Assert.IsTrue(
158-
docWithMutations.Components.Schemas.ContainsKey("books_NoAutoPK"),
158+
docWithMutations.Components.Schemas.ContainsKey("book_NoAutoPK"),
159159
"Should have request body schema for mutations");
160+
Assert.IsTrue(
161+
docWithMutations.Components.Schemas.ContainsKey("book_NoPK"),
162+
"Should have alternate request body schema for mutations");
160163

161164
// Read-only permissions - no mutation operations
162165
EntityPermission[] permissionsReadOnly = new[]
@@ -178,10 +181,10 @@ public async Task RequestBodySchemas_OnlyGeneratedForMutationOperations()
178181
"Should NOT have POST");
179182
// Request body schemas should NOT be generated for read-only entities (optimization)
180183
Assert.IsFalse(
181-
docReadOnly.Components.Schemas.ContainsKey("books_NoAutoPK"),
184+
docReadOnly.Components.Schemas.ContainsKey("book_NoAutoPK"),
182185
"Should NOT have request body schema for read-only entity");
183186
Assert.IsFalse(
184-
docReadOnly.Components.Schemas.ContainsKey("books_NoPK"),
187+
docReadOnly.Components.Schemas.ContainsKey("book_NoPK"),
185188
"Should NOT have alternate request body schema for read-only entity");
186189
}
187190

0 commit comments

Comments
 (0)