Skip to content

Support for different versions of API objects (View, Embed, Edit context parameters) #28

@oguzkocer

Description

@oguzkocer

The API returns a different set of fields of an object depending on as context & _fields parameters. One option we have to deal with this is to have every field of an object be optional. However, that would require the clients to spend extra time to deal with nullability of each field. It's also against our design goals, as we want to keep everything strongly typed as much as possible.

In order to have strongly typed objects while still supporting every scenario of context & _fields parameters, we would like to write a macro to generate different versions of an object. For example, for a UserObject, we might have UserViewObject, UserEditObject etc.

We'll still need one object with all its fields being optional, because with _fields parameter, any field might be omitted. However, we want to limit the usage of this object type.

We also need to have separate parsers for each context type.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions