Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce abstraction for validated elements #191

Merged
merged 24 commits into from
Sep 2, 2024
Merged

Introduce abstraction for validated elements #191

merged 24 commits into from
Sep 2, 2024

Conversation

OptimumCode
Copy link
Owner

@OptimumCode OptimumCode commented Aug 29, 2024

Make validation abstracted from the JsonElement

Related to #190
Resolves #193

@OptimumCode OptimumCode added enhancement New feature or request ABI breaking changes that break binary compatibility (does not mean they break API) API breaking changes that break API compatibility labels Aug 29, 2024
Copy link
Contributor

github-actions bot commented Aug 29, 2024

PR introduces changes to the public API

Please add "ABI breaking" label if any line in API file was changed or deleted.
Please add "API breaking" label if any public method in API file was changed or deleted.

Generated by 🚫 Danger Kotlin against 0646c19

Copy link

codecov bot commented Aug 29, 2024

Codecov Report

Attention: Patch coverage is 75.18248% with 34 lines in your changes missing coverage. Please review.

Project coverage is 90.45%. Comparing base (66d118a) to head (0646c19).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...mcode/json/schema/internal/wrapper/JsonWrappers.kt 85.71% 6 Missing ⚠️
...mumcode/json/schema/extension/ExternalAssertion.kt 0.00% 5 Missing ⚠️
...nal/factories/number/MultipleOfAssertionFactory.kt 0.00% 0 Missing and 4 partials ⚠️
...ories/array/ContainsAssertionFactoryDraft202012.kt 33.33% 0 Missing and 2 partials ⚠️
...timumcode/json/schema/internal/util/NumberParts.kt 33.33% 0 Missing and 2 partials ⚠️
...nal/factories/array/MaxContainsAssertionFactory.kt 50.00% 0 Missing and 1 partial ⚠️
...es/array/MaxContainsAssertionFactoryDraft202012.kt 50.00% 0 Missing and 1 partial ⚠️
...nal/factories/array/MinContainsAssertionFactory.kt 50.00% 0 Missing and 1 partial ⚠️
...es/array/MinContainsAssertionFactoryDraft202012.kt 50.00% 0 Missing and 1 partial ⚠️
...internal/factories/general/TypeAssertionFactory.kt 88.88% 0 Missing and 1 partial ⚠️
... and 10 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #191      +/-   ##
==========================================
- Coverage   90.67%   90.45%   -0.23%     
==========================================
  Files         130      133       +3     
  Lines        3840     3907      +67     
  Branches     1048     1064      +16     
==========================================
+ Hits         3482     3534      +52     
- Misses         65       76      +11     
- Partials      293      297       +4     

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

@OptimumCode
Copy link
Owner Author

OptimumCode commented Aug 29, 2024

Looks like there might be 10-15% overhead introduced by this change

https://github.com/OptimumCode/json-schema-validator/actions/runs/10610844930?pr=191#summary-29410178527

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'KMP JSON schema validator'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: fc624b7 Previous: 66d118a Ratio
macosX64.CommonAvgTimeBench.validateFlag ( {"objectPath":"openapi.json","schemaPath":"openapi_schema.json"} ) 3240.5333712990937 us/op 1976.2628132113823 us/op 1.64
macosX64.CommonAvgTimeBench.validateFlag ( {"objectPath":"openapi-invalid.json","schemaPath":"openapi_schema.json"} ) 2.261971690549861 us/op 1.41092880120124 us/op 1.60

This comment was automatically generated by workflow using github-action-benchmark.

CC: @OptimumCode

@OptimumCode OptimumCode marked this pull request as ready for review September 2, 2024 13:13
@OptimumCode OptimumCode merged commit 2f973dd into main Sep 2, 2024
21 checks passed
@OptimumCode OptimumCode deleted the feat/190 branch September 2, 2024 14:11
OptimumCode added a commit that referenced this pull request Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ABI breaking changes that break binary compatibility (does not mean they break API) API breaking changes that break API compatibility enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create an abstraction that will allow the validation steps to be generic
1 participant