Skip to content

Non-typing usage of annotations deprecated #1

@everilae

Description

@everilae

PEP-563 decrees that

With this in mind, uses for annotations incompatible with the aforementioned PEPs should be considered deprecated.

In other words non-typing usage of annotations is deprecated and this project has to adapt. The parameter annotations Query, Path, Body, and Header have to be replaced with some other mechanism. Possible solutions:

  • Arguments with a corresponding placeholder in the given path are path formatting parameters by default
  • Arguments of @get decorated methods are considered query parameters by default
  • Arguments of @post, @put, and @patch decorated methods form the body of the request by default – how exactly remains an open question.
    • Perhaps for POST, PUT and PATCH the first positional argument could be considered the body.
    • If content type is application/x-www-form-urlencoded, then arguments form the body.
  • Header has to be replaced with a decorator solution of some kind.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions