question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2.6.1 Cannot read property of custom enum list

See original GitHub issue

Custom enum like this:

@Getter
@AllArgsConstructor
public enum AccountType {
    CASH("现金账户", 2),
    BANK("银行账户", 3);

    private String name;
    private int code;
}

Pojo like this:

@Data
public class AccountQuery {
    @ApiParam(value = "账户号类型,支持多值", allowMultiple = true)
    private List<AccountType> type;
}

Controller method like this:

    @RequestMapping(value = "/account", method = GET)
    @ApiOperation(value = "查询账户", notes = "分页查询")
    JsonResult getPage(@ModelAttribute AccountQuery query) {
        return ok();
    }

Then the html page does not show the property ‘type’, I can not figure out why.

I found that ExpandedParameterBuilder#apply skiped this property.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dilipkrishcommented, Nov 21, 2016

@jearton Sorry I haven’t had ⏲to get to it. With the holidays it might be a couple of weeks.

0reactions
jeartoncommented, Nov 17, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript runtime error: cannot read property of undefined ...
I want to import and use the enum in another class as such: import { RESTConfig, RESTMethod } from './RESTConfig'; class Pipelines ...
Read more >
Handbook - Enums - TypeScript
Enums allow a developer to define a set of named constants. ... Using an enum is simple: just access any member as a...
Read more >
(Enum) cannot read property of undefined Error in TS
The enum error - cannot read property of undefined occurs for 2 main reasons, using const enums that get removed during compilation.
Read more >
MapStruct 1.5.3.Final Reference Guide
This is the reference documentation of MapStruct, an annotation processor for generating type-safe, performant and dependency-free bean ...
Read more >
What's new - Radzen
closeAllPopups() 'Cannot read properties of undefined' error. (Blazor) Fixed packaged .css ... (Blazor) DropDownBase will use Display attribute of Enum.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found