这是indexloc提供的服务,不要输入任何密码
Skip to content

Body stringified before parsing through zod, nuxt #2470

@Ewoodss

Description

@Ewoodss

Description

In our application using hey-api with Nuxt, we are encountering an issue where the body of a POST request is being stringified before it undergoes validation with Zod. This results in Zod throwing an error, as it expects an body of type object but receives a body of type string instead.

Reproducible example or configuration

const pet = {
	name: "biggy",
	photoUrls: [""],
};

await addPet({
	composable: "$fetch",
	body: pet,
})

OpenAPI specification (optional)

https://raw.githubusercontent.com/swagger-api/swagger-petstore/master/src/main/resources/openapi.yaml

System information (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🔥Something isn't workingclientClient package related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions