Change autoentities patterns.name default value#3472
Open
RubenCerna2079 wants to merge 5 commits intomainfrom
Open
Change autoentities patterns.name default value#3472RubenCerna2079 wants to merge 5 commits intomainfrom
patterns.name default value#3472RubenCerna2079 wants to merge 5 commits intomainfrom
Conversation
1 task
patterns.name default valuepatterns.name default value
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the autoentities default naming pattern so generated entity names include both schema and object, preventing collisions when multiple schemas contain objects with the same name (fix for #3455).
Changes:
- Changed the default
autoentities.patterns.namefrom{object}to{schema}_{object}. - Updated CLI option help text and JSON schema to reflect the new default.
- Added an MSSQL integration test to validate generation/access of same-named tables across different schemas.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/Service.Tests/Configuration/ConfigurationTests.cs |
Adds a new MSSQL integration test covering same object name across schemas. |
src/Config/ObjectModel/AutoentityPatterns.cs |
Changes the default autoentity naming pattern to include schema + object. |
src/Cli/Commands/AutoConfigOptions.cs |
Updates patterns.name help text to match the new default. |
schemas/dab.draft.schema.json |
Updates schema description/default for autoentities.patterns.name. |
Comments suppressed due to low confidence (3)
src/Service.Tests/Configuration/ConfigurationTests.cs:5618
- This test passes
Include: null, which defaults to"%.%"and will auto-generate entities for all eligible tables in the test database. That makes the test slower and more brittle (future schema additions could introduce unrelated naming conflicts). Prefer narrowingpatterns.includeto just the two tables under test (e.g.,foo.magazinesandbar.magazines).
HttpResponseMessage graphqlResponse = await client.SendAsync(graphqlRequest);
// Assert
string expectedResponseFragment = @"{""id"":1156,""name"":""The First Publisher""}";
// Verify number of entities
src/Service.Tests/Configuration/ConfigurationTests.cs:5614
- The autoentity definition key/name
PublisherAutoEntityis misleading in a test that is specifically about generatingfoo_magazinesandbar_magazines. Renaming it to something magazines-focused will make failures and logs easier to interpret.
};
HttpResponseMessage graphqlResponse = await client.SendAsync(graphqlRequest);
src/Service.Tests/Configuration/ConfigurationTests.cs:5604
- The XML doc comment refers to the default
'property.name', but the configuration property ispatterns.name. Updating this avoids confusion when correlating the test with the CLI/schema docs.
publishers {
items {
id
name
}
Aniruddh25
approved these changes
Apr 28, 2026
Aniruddh25
reviewed
Apr 28, 2026
2 tasks
Aniruddh25
requested changes
Apr 28, 2026
Collaborator
Aniruddh25
left a comment
There was a problem hiding this comment.
Dependent on PR #3468
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why make this change?
What is this change?
This changes the default value of the
patterns.nameproperty insideautoentitiesso that it uses both the {schema} and {object} in order to allow users to use multiple objects that have the same name but are from different schemas without the need to do additional changes to the config file.This PR is dependent on PR #3468.
How was this tested?
Used sample below to ensure that different entities with the same object name but different schema name can be created without the need to change the
patterns.nameproperty.Sample Request(s)