[Feature request, Documentation] self-contained (npx) script with a selection of generator version as a CLI parameter
@kay-schecker đang làm issue này rồi.
Từ ngày 13/7/2021.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Current documentation only describes how to install the generator CLI globally (which is very impractical for any collaborative projects, especially when it comes to updating) or as a part of the project (note: you also forgot to add -D in a Locally (recommended) step).
There is also a new openapitools.json file introduced without describing any steps how we can avoid using it, especially if we intend to just accept its defaults anyway. When it comes to selecting the version of generator, documentation only provides a separate openapi-generator-cli version-manager set 4.0.0 command, but there doesn't seem to be an option to generate directly with a specified version without configuring it globally.
- Does this mean we have to 1. backup any old
openapitools.json, 2. set the version, 3. run the generator, 4. delete theopenapitools.json, and (optionally) 5. restore any oldopenapitools.jsonif we want to make this process self-contained? - For example, https://github.com/OpenAPITools/openapi-generator-cli/issues/386 describes a common default lazy setup that most developers will use without worrying about consequences, where we don't define any version, so the latest one is used automatically, and the
openapitools.jsongets created for no reason during the CI process.
Motivation: The main use-case (other than being unwilling to bloat the project) would be having multiple schemas in a larger project where we want to update the version of each script individually instead of controlling them all using the same openapitools.json file. (Sometimes we can't afford to impact someone else's code by our upgrade, as we need to quickly add a schema while keeping the project maintainable by keeping scripts compatible with CI instead of just copying the generated code, making us waste hours as we come up with workarounds.) We may also want to avoid installing this CLI to the project altogether, which is what npx is generally used for; especially if we want to run an encapsulated npm script from an environment that doesn't perform a full npm i. Also it makes it easier to always use latest CLI, only specifying version of the generator. There are many perspectives where "just running the generator" is the most preferable step, which is now difficult to do if we don't always want to use the latest version (including scenario when a private npm repo used by CI hasn't approved and mirrored new update yet).
Context: I had been using npx @openapitools/[email protected] generate as part of custom npm scripts. However, in the latest versions I'm unable to use npx @openapitools/[email protected] generate anymore.
Suggested solution: Add the following switches to generate command:
--standalone- skip using or generatingopenapitools.jsonfor this run (also fixes #386 if properly documented in context of CI). Use default; but maybe an option to override individual parameters via CLI could also replace the need for a second switch, e.g. as--standalone={"generator-cli":{"version":"5.2.0"}}--use-generator-cli-version- overridegenerator-cli.versionconfiguration for this run only
- Ngôn ngữ chính
- TypeScript
- Star
- 2k
- Fork
- 209
- Merge trung bình
- 9 giờ 35 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của OpenAPITools/openapi-generator-cli
-
[FEATURE] consider using caret ranges instead of pinned exact versions for runtime dependenciesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
[BUG] JAVA_OPTS is incorrectly evaluatedCó thể làm lại được @kay-schecker đã nhận 126 ngày trước và không có pull request nào đang mở. Đang mởbug
OpenAPITools/openapi-generator-cli#1213 · 1 người được giao ·
-
[BUG] Proxy configuration of NPM not used when downloading .jar via version managerCó thể làm lại được @kay-schecker đã nhận 180 ngày trước và không có pull request nào đang mở. Đang mởbug
OpenAPITools/openapi-generator-cli#1190 · 1 người được giao ·
-
[BUG] openapiGeneratorIgnoreList is missing from schemaCó thể làm lại được @kay-schecker đã nhận 231 ngày trước và không có pull request nào đang mở. Đang mởbug
OpenAPITools/openapi-generator-cli#1138 · 1 bình luận · 1 người được giao ·
-
[BUG] Environment variable not found (missing .env loading)Có thể làm lại được @kay-schecker đã nhận 269 ngày trước và không có pull request nào đang mở. Đang mởbug
OpenAPITools/openapi-generator-cli#1094 · 1 bình luận · 1 người được giao ·
Tất cả issue của OpenAPITools/openapi-generator-cli
Issue tương tự
-
fix: txId branch of the contract-state streams drops every state after the named transactionĐang mởbot:ai-assisted status:untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
midnightntwrk/midnight-js#1424 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
mksglu/context-mode#1268 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Edit:Đang mởcheck:failed streams:edit
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 60/100
iptv-org/iptv#54352 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Table] reserveSelectedRowOnPaginate=false 时表头全选包含其他页数据Có thể đã có người làm @dvd233 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Tencent/tdesign-react#4416 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:widget bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
interledger/publisher-tools#894 ·
Maintainer thường phản hồi trong vòng 1 ngày