OpenAPITools / OpenAPITools/openapi-generator
[BUG][C] The bundled cJSON is an old version, and it should be a library dependency anyway
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Currently cJSON is just a copy of the v1.7.7 sources (with a few typo fixes in comments). It's old (2018) and not used like a library dependency really should. It should be dynamically linked like is already done with OpenSSL and libcurl.
Word diff of upstream cJSON v1.7.7 and openapi-generator's bundled copy:
Here's the script from the screenshot:
#!/usr/bin/env bash
domain='https://raw.githubusercontent.com'
a="$domain/DaveGamble/cJSON/refs/tags/v1.7.7"
b="$domain/OpenAPITools/openapi-generator/refs/heads/master"
b+='/modules/openapi-generator/src/main/resources/C-libcurl'
for f in cJSON.{c,h}; do
printf -vx "%0${#f}d"
x="+-${x//0/-}-+"
printf "\n$x\n| %s |\n$x\n" "$f"
git diff -U0 --no-index --color=always --color-words \
<(curl "$a/$f" -s) <(curl "$b/$f.mustache" -s) \
| tail -n+4
done
echo
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/resources/C-libcurl, where the bundled cJSON sources are represented by cJSON.c.mustache and cJSON.h.mustache. Compare how OpenSSL and libcurl are handled as library dependencies, then inspect the generated C client build setup. Done means cJSON is no longer bundled and generated clients link it dynamically like the other external libraries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100