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

When setting readOnly => 1 mojolicious throws a boolean error #148

Open
zoot opened this issue Jun 18, 2023 · 0 comments
Open

When setting readOnly => 1 mojolicious throws a boolean error #148

zoot opened this issue Jun 18, 2023 · 0 comments

Comments

@zoot
Copy link

zoot commented Jun 18, 2023

I am discovering Yancy by following http://preaction.me/article/yancy-todo to build my application.

Perl 5.36.1

If I try to disable the editing of the integer 'id' field in a database table 'users', with the 'readOnly' flag:

plugin Yancy => {
    backend => { mysql => app->mariadb },
    route => '/admin',
    read_schema => 1,
    schema => {
        users => {
            title => 'Users',
            properties => {
                id => {
                    type => 'integer',
                    readOnly => 1
                }
            },
        },
    },
};

Mojolicious throws this error:

Can't load application from file \
"/path/to/app.pl": /definitions/users/properties/id/readOnly: Expected boolean \
- got number.Compilation failed in require at (eval 76) line 1.

I can't for the life of me figure out why, since Perl considers 1 as true and all the examples I've found on-line, including the manpage docs use readOnly => 1. Removing that line, resolves the error.

Any ideas?

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

No branches or pull requests

1 participant