OAI / OAI/OpenAPI-Specification

Share header with multiple response objects

未关闭
#369 13 条评论 13 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

re-use: globals/defaults
主要语言
Markdown
星标
31.2k
派生
9.2k
平均合并
6 小时 37 分钟
30 天内合并 PR
27

描述

Can there not just be a simple header generically at the response level not specific to each of the status codes? For our case, this kind of header is 99% the same across our codebase.


---

responses:
  200:
    description: no error
    headers:
      Content-Type:
        description: application/json
        type: string

It would be a pain to copy+paste this to each and every routine that supports HTTP JSON responses.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先阅读 OpenAPI Specification repository 中关于 response object 的规则,并比较当前如何在各个状态码下定义 header。定义共享 response-level header 的有效范围和结构,然后更新相关的规范文本和示例,使该功能的行为明确无歧义。

由索引模型根据 Issue 内容生成。

评估

技术栈
openapi
领域
api
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。