Closed pavelsr closed 6 years ago
It's because morbo puts the code inside a Mojo::Server::Sandbox::...
package. Not sure if I care enough to fix this since I think it will be confusing to throw package whatever;
before __DATA__
, and from my point of view, the code is supposed to be an illustration and not something you copy/paste.
I think I would rather delete the whole example and refer to https://metacpan.org/pod/distribution/Mojolicious-Plugin-OpenAPI/lib/Mojolicious/Plugin/OpenAPI/Guides/Tutorial.pod or https://mojolicious.io/blog/2017/12/22/day-22-how-to-build-a-public-rest-api/
I'm closing this, since I don't find it important enough to fix.
If simply run this code with morbo you will get a JSON::Validator error: