swagger-api / swagger-api/swagger-parser
missing type property is improperly ignored without much warning
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 867
- Forks
- 560
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 7
Description
A Schema Object without a type key seems to just get dropped. The spec has little clarification for a case like this but I believe it is valid. This should either but clarified and made an error or the parser should handle this more gracefully recording that the attribute exists but for example has a default type (like object or something). It's also possible the warning should just be more specific.
example case.
swagger: '2.0'
info:
title: example
version: "0"
paths: {}
definitions:
aDef:
type: object
properties:
initialValue:
description: "I'm invisible!"
cross post of
https://github.com/swagger-api/swagger-codegen/issues/5335
related:
https://github.com/swagger-api/swagger-codegen/issues/5164
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 with the Swagger 2.0 example in the issue and trace how the parser handles the Schema Object under definitions.aDef.properties.initialValue when type is absent. Review the linked swagger-codegen issues 5335 and 5164 for context and determine whether the expected result is an error, a warning, or preserving the attribute with a default type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100