英文:
The line import openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" is added when generating from openapi-generator prompts login
问题
我正在使用openapi生成器生成我的REST API客户端。它生成了以下代码行:
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
在我的导入部分,但我无法理解为什么要这样做。当我运行go mod vendor
命令时,它提示我登录,而这行代码存在时。这行代码试图导入什么?我在一个企业版的GitHub上,可能会复杂化事情。示例README中说要添加这行代码,但没有解释它的作用。链接
英文:
I am using openapi generator to generate my rest api client. It generates the line
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
In my imports but I can't for the life of me understand why. Running a go mod vendor
prompts me to sign in while this line is in place. What is this trying to import? I'm on an enterprise github, which would complicate things. The example README says to add this line but provides no explanation of what it is doing https://github.com/OpenAPITools/openapi-generator/blob/master/samples/openapi3/client/petstore/go/go-petstore/README.md#:~:text=%22github.com/GIT_USER_ID/GIT_REPO_ID%22
答案1
得分: 2
你可以将这些作为参数传递给OpenAPI Generator客户端:
openapi-generator-cli generate \
-i openapi.yaml
-g go \
-p packageName=mypackage \
-o /src \
--git-repo-id my-go-lib/v1 --git-user-id user1 \
这将导致以下结果:
openapiclient "github.com/user1/my-go-lib/v1"
英文:
You can pass those to the OpenAPI Generator client as parameters:
openapi-generator-cli generate \
-i openapi.yaml
-g go \
-p packageName=mypackage \
-o /src \
--git-repo-id my-go-lib/v1 --git-user-id user1 \
that will result in
openapiclient "github.com/user1/my-go-lib/v1"
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论