how to generate swagger interface from jax-rs api in liferay? - api

I created jax-rs module api in liferay but now I need swagger interface to use it without postman. Can you help me to generate swagger interface?

Related

Swagger Codegen 3.0 Generate API Client but only for specific methods (routes)

So I have the openAPi YAML, that contains definitions for the api client and lots of methods, is there a way to generate a specific method only and not all of them?

Windows authentication on swagger api endpoint in IIS

I currently have a .net core api setup to use swagger. I need to protect the swagger documents with windows authentication. Since there isn't an actual swagger folder with swagger html files, it seems like i can't setup the authentication through IIS manager. Is there any way to do this?

Using Swagger for documenting RESTful services in Mule

I want to use swagger for documenting our RESTful APIs. Our Jersey classes will be consumed from the mule flow. To use swagger for documenting my API I need to use the servlet configuration as mentioned in here - https://github.com/wordnik/swagger-core/wiki/Java-JAXRS-Quickstart
As the Jersey classes are deployed in mule, there is no web.XML.
If you know how to configure swagger with Mule please let me know how to do that. I truly appreciate your feedback and suggestions.
I see two possible options, the latter being the one with the highest chance of success:
Run a Servlet container inside Mule, as demonstrated by the bookstore example provided with the standalone distribution, configuring web.xml as indicated and making sure you're using servlet not http inbound endpoints in your Mule configuration.
Generate at build time a static Swagger configuration using https://github.com/ryankennedy/swagger-jaxrs-doclet and serve it using the static resource message processor from the HTTP transport.

Authenticating WEB API and knockout Js view model

I am trying to create secured MVC4 web API project. In this application knockout Js will access API service directly. I need authentication on his. I am confused how to apply authentication only on web api. I can’t use MVC authentication because other projects also share same API services.
Any one please suggest a good solution using knockout js and web api. I tried Thinktecture.IdentityModel but I am not able to use knockout Js in it.
this project is in .net 4.0.
Thanks in advance
thanks for the support
got solution
Use the [Authorize] attribute on the WebApi controllers
[Authorize(Roles="WebApiAccess")]
public class FooController : ApiController
{
}
You can send authN tokens before your Ajax request. Here is a similar SO question (with answer). You can add auth for your entire client app by creating a global 401 error handler (AngularJS, but the original question is generic jQuery).

how to authenticate user in JAX-RS using apache CXF?

I am using apache CXF for JAX-RS application.I followed the example in the url 'http://www.javatips.net/blog/2012/02/cxf-restful-tutorial'.....
Finally,I am hosting the application as 'war' in tomcat under 'webapps'?...
How to inject security(simple authorization and authentication) in JAX-RS?
Basically,my aim is to validate a 'user' role before catering service request?
Can anyone provide a neat example?
i have no idea about CXF but you can find a Security in JAX-RS how to ? Here
.