Skip to content

Conversation

@seansica
Copy link
Contributor

@seansica seansica commented Oct 17, 2025

Description of what has changed

Grab bag of various schema refactors:

  • Overhauled granularMarkingSchema to comply more aggressively with STIX
  • Create new property-schemas sub-package to store property-specific schemas
  • Split common-properties.ts into smaller purpose-driven files (file was nearing 1000 lines)
  • Adds more description metadata to schemas
  • Creates a clearer separation between STIX and ATT&CK schemas
  • Changes imports to import using index.ts where possible
  • Eliminates intra-package barrel imports that may cause circular dependencies
  • Eliminates absolute path imports using @ (relative paths preferred for libraries)
  • Add JSDoc to a bunch of Zod schemas and TypeScript types

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you lint your code locally prior to submission?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

- Adds .min(1) to all array schemas
- Introduces generic.ts containing nonEmptyRequiredString, stixListOf, and stixListOfString
- Replace most z.string and z.array instances with new generic schemas
- Move .meta declarations to end of composition chains in some places

Notably, all z.string().nonempty() calls have been supplanted by nonEmptyRequiredString
This is a non breaking change
- Move all schemas from misc.ts to common-properties.ts and delete misc.ts
- Add comprehensive JSDoc to all exports in common-properties.ts
- Update imports in dependent modules
…bustness

- Overhauled granularMarkingSchema to comply more aggressively with STIX
- Create new property-schemas sub-package to store property-specific schemas
- Split common-properties.ts into smaller purpose-driven files (file was nearing 1000 lines)
- Adds more description metadata to schemas
- Creates a clearer separation between STIX and ATT&CK schemas
- Changes imports to import using index.ts where possible
- Eliminates intra-package barrel imports that may cause circular dependencies
- Eliminates absolute path imports using @ (relative paths preferred for libraries)

Overhaul, this is a comprehensive house-keeping refactor that should make the schemas easier to maintain
@seansica seansica linked an issue Oct 17, 2025 that may be closed by this pull request
@seansica seansica merged commit 5b77f7f into main Oct 17, 2025
4 checks passed
@seansica seansica deleted the 51-bug-fix-zod-nonempty-strings branch October 17, 2025 21:02
@github-actions
Copy link

🎉 This PR is included in version 4.5.1 🎉

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.

[BUG] Fix Zod nonempty strings

1 participant