swagger-api / swagger-api/swagger-parser
Schema type incorrectly set when omitted and items 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 enums 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:
ASchemaGivenForItems:
items:
type: integer
When parsing the above schema, type should be unset on ASchemaGivenForItems
When one checks
- ASchemaGivenForItems, the parser incorrectly set type to array when it should remain unset.
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 OpenAPI sample in the report and inspect how swagger-parser handles a schema with items but no type. Add a regression check showing that ASchemaGivenForItems keeps type unset, then run the relevant parser tests to confirm the correction.
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
- 45/100