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
Use Mapping as a default SchemaNode typ. #162
Conversation
Thanks for the patch! I am +0 on the substance of the patch, but could you please back out the janitorial changes (the "Remove trailing whitespace" commit, I think) to make the bits being reviewed clearer? |
I have removed the irrelevant commit (my editor automatically removes the trailing garbage). |
So the general consensus with this issue is that SchemaNode should always require a type in some form passed into it, b/c it is meant to be a lower level abstraction. |
'Schema node construction without a typ argument or ' | ||
'a schema_type() callable present on the node class ' | ||
) | ||
return Mapping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be an instance of Mapping
. Specifically your options are:
@staticmethod
def schema_type():
return Mapping()
or
schema_type = Mapping
This PR needs a test. |
Ok, I'll provide tests as well. |
FWIW I think that |
We've decided to update the docs to indicate that the first parameter to |
Typ of the Node should have a reasonable default, just like the documentation for
_SchemaNode
suggests.