I have developed JAX-RS REST Application and also I have generated WADL. How to find the WADL location?
For example in Jax-ws the wsdl can be find using the URL like [http://192.168.1.39:8083/application/ApplicationService?wsdl]
Like that how to find location WADL in JAX-RS.
If you use Jersey, you will find it at http://your.application/resource.path/application.wadl where resource.path is the path defined in your web.xml.
if you use jaxrs you will get wadl at
http://your.application/resource.path/application?_wadl and it is also mentioned over here http://cxf.apache.org/docs/jaxrs-services-description.html
Related
I have my API documented with Swagger. For developer convenience I would like to provide the swagger GUI on my website as well. However, my provider has not installed the php yaml extension. It implies that I can't use the GUI on my own website.
So, I would like to use a third party GUI. I know that I can use https://petstore.swagger.io/ and enter the link to my yaml file in the text box. This is also not really user friendly. I prefer to open the GUI and specify the yaml when calling the url. For the user the GUI opens with my API definition.
Any thoughts?
If for some reason you cannot host Swagger UI youself, here are some alternatives you can try:
Use SwaggerHub to host your API definition and docs.
Disclosure: I work for the company that makes SwaggerHub.
Use GitLab to host your OpenAPI YAML/JSON file. GitLab uses Swagger UI to render OpenAPI files. Example:
https://gitlab.com/gofus/gofus-api/blob/dev/swagger.yaml
Use https://petstore.swagger.io with the url query parameter to automatically load your API definition:
https://petstore.swagger.io?url=https://yoursite.com/api.yaml
For this to work, the server where your OpenAPI file is hosted must use HTTPS and support CORS.
When generating a client based on Swagger metadata, is it possible to specify or configure things somehow that the output should use some other client library?
So if it was a C# client for example, to automatically replace the HttpClient or RestSharp client (I don't recall what it is now as I have not used it in a while) with some custom library?
Yes it is possible,
The codegen uses templates and configuation java classes to generate code in different languages. If you're willing to modify these templates and classes this would be a quite simple modification.
You can find the opensource repository here Swagger-Codegen
The template files for each language can be found here:
https://github.com/swagger-api/swagger-codegen/tree/master/modules/swagger-codegen/src/main/resources
Java config classes:
https://github.com/swagger-api/swagger-codegen/tree/master/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages
List of template variables:
https://github.com/swagger-api/swagger-codegen/wiki/Mustache-Template-Variables
Template are written in mustache:
https://mustache.github.io/mustache.5.html
Interesting read if you want to start from scratch:
https://github.com/swagger-api/swagger-codegen/wiki/How-to-add-a-generator-for-a-new-language-or-framework
We want not just to share the API console that is provided via apikit component in a Mule application, but also the raw RAML file so consumers can create their own clients based on the RAML. As far as I know, there is not user friendly way to download the published raw RAML file from within the APIKit console. I just found that one can point to the /api url and do a GET with "application/raml+yaml" content-type, but it is not user friendly enough. Any clues? Thanks
You can use the URL to your console with ?raml on the end of the url.
http://myapp.cloudhub.io/api/v1/console?raml
In at least Mule 4.3.0 (maybe earlier), you can append ?api to the console URL, e.g.
http://localhost:88/myproject/console/?api
I'm looking to transform a xslfo file into pdf in pure JavaScript. Any alternative to FOP Apache (which is in Java...)?
There are no XSL FO engines in 100% javascript. There are some that provide Web service interface via REST or SOAP but have a remote formatter like http://www.cloudformatter.com/css2pdf
Hi I have rest web services running on tomcat. I'm trying to get wadl generated. What I read is that I just need to type url: http://ip:8080/application.wadl and it will be generated. However all I get is 404 status.
If my deployed war name is ABC for example I'm also trying to execute: http://ip:8080/ABC.wadl, but again 404.
Any idea what I'm doing wrong?
It really does depends on the framework that is mediating between Tomcat and your implementation classes. For example, with Apache CXF you get the WADL for a service by fetching http://example.com:8080/ABC?wadl (this is in the simplest case where your webapp is deployed as ABC and the root RESTful resource is served by the root of the webapp).