Skip to content

swagger-v2-converter incorrectly converts 2.0 schemas that do not have the 'type' keyword #1378

@sebastien-rosset

Description

@sebastien-rosset

2.0 schemas without the type keyword are incorrectly converted to a ObjectSchema. For example, consider the following OAS 2.0 document:

swagger: '2.0'
info:
  title: AnyType test
  version: '1.0.0'
paths: {}
definitions:
  Foo:
    type: object
    properties:
      p1:
        type: object
      p2:
        description: test

Property p1 is an object, which is represented as a ObjectSchema. Property p2 does not have the type keyword specified, hence its value can be anything. It should be modeled an instance of the Schema class with the type property set to the null value. Currently it is modeled as an instance of ObjectSchema and the type property is set to object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions