Forum Discussion

IvanD's avatar
IvanD
Senior Member
2 years ago

[Bug Report] SoapUI 5.7.0 Import from swagger yaml fails because of $ref in parameter definition

Hello,

 

we have a swagger definition file in yaml and we are using $ref for parameter definition because the same parameter is used in multiple (many) endpoints.

But when import gets to this part of the code it fails and I receive error: 

 

 

java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because the return value of "io.swagger.models.parameters.Parameter.getIn()" is null

 

 

I looks like the import can not expand the $ref in to the parameter definition written behind the reference.

I tried the same yaml in ReadyAPI and it is working correctly.

Is there a solution for this, please?

 

 

Here I put the part of the code where it fails. In swagger editor this is a valid code without any errors.

 

openapi: 3.0.2
info:
  title: REST API
  description: "Test yaml for SoapUI import."
  version: 1.0.0
servers:
- url: /
  description: test
security:
- Auth: []
paths:
  /rest/fcc/users/{id}:
    get:
      tags:
      - FCC users and roles
      summary: Gets user with given id
      description: Returns user with given id.
      parameters:
      - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: Successful opperation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User_one'
        '404':
          description: Entity with given id does not exist
    delete:
      tags:
      - FCC users and roles
      summary: Deletes user with given id
      description: Removes user with given id.
      parameters:
      - $ref: '#/components/parameters/id'
      responses:
        '204':
          description: Successful deletion
components:
  securitySchemes:
    Auth:
      type: oauth2
      flows:
        password:
          tokenUrl: /resources/oauth/token
          scopes: {}
  parameters:
    id:
      name: id
      in: path
      required: true
      schema:
        type: integer
        example: 2
  schemas:
    User_one:
      type: object

 

 

 

 

 

 

 

 

No RepliesBe the first to reply