wiremock / python-wiremock

A Python library for API mocking and testing with Testcontainers module and WireMock

Home Page:https://wiremock.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

better support for typing

talarari opened this issue · comments

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)

PR's welcome now that PY2 is EOL :)

will be picking this up :) have some openapi specs for which to work off :)

Hello!

If proper typing is coming i suggest making it mypy compatible , if that wasn't already the plan :)