Allowed function-like type validators#330
Closed
KOLANICH wants to merge 1 commit intopython-jsonschema:masterfrom
KOLANICH:func_type_validator
Closed
Allowed function-like type validators#330KOLANICH wants to merge 1 commit intopython-jsonschema:masterfrom KOLANICH:func_type_validator
KOLANICH wants to merge 1 commit intopython-jsonschema:masterfrom
KOLANICH:func_type_validator
Conversation
Member
|
Hi. Thanks. This change is missing context, tests, and documentation :). Context is probably most important. Can you describe what functionality this changeset is trying to add, or since I can mostly tell, why adding that functionality in this way is a good idea? My first inclination is that there are other, better ways to implement this without overloading the type validator. |
Author
|
20 апреля 2017 г. 14:47:46 GMT+03:00, Julian Berman <notifications@github.com> пишет:
Hi. Thanks.
This change is missing context, tests, and documentation :).
Context is probably most important. Can you describe what functionality
this changeset is trying to add, or since I can mostly tell, why adding
that functionality in this way is a good idea?
My first inclination is that there are other, better ways to implement
this without overloading the type validator.
Can you describe what functionality this changeset is trying to add
In fact I only wanted to add a type for functions and function-like objects into a schema. To check if a type is callable you have to call ```callable()```. But current code uses instanceof only. I guess there can be more types checked with functions.
|
Member
|
Have you considered using the The |
Author
|
No, haven't considered that. |
Member
|
Gonna close this out, give that a shot -- feel free to reopen if you'd like to discuss further. |
Julian
added a commit
that referenced
this pull request
Apr 25, 2020
d17e1ba2 [242] Add pattern tests for numbers, objects, arrays, and null a5302a46 [329] Add tests for uniqueItems=false 0bf6358f [166] Add null-in-enum test 807591f0 Merge pull request #340 from karenetheridge/ether/markdown-conflict-markers e4c82f21 disambiguate underline from git conflict marker c4d3e0f9 Merge pull request #333 from zhxiaogg/tests-for-duration-format 618b30dc not all duration impl support year and month 926d0b3d tests for duration format 22eaffcd Merge pull request #331 from jdanyow/patch-2 b2e553e9 Merge pull request #330 from jdanyow/patch-1 9db34a17 remove unused constant cbf4654d fix typo in ref test description 44517887 Merge pull request #326 from awwright/master 0da2aaa1 Backport nested allOf/anyOf/oneOf tests 34a2dfa3 Add nested allOf, oneOf tests git-subtree-dir: json git-subtree-split: d17e1ba218bbd023d45182e014c0ce341bb36b16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
type_backup. Your tests are messing withtypesomewhere, so I had to do this. I won't fix that, so don't forget to replace type_backup with type when you fix that.