New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate relationship field names in config as backing columns #2175
Validate relationship field names in config as backing columns #2175
Conversation
/azp run |
/azp run |
/azp run |
/azp run |
/azp run |
/azp run |
/azp run |
/azp run |
/azp run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
questions about how tests are validating config validation.
src/Service.Tests/SqlTests/GraphQLQueryTests/DwSqlGraphQLQueryTests.cs
Outdated
Show resolved
Hide resolved
… of https://github.com/Azure/data-api-builder into dev/aaronburtle/RelationshipValidationOnBackingColumns
/azp run |
/azp run |
/azp run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
/azp run |
Why make this change?
Closes #2166
Related to #2139
What is this change?
When we validate the relationship fields in the config, ie: source fields and target fields, we use the backing column names to validate against. Previously we were using aliases if one existed, but instead we will validate only against the actual names of the backing columns. So, for example, if someone had an alias for the column "id", so that it would display as "identifier" when using this alias, we would validate that the relationship defined with that field was defined in the config using the name "id", and would throw a validation error if the config instead used, "identifier."
How was this tested?
Current test suite passing, along with a regression test for DwSql, MsSql, MySql, and PostreSql.
Sample Request(s)
Please see this issue for details on samples to reproduce.
#2166