Skip to content

Conversation

@t3rmin4t0r
Copy link

This makes PassThroughService.cmd() pass a --user command similarly to GeneratorService.cmd()

userInfo.uid !== -1 ? `--user ${userInfo.uid}:${userInfo.gid}` : ``;

In my build environment, this fixes file ownership issues when using direct CLI invocations with Docker.

The index.ts written by the CLI generator is owned by root user, when using

pnpm openapi-generator-cli generate -g typescript-fetch -o /local/output -i /local/input.json

The current workaround is to write it into the openapitools.json as a generator and do

pnpm openapi-generator-cli generate --generator-key typescript-api

which takes the code path which passes in --user and therefore produces user owned output files.

…cker.

Previously, PassThroughService.cmd() was missing the --user flag, causing
generated files to be owned by root (UID 0:0) instead of the current user.
@wing328
Copy link
Member

wing328 commented Nov 20, 2025

thanks for the PR

would it be possible to add a test or 2 covering this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants