null bytes (\u0000
) not correctly escaped in generated code
#1850
Labels
bug
Something isn't working
\u0000
) not correctly escaped in generated code
#1850
Describe the bug
A schema containing a NUL character
\u0000
becomes a literal (i.e. not escaped) NUL in the generated Python file. This is a SyntaxError.To Reproduce
Example schema:
Used commandline:
Expected behavior
Bytes invalid in source code should use the appropriate escape sequence.
Version:
Additional context
I first encountered it with regex pattern properties, but it appears to be a general issue with just strings.
Notably this applies to all output-model-types with the exception of
typing.TypedDict
, where it's correctly escaped to'\x00'
in Literal.The text was updated successfully, but these errors were encountered: