Skip to content

Base Auto Endpoints: add context to custom serializer #258

@marceloverdijk

Description

@marceloverdijk

The serializer options currently just passes in the object to transform/serialize.

export type Model = {
  tableName: string;
  schema: AnyZodObject;
  primaryKeys: Array<string>;
  serializer?: (obj: object) => object;
  serializerSchema?: AnyZodObject;
};

but I would like to access the context (mainly request params) here to decide how to transform it.

Rationale is an expand query param that would allow me to expand some objects in the response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions