OpenAPITools / OpenAPITools/openapi-generator
Objectmapper instance should not be created per api client invocation.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Objectmappers are heavy according to what I have read. Instead it is encouraged to use ObjectReader and ObjectWriter as lightweight alternatives.
For now, we suggest to create new APIClient per thread as its not thread safe. This will also result in creation of new object mapper per invocation.
ref:
For some cases, objectmapper is not configurable, for that we can allow setting mapper in apiclient via setters.
Can we add this improvement in future?
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 by locating APIClient and where its ObjectMapper is created for each invocation. Review the thread-safety and configurability constraints described in the issue, then define completion as avoiding unnecessary per-invocation mapper creation while supporting configurable mapping where needed and covering the behavior with tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100