Skip to content

Conversation

@daveshanley
Copy link
Member

@codecov
Copy link

codecov bot commented Sep 14, 2025

Codecov Report

❌ Patch coverage is 97.33925% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.06%. Comparing base (6c210a2) to head (b0bc165).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
helpers/schema_compiler.go 96.71% 5 Missing ⚠️
openapi_vocabulary/vocabulary.go 91.11% 4 Missing ⚠️
openapi_vocabulary/coercion.go 96.84% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #176      +/-   ##
==========================================
+ Coverage   96.91%   97.06%   +0.15%     
==========================================
  Files          34       40       +6     
  Lines        3952     4362     +410     
==========================================
+ Hits         3830     4234     +404     
- Misses        122      128       +6     
Flag Coverage Δ
unittests 97.06% <97.33%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

`AllowScalarCoercion` added to `ValidationOptions` combined with `WithScalarCoercion()` to allow the coercion of scalars (string → boolean/number/integer)

  // Basic usage (3.1+ strict mode)
  validator := schema_validation.NewSchemaValidator()
  valid, errors := validator.ValidateSchemaString(schema, payload)

  // OpenAPI 3.0 with nullable support
  valid, errors := validator.ValidateSchemaStringWithVersion(schema, payload, 3.0)

  // Jackson-style coercion enabled
  validator := schema_validation.NewSchemaValidator(config.WithScalarCoercion())
  valid, errors := validator.ValidateSchemaStringWithVersion(schema, payload, 3.0)

  // Get version from document
  version := doc.GetSpecInfo().VersionNumeric
  valid, errors := validator.ValidateSchemaStringWithVersion(schema, payload, version)
@daveshanley daveshanley merged commit 26566d8 into main Sep 15, 2025
4 checks passed
@daveshanley daveshanley deleted the v0.6.0 branch September 15, 2025 01:39
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