quicktype icon indicating copy to clipboard operation
quicktype copied to clipboard

[Feature request][Python] CLI arg for keeping leading underscore for field names.

Open balazser opened this issue 3 years ago • 0 comments

I noticed quicktype cleans up the leading underscores in the field names that are parsed by --no-just-types init but not by --just-types.

rallyAPIMajor = int(from_str(obj.get("_rallyAPIMajor")))

I use quicktype to generate TypedDict typehints for API calls with JSON responses using the following command. quicktype -l python --no-nice-property-names --just-types --top-level Response then removing the __init__ constructor and inheriting from class Response(TypedDict).

Without leading underscores, the type schema is not representing the actual response schema. Could we add a CLI arg to keep the leading underscore? :pray:

balazser avatar Apr 25 '22 09:04 balazser