Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 25, 2025

Plan to refactor validateSchema() methods from type classes to centralized schema validation system:

  • Analyze current implementation and understand the scope
  • Confirm all tests pass in current state
  • Create individual validation functions for each schema type in src/schema/validate.ts
  • Create main router function with switch statement based on schema.kind
  • Remove validateSchema() methods from all type classes (AbstractType, StringType, ArrayType, ObjectType, etc.)
  • Update AbstractType to use new centralized validation system
  • Run tests to ensure refactoring doesn't break functionality
  • Run linting and build to ensure code quality

Fixes #15.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
@streamich
Copy link
Collaborator

Copilot! Restart this work!

Copy link
Contributor Author

Copilot AI commented Jul 26, 2025

Copilot! Restart this work!

Starting the refactoring work from scratch. I've reset to the original state and will carefully implement the centralized validation system with proper testing at each step.

Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
Copilot finished work on behalf of streamich July 26, 2025 09:13
@streamich streamich marked this pull request as ready for review July 26, 2025 16:25
Copy link
Collaborator

@streamich streamich left a comment

Choose a reason for hiding this comment

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

Add missing schema validation tests.

Make sure Prettier yarn prettier is applied.

Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 26, 2025

Add missing schema validation tests.

Make sure Prettier yarn prettier is applied.

I've added comprehensive schema validation tests for all validation functions in the centralized validation system. The tests cover all schema types (any, boolean, number, string, binary, array, const, tuple, object, field, map, ref, or, function, streaming function) with both valid and invalid cases. I've also applied the Biome formatter (the project uses Biome instead of Prettier) to ensure proper code formatting. All tests pass and the code builds successfully.

Commit: 875f74f

Copilot AI requested a review from streamich July 26, 2025 16:38
Copilot finished work on behalf of streamich July 26, 2025 16:38
@streamich streamich merged commit b93b84b into master Jul 26, 2025
2 checks passed
@streamich streamich deleted the copilot/fix-15 branch July 26, 2025 22:55
@github-actions
Copy link

🎉 This PR is included in version 1.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor type validateSchema() methods

2 participants