Describe
i liked the idea of this package a lot, i tried to use it and i discovered that the generated code breaks if the Literal string has a newline charachter
Reproduce
Package version: latest
run: json2models -m Lang en.json -f dataclasses > lang.py
JSON data:
{
"start": {
"hello": "hi\nbye"
}
}
Actual result
Class code:
@dataclass
class Lang:
start: 'Start'
@dataclass
class Start:
hello: Literal["hi
bye"]
Expected result
Class code:
@dataclass
class Lang:
start: 'Start'
@dataclass
class Start:
hello: Literal["hi\nbye"]
Additional context
i found out that there is already a quotation of ' and \ in json_to_models/dynamic_typing/complex.py: StringLiteral.__init__, but i am too new to opensource to open a PR and not break anything else 😅
Describe
i liked the idea of this package a lot, i tried to use it and i discovered that the generated code breaks if the Literal string has a newline charachter
Reproduce
Package version: latest
run: json2models -m Lang en.json -f dataclasses > lang.py
JSON data:
{ "start": { "hello": "hi\nbye" } }Actual result
Class code:
Expected result
Class code:
Additional context
i found out that there is already a quotation of ' and \ in json_to_models/dynamic_typing/complex.py: StringLiteral.__init__, but i am too new to opensource to open a PR and not break anything else 😅