Skip to content

Fix issues with serialization and GDA compatibility#139

Merged
callumforrester merged 3 commits intomainfrom
gda-compatibility
Apr 21, 2023
Merged

Fix issues with serialization and GDA compatibility#139
callumforrester merged 3 commits intomainfrom
gda-compatibility

Conversation

@callumforrester
Copy link
Copy Markdown
Contributor

@callumforrester callumforrester commented Apr 21, 2023

Changes:

  • Change default pydantic config so that documents can be deserialized from JSON with camelCase fields but constructed in Python with snake_case fields.
  • Add tests to catch if this config ever breaks
  • Serialize models with aliases in messaging

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2023

Codecov Report

Merging #139 (d0c1be5) into main (90b4710) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #139      +/-   ##
==========================================
+ Coverage   74.52%   74.54%   +0.02%     
==========================================
  Files          37       37              
  Lines        1048     1049       +1     
==========================================
+ Hits          781      782       +1     
  Misses        267      267              
Impacted Files Coverage Δ
src/blueapi/utils/base_model.py 100.00% <100.00%> (ø)
src/blueapi/utils/serialization.py 87.50% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@callumforrester callumforrester marked this pull request as ready for review April 21, 2023 15:22
@callumforrester callumforrester merged commit 60b731e into main Apr 21, 2023
@callumforrester callumforrester deleted the gda-compatibility branch April 21, 2023 15:28
keithralphs pushed a commit that referenced this pull request Apr 28, 2023
* Allow use of snake case on pydantic models internally

* Test camelCase models to avoid regression

* Serialize by alias
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