Skip to content

Feature: consider adding generic support for dataclass-based bindings #416

Open
@elprans

Description

@elprans

Following up on the conversations in #66, and #409.

One possible way to implement generic handling of bindings is to allow users to annotate function parameters with a dataclass. The argument data is then treated as a conforming JSON object.

For example:

import dataclasses

@dataclasses.dataclass
class MyType:
    id: int
    body: str

def func(arg: MyType) -> str:
    return arg.body

In function.json such bindings would then have to specify dataType: json.

\cc @asavaritayal @pragnagopa @maiqbal11

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions