Skip to content

Generation doesn't work with nested objects #330

@blazmrak

Description

@blazmrak

Defining nested object messes up an import in GeneratedValidatorComponent.java import repro.Repro/Top; which looks like a bug to me.

public class Repro {
	@Valid
	public static class Top {
		@NotNull
		public Nested nested;

		public static record Nested(String prop) {
		}
	}

	public static void main(String[] args) {
		Validator.instance().validate(new Top());
	}
}

If I move Nested one level up, it works normally:

public class Repro {
	@Valid
	public static class Top {
		@NotNull
		public Nested nested;

	}

	public static record Nested(String prop) {
	}

	public static void main(String[] args) {
		Validator.instance().validate(new Top());
	}
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions