You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using fjs to generate python code that does the validation (i.e. compile_to_code)
I'm working around #72 by just falling back to good (bad) old jsonschema and best_guess in the case I have a validationerror.
That means I don't use any of the information that's present in the JsonSchemaValueException. Looking at that code, I noticed that ~75% (out of a whopping 2.5MB) is used by the definition parts of the generated exceptions. When you have deeply nested definitions, that is to be expected, since the relevant part of the definition (for some part) is repeated throughout the tree.
Since I don't use that information, generating it (and loading it) seems wasteful. It would be nice if compile_to_code had a parameter that controlled the behavior of the generated raise JsonSchemaValueException, basically making (the relevant parts of) this commit conditional.
I managed to work around this a bit by hacking around in def exc but that doesn't "quite feel right".
The text was updated successfully, but these errors were encountered:
vanschelven
changed the title
Feature request: definition arg (and possibly more) of JsonSchemaValueException optionally generated
Feature request: make "context in exceptions" optional
Sep 19, 2024
I'm using fjs to generate python code that does the validation (i.e.
compile_to_code
)I'm working around #72 by just falling back to good (bad) old
jsonschema
andbest_guess
in the case I have a validationerror.That means I don't use any of the information that's present in the
JsonSchemaValueException
. Looking at that code, I noticed that ~75% (out of a whopping 2.5MB) is used by thedefinition
parts of the generated exceptions. When you have deeply nested definitions, that is to be expected, since the relevant part of the definition (for some part) is repeated throughout the tree.Since I don't use that information, generating it (and loading it) seems wasteful. It would be nice if
compile_to_code
had a parameter that controlled the behavior of the generatedraise JsonSchemaValueException
, basically making (the relevant parts of) this commit conditional.I managed to work around this a bit by hacking around in
def exc
but that doesn't "quite feel right".The text was updated successfully, but these errors were encountered: