Skip to content
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

types: consistently infer array of objects in schema as a DocumentArray #14430

Merged
merged 1 commit into from Mar 14, 2024

Conversation

vkarpov15
Copy link
Collaborator

Fix #14367

Summary

The root cause of #14367 looks to be a minor inconsistency in type inference: on L232 we had ObtainDocumentType<Item, any, { typeKey: TypeKey }>[], and on L238 we have Types.DocumentArray<ObtainDocumentType<Item, any, { typeKey: TypeKey }>>. If these 2 are consistent, the code from #14367 compiles. Not 100% sure why, but we have tests proving this does the right thing.

Examples

@hasezoey hasezoey added the typescript Types or Types-test related issue / Pull Request label Mar 14, 2024
@vkarpov15 vkarpov15 added this to the 8.2.2 milestone Mar 14, 2024
@vkarpov15 vkarpov15 merged commit b94d2fd into master Mar 14, 2024
5 checks passed
@hasezoey hasezoey deleted the vkarpov15/gh-14367 branch March 14, 2024 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Types or Types-test related issue / Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InferSchemaType returns unknown value
2 participants