Comments (8)
Went ahead and did a little bit of research on the subject.
The main use-case I first saw for using RAML was to auto generate documentation, but now I see that it's possible to define the whole API using only the language.
RAML 1.0 will support adding custom metadata to the methods description, which will allow it to map the specific HTTP route with a Java method. This will be very powerful, meaning that it'll be possible to auto generate consumer-facing documentation as well as defining route bindings in one go.
Also, there are a bunch of auto-testing tools that can run unit tests on a mock server (that Jooby can create based on the schema) and a full integration test.
Imagine delivering a framework that (in theory) is capable of running unit/e2e route testing out of box... Oh my..
from jooby.
@paulovictorv very cool!
from jooby.
Did you seehttp://jooby.org/doc/swagger/?
Think is better and give you the same features!
from jooby.
Yeah, I think they have the same philosophy,but I was thinking the other way around.
Let the user instead of defining routes straight on code (which is nice), define them on the RAML file, together with the method binding. Defining routes on a same place, but still separated from the actual application code is really nice, and having that definition together with the documentation is just the cherry on the cake.
Now, imagine hooking up on mvn test phase, running one of the many server validation tools using the RAML file as the guideline. You kill two birds with one stone: generate docs and test it .
I've lost count on man-hours "wasted" creating essentially repeated test classes: one for the web api layer, another for the actual application layer.
About defining routes separate from code, I've had experience with JAX-RS, express and Play! Framework style of route definition. They all shine, but I've seen that for large api's, defining it separated from code (like Play does) makes it easier to organize. The thing that is really bad with Play style is that it's too plain. It's hard to organize routes in a readable form, which is not even needed for RAML since we can generate an UI for the developer to navigate (which swagger already does).
What you must consider is that, if this feature is introduced, will it violates Jooby's philosophy? My opinion is that it doesn't. Jooby should be simple for simple apps, but sophisticated for larger ones.
But I ramble :)
from jooby.
@paulovictorv do you have experience with RAML?
Next release will have a spec
module that basically does all the hard work... all we have to do is to transform the output of the ``spec` module into RAML.
Are you able to work on this?
from jooby.
@paulovictorv can you help here?
Thanks
from jooby.
Hello, sorry for the delay.
I'll try to work on this in the next few weeks. If I have any questions I'll let you know.
from jooby.
I did it: #275
it works pretty well
from jooby.
Related Issues (20)
- jooby-pac4j oidc: never renew profile? HOT 3
- joobyRun: improve lookup of logging configuration file on multi-module project
- buffer: Add wrap(byte[], offset, len) method
- buffer: Add duplicate method
- jetty: implement a non-blocking handler
- [netty] Broken swagger-ui HOT 1
- buffer: write(String str, int off, int len) doesn't work
- Conscrypt should not be included by default HOT 2
- File and image transfer problems in 3.1.x HOT 5
- How to set application environment when using joobyRun? HOT 2
- Connecting Hibernate to Oracle Database HOT 6
- Jooby 2.16.3: Guice version has issues with Java 21 HOT 2
- How does Jooby handle gzip encoding for requests and responses? HOT 2
- OpenAPI generation issue in multimodule project HOT 3
- @ResultType: new annotation for source code generator
- jooby-apt: generate kotlin source code HOT 1
- OpenApi Circular reference generation HOT 2
- WebSocket onClose not called for Netty HOT 1
- netty: memory leak while reading HTTP body HOT 2
- Java strings not escaped properly in mvc source code generation. HOT 2
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 jooby.