swagger-api / swagger-api/swagger-parser
Schema type incorrectly set when omitted and additionalProperties given
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 867
- Forks
- 560
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 7
Description
Schema type incorrectly set when omitted and additionalProperties given
Swagger-parser version: 2.0.31
Sample spec:
openapi: 3.0.3
info:
title: openapi 3.0.3 sample spec
description: sample spec for testing openapi functionality, built from json schema
tests for draft6
version: 0.0.1
paths: {}
components:
schemas:
PropertyNamedRefThatIsNotAReference:
properties:
$ref:
type: string
RefInAdditionalproperties:
additionalProperties:
$ref: '#/components/schemas/PropertyNamedRefThatIsNotAReference'
For RefInAdditionalproperties, type should be unset but the parser sets it to object
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 running the sample OpenAPI 3.0.3 specification through swagger-parser 2.0.31 and trace handling of additionalProperties containing a $ref. Add a regression test showing that RefInAdditionalproperties leaves type unset, then verify the parser no longer assigns object.
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
- 35/100