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

perl v5.40 core booleans not allowed in schema, when it's a nested perl data structre #252

Open
akarelas opened this issue Aug 8, 2024 · 0 comments

Comments

@akarelas
Copy link

akarelas commented Aug 8, 2024

e.g.:

package Example;

use v5.40;

# ...

  $self->plugin(OpenAPI => {
      coerce => 'booleans',
      spec => {
          swagger => '2.0',
          info    => {
              description => "This is the API specification",
              version     => '0.0.1',
              title       => 'abc.karelcom.net',
          },
          schemes => [ 'http' ],
          paths   => {
              '/api/foo' => {
                  get => {
                      description => 'foo',
                      summary     => 'foo',
                      'x-mojo-to' => 'API#foo',
                      operationId => 'foo',
                      tags        => [ 'Foo' ],
                      produces    => [ 'application/json' ],
                      responses   => {
                          200 => {
                              description => 'OK. Hi.',
                              schema      => {
                                  type                 => 'object',
                                  required             => [ qw/a b/ ],
                                  properties           => {
                                      a => { type => 'integer' },
                                      b => { type => 'integer' },
                                  },
                                  additionalProperties => false,
                              },
                          },
                      },
                  },
              },
          },
      },
  });

# ...

This is important, because you can't use Mojo::JSON 'true', 'false' to replace the meaning of true & false from core booleans, if you use v5.40.

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