Skip to content

Conversation

vkarpov15
Copy link
Collaborator

Summary

Some followup work for #15524: defaultOptions is actually a static property on SchemaTypes, not an instance property. Also, add schemaOptions.

Examples

@vkarpov15 vkarpov15 added this to the 8.17 milestone Jul 11, 2025
@vkarpov15 vkarpov15 changed the base branch from master to 8.17 July 11, 2025 19:16
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates how defaultOptions is exposed on schema types—making it a static property on SchemaType and all Schema.Types.* classes—and introduces schemaOptions to DocumentArray.

  • Move defaultOptions from instance members to static properties on SchemaType and its subclasses.
  • Adjust tests in schemaTypeOptions.test.ts to validate static access of defaultOptions.
  • (Not shown here) Add schemaOptions to the DocumentArray type definition.
Comments suppressed due to low confidence (1)

test/types/schemaTypeOptions.test.ts:77

  • Add a test for the new static schemaOptions property on DocumentArray to ensure its type is correctly inferred, e.g.: expectType<Record<string, any> | undefined>(Schema.Types.DocumentArray.schemaOptions);
}

@hasezoey hasezoey added the typescript Types or Types-test related issue / Pull Request label Jul 13, 2025
@vkarpov15 vkarpov15 merged commit 744083a into 8.17 Jul 15, 2025
5 checks passed
@hasezoey hasezoey deleted the vkarpov15/schematype-defaultoptions-ts branch July 15, 2025 19:01
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.

2 participants