Skip to content

Releases: ScoreVision/ja_spex

Release 0.1.1

15 Nov 01:30

Choose a tag to compare

Release 0.1.1

Bug Fix: Path.join Crash on Empty Error Paths

Fixed

  • Critical bug: Fixed FunctionClauseError crash when rendering errors with empty paths from OpenApiSpex validation
  • Root-level validation errors (e.g., type mismatches at request body root) now correctly return "/" as the JSON Pointer per JSON:API specification
  • Prevents application crashes on legitimate validation scenarios

Added

  • Comprehensive test coverage for JaSpex.RenderError module
  • Tests covering empty paths, nested paths, and mixed error scenarios
  • Edge case testing for numeric path elements and various error types

Technical Details

The bug occurred when Path.join/1 received an empty list from OpenApiSpex errors with empty paths. This has been resolved by adding a guard clause that handles the empty path case explicitly, returning "/" for root-level errors while maintaining proper behavior for nested paths.

Impact

Any API using ja_spex that could generate root-level validation errors would previously crash. This release ensures proper 422 error responses are returned to clients in all validation scenarios.


Full Changelog: 0.1.0...0.1.1

0.1.0

01 Jul 18:50

Choose a tag to compare

update readme