Skip to content

Non-standard single-quoted JSON keys in YearMonthField.setMin/setMax #115

@javier-godoy

Description

@javier-godoy

Describe the bug

setMin() and setMax() build a JSON string with single-quoted keys:

Json.parse("{'month': " + min.getMonth().ordinal() + ", 'year': " + min.getYear() + "}")

Single-quoted keys are not valid per the JSON specification. This currently works because the Elemental2 Json.parse() implementation is lenient, but it relies on undocumented behaviour.

Expected behavior

Keys should be double-quoted:

Json.parse(String.format("{\"month\": %d, \"year\": %d}", min.getMonth().ordinal(), min.getYear()))

Add-on Version

4.6.1-SNAPSHOT

Vaadin Version

N/A

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions