How to set default value to custom header
还没有人认领这个 Issue。
评估
调研方向
未指定源文件或测试。首先,在 ./cli 中使用所示的 OpenAPI header 重现该问题,然后跟踪构建请求时如何处理 header 参数和 schema 默认值。完成的标准是生成的请求使用 "my-header",且无需 --Client-Type。
由索引模型根据 Issue 内容生成。
描述
Hi ,
I am trying to have a custom header in my spec like below :
- name: 'Client-Type'
in: header
schema:
type: string
./cli --Client-Type
I don't want to force user to pass the header like above example command, it should take from spec instead.
So I modified it like below :
- name: 'Client-Type'
in: header
schema:
type: string
default: "my-header"
nullable: true
Still, I don't see this header in my request. And it expects me to pass the same from CLI.
Can you please suggest on this ?
Thanks in advance ;)
- 主要语言
- Go
- 星标
- 218
- 派生
- 53
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
danielgtaylor/openapi-cli-generator 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 35/100
danielgtaylor/openapi-cli-generator#45 · 2 条评论 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 45/100
danielgtaylor/openapi-cli-generator#44 · 3 个 reaction ·
-
难度 5/5 一周以上 新手友好度 25/100
-
难度 3/5 1-2 天 新手友好度 35/100
danielgtaylor/openapi-cli-generator#41 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
查看 danielgtaylor/openapi-cli-generator 的全部 Issue
相似的 Issue
-
usage: a custom provider's balance meters ("…%" in the balance path) ignore the Left/Used switch未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
bug iam-service
难度 2/5 1-3 小时 新手友好度 76/100
platform-mesh/platform-mesh#425 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
grafana/tempo-operator#1691 ·
维护者通常 1 天内回复
-
fix: presentation.go with mcp-table.go: the message for each MCP server comes back可能已有人在做 @mge1512 今天认领。 未关闭bug
难度 1/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
slavakurilyak/awesome-ai-agents#827 ·
维护者通常 1 天内回复