asyncapi / asyncapi/modelina

[BUG] Kotlin Constraints Preset omits @Valid annotation

Open
#2,573 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
448
Forks
242
Avg merge
15m
Merged PRs (30d)
7

Description

Describe the bug.

Kotlin's Constraint Preset doesn't add Valid annotation to array/object fields, effectively disabling cascading validation.
It's similar to issue Java generator had #2175

Expected behavior

Valid annotation is added to array/object fields enabling cascading validation

Screenshots

None

How to Reproduce
  1. Define JSON Schema that has an array/object property
  2. Run codegen for Kotlin with ConstraintsPreset
  3. Generated class doesn't have Valid annotation for array/object property
🖥️ Device Information [optional]
  • Operating System (OS):
  • Browser:
  • Browser Version:
👀 Have you checked for similar open issues?
  • I checked and didn't find similar issue
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?

Yes I am willing to submit a PR!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the Kotlin code generator's ConstraintsPreset and compare its handling with the Java generator issue #2175. Reproduce the case with a JSON Schema containing an array or object property, then verify that generated Kotlin fields receive the Valid annotation and enable cascading validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.