Comments (3)
- No, because of inheritance. Have a look at this example spec: https://github.com/jhthorsen/mojolicious-plugin-openapi/blob/master/t/spec.t#L60
- I don't get what you mean about "It can be configured via constructor parameters". Do you think it's too much boilerplate with
my $c = shift->openapi->valid_input or return;
? I like how explicit it is, and it also gives you more flexibility.
from mojolicious-plugin-openapi.
Actually, it's matter of habbit. I personally do not like shift at all and more over, prefer perl signatures. Also with validation toggled inside under sub we can disable it all at once, with validation toggled inside each controller we need to change each controller. It's a trivial task (if all developers follow common pattern), but still a bit harder, than comment single line in under sub or set 'validate' key to zero during construction.
Maybe I can implement it (default validation) later as a plugin.
from mojolicious-plugin-openapi.
it should be rather simple now that I've added support for plugins. Even though the feature is not yet documented / officially supported.
Please submit a PR if you like.
from mojolicious-plugin-openapi.
Related Issues (20)
- Form data single values not promoted to array. HOT 1
- How can I add more definitions and paths to my application API from a Mojo plugin? HOT 4
- typo HOT 2
- Security - Several alternative methods HOT 1
- Just a quick copy from IRC HOT 1
- Can't call method "validator" on an undefined value HOT 5
- Schema for a default response HOT 7
- Automatic "DefaultResponse" injection does not work when path spec is inside a different file HOT 10
- Wrong error description if status not defined in the spec HOT 2
- "in: body" in parameters causes an error HOT 3
- How to use openapi with mojo's under method for a route HOT 1
- Posting an Array of Objects as a body parameter not supported in OpenAPI v2 HOT 5
- POD spelling errors HOT 1
- ->openapi->valid_input mangles headers HOT 1
- SpecRenderer escape characters HOT 1
- param in=>query, type=>array does not work anymore HOT 2
- Mojolicious::Lite silently ignores controller configurations due to missing default namespaces HOT 3
- [Mojolicious::Plugin::OpenAPI::Security] should use http status code 403 HOT 2
- Response-validation fails when using $ref for responses HOT 1
- empty responses should default to http status code 204 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mojolicious-plugin-openapi.