OpenAPITools / OpenAPITools/openapi-diff

References are not resolved according to RFC3986

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

@joschi 已经在做这个了。

开始于 2024年6月15日。

  • #271 来自 @hiddewie —— 已关闭,未合并
  • #676 来自 @joschi —— 未关闭
enhancement
主要语言
Java
星标
1.1k
派生
190
PR 合并指标
30 天内没有已合并 PR

描述

See the specification here: https://swagger.io/docs/specification/using-ref/.
This points to RFC3986 (https://tools.ietf.org/html/rfc3986) for the structure of JSON references. This RFC is not supported in openapi-diff.

I made an example of a valid reference according to OpenAPI 3, for which OpenAPI diff throws an error. See https://github.com/OpenAPITools/openapi-diff/pull/271

Example content:

openapi: 3.0.1
info:
  title: Service
  description: test
  version: test
  contact:
    name: test
    url: 'test'
servers:
  - url: 'localhost'
paths:
  /feature:
    get:
      summary: Get feature state
      operationId: feature
      description: Gets feature
      parameters:
        - name: feature
          in: query
          schema:
            $ref: '#/components/schemas/Feature/properties/feature'    # <---- this
          required: true
      responses:
        '200':
          description: Found feature
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Feature'
components:
  schemas:
    Feature:
      type: object
      properties:
        feature:
          type: string
          enum:
            - alpha
            - beta
        value:
          type: boolean
      required:
        - feature
        - value

贡献指南

打开贡献指南

从这里开始

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

调研方向

从提供的 OpenAPI 示例开始,将其 RFC3986 引用与 openapi-diff 中 resolver 的行为进行比较。查看链接的规范和现有的 pull request,然后验证属性引用可以被接受且不会报错,并确认现有的引用处理仍然正确。

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

评估

技术栈
java
领域
api
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

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