python-jsonschema / python-jsonschema/check-jsonschema

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

Open
#449 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
341
Forks
71
Avg merge
15d 20h
Merged PRs (30d)
4

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported result with the provided OpenAPI schema and instance through the check-jsonschema CLI. Inspect how the CLI discovers the schema and handles OpenAPI components, then verify that missing required properties and values outside minimum or maximum are rejected.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, python
Domain
api, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.