aries-cloudagent-python icon indicating copy to clipboard operation
aries-cloudagent-python copied to clipboard

fix: schema class can set Meta.unknown

Open dbluhm opened this issue 3 years ago • 3 comments

This PR enables the Schema class of a model to determine the default unknown behavior. Without this, if you have a schema where you expect extra values to be present, every time deserialize or serialize is called, you must set unknown=INCLUDE. Now, in the Meta class of the Schema, unknown can be set to some value that will be respected as the default if not overrided by method parameter.

While I was at it, I also touched up some of the typing. I'm not fond of using @overload but I think it's the best way to address typing a method where a bool flag impacts the return type.

dbluhm avatar Aug 04 '22 16:08 dbluhm

Codecov Report

Merging #1885 (d2ea331) into main (a16347d) will decrease coverage by 0.01%. The diff coverage is 85.10%.

@@            Coverage Diff             @@
##             main    #1885      +/-   ##
==========================================
- Coverage   93.55%   93.53%   -0.02%     
==========================================
  Files         539      539              
  Lines       34526    34559      +33     
==========================================
+ Hits        32300    32326      +26     
- Misses       2226     2233       +7     

codecov-commenter avatar Aug 09 '22 01:08 codecov-commenter

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
8.4% 8.4% Duplication

sonarqubecloud[bot] avatar Aug 16 '22 18:08 sonarqubecloud[bot]

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Sep 20 '22 19:09 sonarqubecloud[bot]

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

sonarqubecloud[bot] avatar Oct 21 '22 16:10 sonarqubecloud[bot]