Skip to content

Conversation

@roji
Copy link
Member

@roji roji commented Dec 14, 2025

We already validate against vector properties inside JSON owned entities, but not inside complex types.

@roji roji marked this pull request as ready for review December 14, 2025 17:26
@roji roji requested a review from a team as a code owner December 14, 2025 17:26
@roji
Copy link
Member Author

roji commented Dec 15, 2025

@AndriySvyryd this makes SqlServerModelValidatorTest.Does_not_throw_when_added_shadow_property_by_convention_is_not_of_primitive_type fail with:

System.InvalidOperationException : The model must be finalized and its runtime dependencies must be initialized before 'GetTypeMapping' can be used. Ensure that either 'OnModelCreating' has completed or, if using a stand-alone 'ModelBuilder', that 'IModelRuntimeInitializer.Initialize(model.FinalizeModel())' was called.

It's a bit odd, since the previous validation was also calling GetTypeMapping() - can you take a quick look?

@AndriySvyryd
Copy link
Member

@AndriySvyryd this makes SqlServerModelValidatorTest.Does_not_throw_when_added_shadow_property_by_convention_is_not_of_primitive_type fail with:

System.InvalidOperationException : The model must be finalized and its runtime dependencies must be initialized before 'GetTypeMapping' can be used. Ensure that either 'OnModelCreating' has completed or, if using a stand-alone 'ModelBuilder', that 'IModelRuntimeInitializer.Initialize(model.FinalizeModel())' was called.

It's a bit odd, since the previous validation was also calling GetTypeMapping() - can you take a quick look?

Previous validation was filtering on typeof(SqlVector<float>) first. There's probably some property that doesn't have a type mapping, use FindTypeMapping instead

@roji roji force-pushed the ValidateVectorInJsonComplexType branch from 68be673 to f9f7e3b Compare December 17, 2025 09:43
@roji roji requested a review from AndriySvyryd December 17, 2025 18:52
@roji roji merged commit ffdf778 into dotnet:main Dec 17, 2025
7 checks passed
@roji roji deleted the ValidateVectorInJsonComplexType branch December 17, 2025 20:46
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