Skip to content

fix: schema class can set Meta.unknown#1885

Merged
ianco merged 10 commits intoopenwallet-foundation:mainfrom
dbluhm:fix/base-model-unknown
Oct 24, 2022
Merged

fix: schema class can set Meta.unknown#1885
ianco merged 10 commits intoopenwallet-foundation:mainfrom
dbluhm:fix/base-model-unknown

Conversation

@dbluhm
Copy link
Copy Markdown
Contributor

@dbluhm dbluhm commented Aug 4, 2022

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 added 2 commits August 4, 2022 12:20
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
@dbluhm dbluhm marked this pull request as ready for review August 4, 2022 16:55
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 9, 2022

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     

@sonarqubecloud
Copy link
Copy Markdown

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
Copy link
Copy Markdown

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
Copy link
Copy Markdown

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

@ianco ianco merged commit b243f20 into openwallet-foundation:main Oct 24, 2022
@dbluhm dbluhm deleted the fix/base-model-unknown branch July 7, 2023 13:58
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.

3 participants