-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transforming parameters causes incorrect type to be inferred #91
Comments
Hello alex, I recognize oauth with So you can just write it like that : const refreshClient = new Zodios(url, [
{
method: "post",
path: "/oauth_token.do",
alias: "getRefreshTokenWithCode",
requestFormat: 'form-url',
parameters: [
{
name: "body",
type: "Body",
schema: z
.object({
code: z.string(),
client_id: z.string(),
client_secret: z.string(),
redirect_uri: z.string().url(),
}),
},
],
response: z.object({
access_token: z.string(),
refresh_token: z.string(),
}),
},
] as const); you can take a look at the docs here Tell me if this handles your use case. |
Ah I did see that option but wasn't 100% certain that it did what I expected it to (I probably should've tested it). This fits my use case here perfectly but I do have another use case where I'd like to do a somewhat similar transformation. For example I want to have two inputs which I'll transform into one via a template literal. Happy to raise a separate request however 😊 |
But i'll try to add support for transformations. |
It's me again!
I've got a small issue which I'm hoping isn't a pain to resolve.
Essentially when performing a transform on a schema for a parameter, it seemingly infers the incorrect type. I've added an example below:
What I'd like to be able to do is to effectively simplify the inputs via a transform?
The text was updated successfully, but these errors were encountered: