Skip to content

Fuzzing payload is always empty #180

@e-przestrzelski

Description

@e-przestrzelski

When running the latest version of cats locally against an API with valid OpenApi documentation provided, all fuzzers (including HappyPath) have an empty fuzzing payload.

Steps to reproduce:
Run the following command:
cats --contract=contract.yaml --server=https://localhost:7479 --headers=headers.yaml --refData=input-data.yaml --cachePayloads=false --fuzzer=HappyPath --debug --verbosity=DETAILED

headers.yaml include authorization JWT

input-data.yaml:

/vacancies:
    title: "test cats 27.11.2025"
    vacancyTemplateId: "7CB12798-A113-4E20-9F8F-3733653F119C"

contract.yaml:

openapi: 3.1.1
info:
  title: VacanciesApi.Service | v1
  version: 1.0.0
servers:
  - url: https://localhost:7479
paths:
  /vacancies:
    post:
      tags:
        - VacanciesApi.Service
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateVacancyRequest"
        required: true
      responses:
        "200":
          description: OK
        "400":
          description: Bad Request
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
      security:
        - Bearer: []
components:
  schemas:
    CreateVacancyRequest:
      type: object
      properties:
        title:
          type: string
          description: The localized title of the vacancy.
        departmentId:
          type:
            - "null"
            - string
          description: The identifier of the department associated with the vacancy.
          format: uuid
        deadlineDate:
          type:
            - "null"
            - string
          description: The deadline date for applications to the vacancy.
          format: date-time
        locationId:
          type:
            - "null"
            - string
          description: The identifier of the location for the vacancy.
          format: uuid
        messageTemplateId:
          type:
            - "null"
            - string
          description: The identifier of the message template to use for vacancy
            communications.
          format: uuid
        vacancyTemplateId:
          type: string
          description: The identifier of the vacancy template to use for creating the
            vacancy.
          format: uuid
      description: Represents a request to create a new vacancy, including localized
        title, department, location, and template information.
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: Json Web Token
tags:
  - name: VacanciesApi.Service

I tried running the command with different combination of following parameters: --cachePayloads=false, --useDefaults=false, --usePropertyExamples=false - with no success

Log details:

[*******][*******] ? Fuzzers custom configuration: {}
[*******][*******] ? Schemas: [CreateVacancyRequest, empty_body]
[*******][*******] ? Paths ordered alphabetically: [/vacancies]
[*******][*******] ? Start fuzzing path /vacancies
[*******][*******] ? Identified POST method for path /vacancies
[*******][*******] ? key application/json contentType application\/.*\+?json;?.*
[*******][*******] ? Request schema names identified for path /vacancies, method POST: [CreateVacancyRequest]
[*******][*******] ? Starting to generate example for schema name CatsGetSchemanull
[*******][*******] ? Getting schema from reference CatsGetSchemanull
[*******][*******] ? generateExamplesForSchema for schema CatsGetSchemanull
[*******][*******] ? extractExampleFromSchema for schema null, flag false
[*******][*******] ? extractExampleFromSchema for schema null, flag false
[*******][*******] ? normalizeDiscriminatorMappingsToOneOf for schema CatsGetSchemanull
[*******][*******] ? resolvePropertyToExample for property CatsGetSchemanull
[*******][*******] ? extractExampleFromSchema for schema null, flag false
[*******][*******] ? extractExampleFromSchema for schema null, flag false
[*******][*******] ? Finish generating example for schema name CatsGetSchemanull, took 3ms
[*******][*******] ? Request content types for path /vacancies, method POST: [application/json]
[*******][*******] ? Starting to generate example for schema name CreateVacancyRequest
[*******][*******] ? Getting schema from reference CreateVacancyRequest
[*******][*******] ? generateExamplesForSchema for schema CreateVacancyRequest
[*******][*******] ? extractExampleFromSchema for schema null, flag false
[*******][*******] ? extractExampleFromSchema for schema null, flag false
[*******][*******] ? normalizeDiscriminatorMappingsToOneOf for schema CreateVacancyRequest
[*******][*******] ? traverseSchemaProperties for schema CreateVacancyRequest
[*******][*******] ? resolvePropertyToExamples for property title
[*******][*******] ? resolvePropertyToExample for property title
[*******][*******] ? extractExampleFromSchema for schema null, flag false
[*******][*******] ? resolvePropertyToExamples for property departmentId
[*******][*******] ? resolvePropertyToExample for property departmentId
[*******][*******] ? extractExampleFromSchema for schema null, flag false
[*******][*******] ? resolvePropertyToExamples for property deadlineDate
[*******][*******] ? resolvePropertyToExample for property deadlineDate
[*******][*******] ? extractExampleFromSchema for schema null, flag false
[*******][*******] ? resolvePropertyToExamples for property locationId
[*******][*******] ? resolvePropertyToExample for property locationId
[*******][*******] ? extractExampleFromSchema for schema null, flag false
[*******][*******] ? resolvePropertyToExamples for property messageTemplateId
[*******][*******] ? resolvePropertyToExample for property messageTemplateId
[*******][*******] ? extractExampleFromSchema for schema null, flag false
[*******][*******] ? resolvePropertyToExamples for property vacancyTemplateId
[*******][*******] ? resolvePropertyToExample for property vacancyTemplateId
[*******][*******] ? extractExampleFromSchema for schema null, flag false
[*******][*******] ? resolvePropertyToExample for property CreateVacancyRequest
[*******][*******] ? extractExampleFromSchema for schema null, flag false
[*******][*******] ? Finish generating example for schema name CreateVacancyRequest, took 4ms
[*******][*******] ? Getting schema from reference CreateVacancyRequest
[*******][*******] ? Getting fields for prefix:
[*******][*******] ? Getting fields for prefix: title
[*******][*******] ? Getting fields for prefix: departmentId
[*******][*******] ? Getting fields for prefix: deadlineDate
[*******][*******] ? Getting fields for prefix: locationId
[*******][*******] ? Getting fields for prefix: messageTemplateId
[*******][*******] ? Getting fields for prefix: vacancyTemplateId
[*******][*******] ? Starting Fuzzer HappyPathFuzzer, http method POST, path /vacancies
[*******][*******] ? Fuzzing payload: {}
[***1***][**HP***] ? Send a 'happy' flow request with all fields and all headers
[***1***][**HP***] ? Proxy configuration to be used: DIRECT
[***1***][**HP***] ? Payload reference data replacement: path /vacancies has the following reference data: {title=test cats 27.11.2025, vacancyTemplateId=7CB12798-A113-4E20-9F8F-3733653F119C}
[***1***][**HP***] ? Replacing field vacancyTemplateId with value 7CB12798-A113-4E20-9F8F-3733653F119C
[***1***][**HP***] ? Ref data key vacancyTemplateId was not found within the payload!
[***1***][**HP***] ? Replacing field title with value test cats 27.11.2025
[***1***][**HP***] ? Ref data key title was not found within the payload!
[***1***][**HP***] ? Final payload after reference data replacement: {}
[***1***][**HP***] ? Payload replaced with ref data: {}

I would expect most of the fuzzers to actually include a non-empty payload. Is there an issue with the contract? Based on all the examples I cannot find anything wrong with the setup.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions