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

Defer evaluation of a UserObject schema entirely to resolve #55 #56

Conversation

jtv8
Copy link
Contributor

@jtv8 jtv8 commented Jan 16, 2021

Closes #55

Replaces class SchemaAnyRegisteredSubclass(SchemaAnyOf) with class UserObjectSchema(Schema), deferring the actual schema that a UserObject resolves to until it is used. This allows subclasses of the UserObject to be defined later, changing the resulting JSON schema (e.g. from a SchemaObject to a SchemaAnyOf, or adding additional options to a SchemaAnyOf).

@codecov
Copy link

codecov bot commented Jan 16, 2021

Codecov Report

Merging #56 (58bbd7d) into master (4248f63) will increase coverage by 0.08%.
The diff coverage is 96.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #56      +/-   ##
==========================================
+ Coverage   91.56%   91.65%   +0.08%     
==========================================
  Files          30       30              
  Lines         557      563       +6     
==========================================
+ Hits          510      516       +6     
  Misses         47       47              
Flag Coverage Δ
unittests 91.65% <96.15%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
wysdom/user_objects/UserObject.py 96.29% <93.75%> (-1.75%) ⬇️
wysdom/__version__.py 100.00% <100.00%> (ø)
wysdom/mixins/RegistersSubclasses.py 97.72% <100.00%> (+0.35%) ⬆️
wysdom/mixins/__init__.py 100.00% <100.00%> (ø)
wysdom/object_schema/SchemaAnyOf.py 92.85% <100.00%> (+2.53%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4248f63...58bbd7d. Read the comment docs.

@jtv8 jtv8 merged commit 0a521c6 into master Jan 16, 2021
@jtv8 jtv8 deleted the issue-55-Subclasses_of_UserObjects_are_omitted_as_valid_input_if_no_subclasses_were_defined_at_the_time_they_were_referenced branch January 16, 2021 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant