Skip to content

Support booleans and numbers for query values #141

Closed

Description

@LucasPickering

It'd be nice if non-string values in a query were automatically stringified:

list_fish:
  method: GET
  url: "{{host}}/fishes"
  query:
    big: true

Right now, this gives an error because true is a boolean and it expects a string. It'd be nice if booleans, ints and floats all deserialized into their stringified version.

I think the best way to do this would be to implement Deserialize manually for Template. I would put the implementation in cereal.rs to keep all the serde stuff in one place. This has the added effect of automatically supporting bools/ints/floats for any other templated value (body, profile value, etc.) which is probably good but needs a bit more critical thought to be sure.

Activity

  1. added
    qolImprovements that make usage smoother, without introducing new functionality
    help wantedExtra attention is needed
    on Apr 7, 2024
  2. added a commit that references this issue on Apr 24, 2024
    eb7f0cc
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

    good first issueGood for newcomershelp wantedExtra attention is neededqolImprovements that make usage smoother, without introducing new functionality

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions