Open WildEgo opened 1 month ago
Hey, can you share your config, which version you're on, and OpenAPI spec?
Hey, can you share your config, which version you're on, and OpenAPI spec?
Version should be 0.45.1
, the config is below
import { defineConfig } from '@hey-api/openapi-ts';
export default defineConfig({
client: 'fetch',
input: '../dashboard/api.json',
output: {
format: false,
lint: false,
path: 'src/client',
},
types: {
enums: 'typescript',
},
});
I assume the same happens with the latest version? Can you share your OpenAPI spec?
I assume the same happens with the latest version? Can you share your OpenAPI spec?
Yes it does happen on 0.46.2
, I can provide the spec but it's not gonna do much for this specifically this is the part that is probably causing the issue, I should add that it generates the code below, I'll also add an expected behaviour
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"type": "object",
"additionalProperties": {
"type": "{}"
}
}
}
}
},
Generates:
export type StoreRequestData = {
acceptLanguage?: string;
formData?: {
[key: string]: ();
};
service: string;
};
I'd expect it to be
export type StoreRequestData = {
acceptLanguage?: string;
formData?: {
[key: string]: unknown;
};
service: string;
};
Great, thanks! And what does your payload passed to form data look like?
Great, thanks! And what does your payload passed to form data look like?
It's a simple structure, there's no depth, some values are string
, some are Date
some are File
, I haven't had a look at the files, I'll have to see if they work or not
Description
After running the code below with a
new Date()
the code gets parsed as the snippet below the code, I'd expect it to return2024-05-22T23:00:00.000Z
as opposed to"2024-05-22T23:00:00.000Z"
OpenAPI specification (optional)
No response
Configuration
No response
System information (optional)
OS: EndeavourOS rolling x86_64 Browser: Firefox, Opera, Chromium Bun version: 1.1.8