Skip to content

better support for typing #34

@talarari

Description

@talarari

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)

Activity

platinummonkey

platinummonkey commented on Nov 9, 2020

@platinummonkey
Collaborator

PR's welcome now that PY2 is EOL :)

platinummonkey

platinummonkey commented on Oct 22, 2021

@platinummonkey
Collaborator

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

added this to the Version 3.x milestone on Oct 31, 2021
lindycoder

lindycoder commented on Jan 26, 2022

@lindycoder

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    version_3Version 3 Specific feature

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @platinummonkey@talarari@lindycoder

        Issue actions

          better support for typing · Issue #34 · wiremock/python-wiremock