Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better support for typing #34

Open
talarari opened this issue Nov 8, 2020 · 3 comments
Open

better support for typing #34

talarari opened this issue Nov 8, 2020 · 3 comments
Labels
version_3 Version 3 Specific feature

Comments

@talarari
Copy link

talarari commented Nov 8, 2020

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)

@platinummonkey
Copy link
Collaborator

PR's welcome now that PY2 is EOL :)

@platinummonkey
Copy link
Collaborator

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

@platinummonkey platinummonkey added the version_3 Version 3 Specific feature label Oct 31, 2021
@platinummonkey platinummonkey added this to the Version 3.x milestone Oct 31, 2021
@lindycoder
Copy link

Hello!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version_3 Version 3 Specific feature
Projects
None yet
Development

No branches or pull requests

3 participants