OpenAPITools / OpenAPITools/openapi-generator

[question] [typescript] Any way to add lastModified property for generated Blob?

Open
#14,457 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Or override it from global.d.ts?

I'm working on a React Native project, the generated code for some reason doesn't have lastModified property for Blob object.

Screenshot 2023-01-11 at 3 44 51 am

Simply adding a property with value Date.now() and it's happy, like so:

            if (productCondition !== undefined) { 
                localVarFormParams.append('ProductCondition', new Blob([JSON.stringify(productCondition)], { type: "application/json", lastModified: Date.now()  }));
            }

Eventually I'll need to automate the regeneration of the api, any idea how to do this?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names generated TypeScript code and global.d.ts but no repository file or generator. Start by identifying the TypeScript client template that emits Blob and reproduce the React Native output. Done means establishing whether lastModified should be generated or typed differently, documenting the supported approach, and covering it with an appropriate generator test.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
api, mobile-dev, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.