-
-
Notifications
You must be signed in to change notification settings - Fork 270
Open
Labels
bug 🔥Something isn't workingSomething isn't workingclientClient package relatedClient package related
Description
Description
Hi, I encountered an issue when calling (with paramsStructure flat) a generated GET method.
The request path is incorrectly serialized as:
/servers/id,1335279038599663729
But it should be:
/servers/1335279038599663729
This looks like the {id} placeholder is not replaced properly and the value is appended with a comma.
Let me know if you need any further details or if I can provide additional logs or config.
Reproducible example or configuration
import { defineConfig } from '@hey-api/openapi-ts';
export default defineConfig({
input: './scripts/openapi-spec.json',
output: { path: './src/api/client', importFileExtension: '.js' },
plugins: [
'@hey-api/schemas',
{
name: '@hey-api/typescript',
topType: "any",
enums: {
case: 'preserve',
enabled: true,
mode: 'typescript'
}
},
{
name: '@hey-api/sdk',
asClass: true,
responseStyle: 'data',
paramsStructure: 'flat',
classNameBuilder: (name) => `${name}Service`
}
]
});OpenAPI specification (optional)
"/servers/{id}": {
"get": {
"parameters": [
{
"name": "id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/IServer"
}
}
}
}
},
"tags": [
"Servers"
],
"security": [],
"operationId": "GetServer"
},System information (optional)
@hey-api/openapi-ts: 0.87.5
Copilot
Metadata
Metadata
Assignees
Labels
bug 🔥Something isn't workingSomething isn't workingclientClient package relatedClient package related