OpenAPI format, `required` plus `minimum`/`maximum` fields

未關閉
#449 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
45/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
openapi, python
領域
api, cli

研究方向

首先,使用提供的 OpenAPI schema 和 instance,透過 check-jsonschema CLI 重現回報的結果。檢查 CLI 如何探索 schema 以及如何處理 OpenAPI 元件,然後驗證缺少必要屬性以及超出 minimum 或 maximum 的值會被拒絕。

由索引模型根據 Issue 內容生成。

描述

question

I'm trying to validate a schema generated my OpenAPI and check-jsonschema is not working with it. In particular, I need to check required plus minimum/maximum fields.

This is the schemafile:

{
  "components": {
    "schemas": {
      "my_data": {
        "type": "object",
        "properties": {
          "longitude": {
            "type": "number",
            "format": "decimal-degrees +/- DDD.D",
            "example": -107.6177275,
            "description": "the longitude of the observatory/instrument",
            "minimum": -180,
            "maximum": 180
          }
        },
        "required": ["longitude"]
      }
    }
  }
}

This is the instance an example of instance file: {"latitude":190.0}.

Currently check-jsonschema is returning ok -- validation done

主要語言
Python
星號
357
分支
74
平均合併
8 天 14 小時
30 天內合併 PR
3

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

python-jsonschema/check-jsonschema 的其他 Issue

查看 python-jsonschema/check-jsonschema 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。