OpenAPITools / OpenAPITools/openapi-generator
[BUG][Typescript Axios] Binary format for strings always generate `any` type
Open
Nobody has claimed this yet.
Issue: Bug
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
When trying to generate a binary type for typescript, it always comes up with any
but this code dont working correctly?
openapi-generator version
5.4.0
OpenAPI declaration file content or url
objectTest:
type: object
description: 'test object'
properties:
file:
type: string
format: binary
Generation Details
Generated to:
export interface IObjectTest {
/**
*
* @type {any}
* @memberof IObjectTest
*/
file?: any;
}
Steps to reproduce
- Create any field (type = string, format = binary)
- Generate
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java around lines 438-442. Reproduce the issue with the provided binary string property and inspect the generated TypeScript interface. Done means the generated field no longer receives the unintended any type, with the relevant generator behavior covered by an appropriate test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, typescript
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100