swagger-api / swagger-api/swagger-parser
3.1.0 parsing of document with max/minContains removes constraint if value is a float
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 867
- Forks
- 560
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 7
Description
3.1.0 parsing of document with max/minContains removes constraint if value is a float
swagger-parser version: 2.1.1
For spec:
openapi: 3.1.0
servers:
- url: https://someserver.com/v1
info:
title: openapi 3.1.0 sample spec
version: 0.0.1
description: sample spec for testing openapi functionality, built from json schema
tests for draft2020-12
tags: []
paths: {}
components:
schemas:
MaxcontainsWithContainsValueWithADecimal:
$schema: https://json-schema.org/draft/2020-12/schema
contains:
const: 1
maxContains: 1.0
MincontainsWithContainsValueWithADecimal:
$schema: https://json-schema.org/draft/2020-12/schema
contains:
const: 1
minContains: 1.0
The parsed schema for MaxcontainsWithContainsValueWithADecimal has the value for maxContains set to null when it should be the value 1.0, a json number.
This prevents downstream users from being able to implement maxContains correctly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the supplied OpenAPI 3.1 document and trace how the Java parser handles maxContains and minContains when their values are written as 1.0. Done means both constraints remain present as the JSON number 1.0 in the parsed schema, with coverage for the reported cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100