better support for typing
talarari opened this issue · comments
talarari commented
first of all love the client, really makes working with wiremock in python simple. :)
would be great if if the models for the library were typed more strongly, for autocomplete and all the other beneifits.
so instead of doing
@add_metaclass(BaseEntityMetaType)
class RequestResponseDefinition(BaseAbstractEntity):
status = JsonProperty("status")
transformers = JsonProperty("transformers", klass=list)
from_configured_stub = JsonProperty("fromConfiguredStub") # will be true/false
transformer_parameters = JsonProperty("transformerParameters", klass=dict)
would be
class RequestResponseDefinition(BaseAbstractEntity):
status = str
transformers = List[Transformer]
from_configured_stub = bool
transformer_parameters = dict[TransformerPrameter]
this can be achieved either with dataclasses or any other way (pydantic models, attr , etc)
Cody Lee commented
PR's welcome now that PY2 is EOL :)
Cody Lee commented
will be picking this up :) have some openapi specs for which to work off :)
Martin Roy commented
Hello!
If proper typing is coming i suggest making it mypy compatible , if that wasn't already the plan :)