Skip to content

Incorrect generation of enum arrays #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
unrealwork opened this issue Apr 5, 2025 · 2 comments
Closed

Incorrect generation of enum arrays #163

unrealwork opened this issue Apr 5, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@unrealwork
Copy link

unrealwork commented Apr 5, 2025

Incorrect generation of enum arrays

To Reproduce

  1. Declare some enum
 PaymentMethod:
  type: string
  description: Payment method name
  enum: ['PAYMENT_CARD', 'PAYMENT_CARD_BINDING', 'APPLE_PAY', 'GOOGLE_PAY', 'BANK_ACCOUNT', 'CLICK_TO_PAY']
  1. Declare property which represents an array of such enums
availablePaymentMethods:
  type: array
  items:
    $ref: '#/components/schemas/PaymentMethod'
  1. Try to fuzz test API operation which has such array property in the request body
  2. In the generated payload in a test, the following data is generated for such fields
[
    {
        "availablePaymentMethods": "PAYMENT_CARD"
    },
    {
        "availablePaymentMethods": "PAYMENT_CARD"
    }
]

Expected behavior
Generated data should be an array of string

["PAYMENT_CARD", "PAYMENT_CARD"]

Environment:

cats-13.1.1, build time 2025-03-05T06:37:09Z UTC, platform Linux-5.15.167.4-microsoft-standard-WSL2-amd64

@unrealwork unrealwork added the bug Something isn't working label Apr 5, 2025
@en-milie en-milie reopened this Apr 7, 2025
@en-milie
Copy link
Contributor

en-milie commented Apr 7, 2025

Fixed now. Targeting next release.

@en-milie
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants