[BUG] openapi-generator-cli fails silently when it cannot create openapitools.json
@kay-schecker 已经在做这个了。
开始于 2021年6月18日。
评估
这个 Issue 还没有评估数据。
描述
🐛 Bug Report:
Describe the bug
openapi-generator-cli fails silently when it cannot create openapitools.json
Steps to Reproduce
Steps to reproduce the behavior:
~/openapi-test
❯ node --version
v12.15.0
~/openapi-test
❯ npm --version
6.13.4
~/openapi-test
❯ java --version
openjdk 11.0.6 2020-01-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.6+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.6+10, mixed mode)
❯ npm install @openapitools/openapi-generator-cli@2.3.5
...
~/openapi-test
❯ cat swagger.yaml
swagger: "2.0"
info:
version: v1
title: Our API
description: The REST API for interacting with Our API
host: localhost:1234
schemes:
- http
paths:
"/api/job/{jobid}/status":
get:
summary: getJobStatus
description: Get the current status for a job.
operationId: getJobStatus
produces:
- application/json;charset=utf-8
parameters:
- required: true
in: path
name: jobid
type: string
responses:
"200":
schema:
$ref: "#/definitions/JobStatus"
description: ""
"404":
description: "`jobid` not found"
definitions:
JobStatus:
type: string
~/openapi-test
❯ $(npm bin)/openapi-generator-cli generate -i swagger.yaml --generator-name typescript-fetch
...
~/openapi-test
❯ ls apis/
DefaultApi.ts index.ts
~/openapi-test
❯ mkdir readonly
~/openapi-test
❯ chmod u-w readonly
~/openapi-test
❯ cd readonly
~/openapi-test/readonly
❯ touch test
touch: cannot touch 'test': Permission denied
~/openapi-test/readonly
❯ $(npm bin)/openapi-generator-cli generate -i ../swagger.yaml --generator-name typescript-fetch --output ..
~/openapi-test/readonly
❯ echo $?
1
~/openapi-test/readonly
❯ chmod u+w .
~/openapi-test/readonly
❯ cp ../openapitools.json .
~/openapi-test/readonly
❯ ls
openapitools.json
~/openapi-test/readonly
❯ chmod u-w .
~/openapi-test/readonly
❯ $(npm bin)/openapi-generator-cli generate -i ../swagger.yaml --generator-name typescript-fetch --output ..
... (works)
Expected behavior
The command prints an explanation of why the command is failing, or any next steps on how to debug
Operation System (please complete the following information):
- OS: Ubuntu 18 LTS
Package System (please complete the following information):
See reproduction for versions
Additional context
This cost me many, many hours of debugging because it only occurred in CI where volumes with no writes expected are mounted readonly, and during local testing we tend to already have an openapitools.json
- 主要语言
- TypeScript
- 星标
- 2k
- 派生
- 208
- 平均合并
- 7 小时 12 分钟
- 30 天内合并 PR
- 6
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
OpenAPITools/openapi-generator-cli 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
-
bug
OpenAPITools/openapi-generator-cli#1213 · 已指派 1 人 ·
-
bug
OpenAPITools/openapi-generator-cli#1190 · 已指派 1 人 ·
-
bug
OpenAPITools/openapi-generator-cli#1138 · 1 条评论 · 已指派 1 人 ·
-
bug
OpenAPITools/openapi-generator-cli#1094 · 1 条评论 · 已指派 1 人 ·
查看 OpenAPITools/openapi-generator-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
mksglu/context-mode#1200 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
难度 2/5 1-3 小时 新手友好度 75/100
anthropics/claude-code#96687 ·
-
good first issue
难度 1/5 1 小时以内 新手友好度 95/100
AOSSIE-Org/DebateAI#582 · 2 条评论 ·