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

When Class is derived from BaseClass enum validation is not working correctly. #56

Open
jaunruh opened this issue Feb 22, 2020 · 0 comments

Comments

@jaunruh
Copy link

jaunruh commented Feb 22, 2020

I am using MongoDB and since MongoDB adds a "_id" field before saving an element to the Database, I made a Base class as follows:

mongo_db_base_schema = {
	'type': 'object',
	'properties': {'_id': {}},
}
BaseClass = warlock.model_factory(mongo_db_base_schema)

When I now use SomeOtherModel = warlock.model_factory(other_model_schema, base_class=BaseClass) where other_model_schema contains an enum, my enum validation stops working.

EDIT:
It does not seem to just break enum validation. For me it breaks the entire validation. So using a BaseClass is pretty much useless because my entire validation breaks.

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

No branches or pull requests

1 participant