-
Notifications
You must be signed in to change notification settings - Fork 14
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
use it to validate real requests? #43
Comments
Is this to say that it cannot validate real request? Because I tried and I cannot make it work (with JAX-RS). I just cannot figure out how to do it. What is |
With "real" I mean requests during the productive runtime of an application, not in tests. There are probably more JAX-RS specific possibilities, but the simplest thing that should work would be a ServletFilter along these lines: public class RamlFilter implements Filter {
private RamlDefinition api;
@Override
public void init(FilterConfig filterConfig) throws ServletException {
api = RamlLoaders.fromClasspath(getClass()).load("api.raml");
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
final RamlReport report = api.testAgainst(request, response, chain);
//do something with the report
}
} |
Or you could use https://github.com/nidi3/raml-tester-proxy. It's a proxy that sits between the client and the server and logs all requests that are not conforming to the RAML. |
No description provided.
The text was updated successfully, but these errors were encountered: