Skip to content
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

Wrong schema for DateType with choice widget #16

Closed
awudarowicz opened this issue Nov 5, 2017 · 2 comments
Closed

Wrong schema for DateType with choice widget #16

awudarowicz opened this issue Nov 5, 2017 · 2 comments

Comments

@awudarowicz
Copy link

awudarowicz commented Nov 5, 2017

DateType which uses choice widget type (3 selects - year, month and day) has wrong schema when transformed by liform.

Adding type:

$builder->add('dateOfBirth', DateType::class, [
    'widget' => 'choice',
    'placeholder' => [
        'year' => 'Year',
        'month' => 'Month',
        'day' => 'Day'
    ],
    'format' => 'yyyyMMdd',
    'translation_domain' => 'booking-form'
]);

What I expect in json schema:

"dateOfBirth": {
    "type": "object",
    "title": "dateOfBirth",
    "properties": {
        "year": {
            "type": "number",
            "title": "year",
            "propertyOrder": 1
        },
        "month": {
            "type": "number",
            "title": "month",
            "propertyOrder": 2
        },
        "day": {
            "type": "number",
            "title": "day",
            "propertyOrder": 3
        },
    },
    "propertyOrder": 1
}

What We've got currently which is wrong imo:

"dateOfBirth": {
    "type": "string",
    "title": "dateOfBirth",
    "propertyOrder": 1
}
@nacmartin
Copy link
Member

Yes, this should be fixed, I agree.

@nacmartin
Copy link
Member

Fix in Limenius/LiformBundle@8c54258

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants