Skip to content

OpenAPI v2 converter: NullPointerException when info section is missing #755

@jmini

Description

@jmini

With a OAS2 Spec like this:

swagger: '2.0'
host: petstore.swagger.io
basePath: /v2
schemes:
  - http
paths:
  /ping:
    post:
      summary: test
      description: 'test it'
      operationId: pingOp
      responses:
        '200':
          description: OK

There is a NullPointerException during conversion OAS2 -> OAS3:

Exception in thread "main" java.lang.NullPointerException
	at io.swagger.v3.parser.converter.SwaggerConverter.convert(SwaggerConverter.java:422)
	at io.swagger.v3.parser.converter.SwaggerConverter.convert(SwaggerConverter.java:144)
	at io.swagger.v3.parser.converter.SwaggerConverter.readLocation(SwaggerConverter.java:93)
	at io.swagger.parser.OpenAPIParser.readLocation(OpenAPIParser.java:19)

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