Skip to content

Conversation

@clemensv
Copy link
Contributor

Summary

This PR reorganizes the samples directory structure for better organization and clarity.

Core Samples Changes

  • Moved all schema files into numbered directories (01-11)
  • Each directory now contains:
    • schema.struct.json - the main schema file
    • Example instance files (valid/invalid examples)
  • Updated validate-all.ps1 script for new structure
  • Updated README.md with new directory layout

Import Samples Changes

  • Renumbered directories: 03-06 -> 01-04
  • Moved library schemas into consuming directories:
    • person-library/ and financial-library/ now in 02-namespace-import/
  • Updated all import references to use relative paths
  • Updated validate-imports.ps1 script
  • Updated README.md with new structure

Validation

  • All 11 core schemas pass validation
  • All 33 core instance files pass validation
  • All 4 import examples pass instance validation

Clemens Vasters added 4 commits November 25, 2025 12:31
Core samples:
- Move all schema files into their respective numbered directories
- Each directory now contains schema.struct.json + example files
- Update validate-all.ps1 with new paths
- Update README.md with new directory structure

Import samples:
- Renumber examples from 03-06 to 01-04
- Move library schemas (person-library, financial-library) into 02-namespace-import/
- Update all import references to use relative paths
- Update validate-imports.ps1 with new structure
- Update README.md to document reorganized layout

All validations pass successfully.
…dators

- Updated schema and instance validators to support all primitive types:
  - Added int8, uint8, int16, uint16, int128, uint128, float8 validation
  - Added integer type (alias for int32 per spec PR #16)
  - Moved 'any' from primitive to compound types

- Updated 03-financial-types sample to demonstrate all types:
  - Added number, integer, double, null, int16, int32 type usage
  - Updated examples with new fields (weight, discountPercent,
    paymentTermsDays, cancelledDate, sequenceNumber)

All 34 JSON Structure types are now covered across the samples.
Added tests for previously missing types:
- int8, uint8, int16, uint16, int128, uint128 (extended integer types)
- float8, double (floating point types)
- integer (alias for int32)
- duration (ISO 8601 duration strings)
- any (accepts all value types)

Total tests increased from 108 to 141.
…or schema validator

- Added missing maxLength to STRING_VALIDATION_KEYWORDS
- Added maxLength validation in _check_string_validation method
- Added tests for all 27 primitive types via test_all_primitive_types_valid
- Added tests for all 7 compound types via test_compound_types_recognized
- Added tests for numeric validation keywords on all numeric types
- Added tests for string-based numeric types (int64, uint64, int128, uint128, decimal)
- Added maxLength validation tests (valid, negative, not-integer)
- Added unknown type rejection test
- Total schema validator tests increased from 68 to 122
@clemensv clemensv merged commit 3fdcd68 into main Nov 27, 2025
1 check passed
@clemensv clemensv deleted the reorganize-samples branch November 27, 2025 08:17
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