swagger-api / swagger-api/swagger-parser

[REQ] How about adding unit tests that use json schema test cases?

Open
#1,771 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
867
Forks
560
Avg merge
2d 21h
Merged PRs (30d)
7

Description

Is your feature request related to a problem? Please describe.

How about adding unit tests that use json schema test cases?

Describe the solution you'd like

Parse the json test case schemas and check that schema properties are set correctly.

openapi-version json-schema-version json schema tests
3.1.0 2020-12/draft-bhutton-json-schema-00 draft2020-12
3.0.3 Draft5/draft-wright-json-schema-00 None: Draft 5 wasn't an official release for JSON Schema. It was more of a trial. Publishing it was skipped as we took lessons learned into draft 6. per a comment in in json-schema Slack. If one wanted to one could use Draft6 tests with omissions

Describe alternatives you've considered

N/A

Additional context

This came up when I was working on these PRs:

Which bring the json schema test cases into the openapi ecosystem and use them for testing.

Related Issues:

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 reviewing the related pull requests and the linked JSON Schema Test Suite cases for draft2020-12 and draft6. Determine how the test cases should be parsed for OpenAPI 3.1.0 and 3.0.3; done means unit tests check that schema properties are set correctly for the supported cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, json
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.