-
Notifications
You must be signed in to change notification settings - Fork 9
refactor: improve populator naming and handling of structs in unmarshaller #16
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the code to improve naming conventions and handling of struct unmarshalling. In particular, it renames the ModelFromCore interface to Populator, updates error messages accordingly, and adapts test cases and related functionality to the revised naming and approach.
- Replace ModelFromCore with Populator across the codebase.
- Update error messages and helper functions for improved clarity.
- Adjust tests to invoke marshaller.Populate instead of marshaller.PopulateModel.
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| marshaller/unmarshaller.go | Updates to core model handling and required field validation using CoreModeler. |
| marshaller/populator.go | Renaming of interface from ModelFromCore to Populator and related changes in populateValue. |
| marshaller/*_test.go (various test files) | Tests modified to use the new Populator interface with updated naming. |
| extensions/* and arazzo/* | Adaptations to the new Populator interface in downstream packages. |
Comments suppressed due to low confidence (1)
arazzo/criterion/criterion.go:139
- In the Populate method of CriterionTypeUnion, the error message is printing the type of 'c' (the receiver) instead of 'source'. It should be updated to: return fmt.Errorf("expected core.CriterionTypeUnion, got %T", source).
return fmt.Errorf("expected core.CriterionTypeUnion, got %T", c)
📊 Test Coverage ReportCurrent Coverage: Coverage Change: 📉 -.2% (decreased) Coverage by Package
Generated by GitHub Actions |
No description provided.