I have a REST service method annotated with io.swagger.annotations.ApiOperation @ApiOperation(value = “some string”) I need some string to generate newlines in the HTML page swagger-ui.html (i.e. in the Swagger UI page where I see my docs and I can test my API methods). I tried putting <br/> and n in some string, and anything I could think of, and anything
Tag: rest
How to secure an API REST for mobile app? (if sniffing requests gives you the “key”)
It’s probable a newbie question but I’ll try to create an interesting debate. I know there are some authentication methods for API Basic Authentication, API Keys, OAuth 2.0 … all of those methods add a header or a formData param in the request. Although you use SSL, it’s “usually easy” to hack mobile apps (I’m thinking in Android right now:
react + spring boot upload file and form data
i have a case like in my form (front end), i can fill personal data (name, address, DOB) and then i can attach multiple image. In my spring boot controller : My model wrapper : Front end (React) Code : With above example, i always encounter errors. like : java.io.IOException: Stream closed and zero attachment length / zero attachment size
REST API for updating informations with empty or null values
I have a general question about how best to build an API that can modify records in a database. Suppose we have a table with 10 columns and we can query these 10 columns using REST (GET). The JSON response will contain all 10 fields. This is easy and works without problems. The next step is that someone wants to
How to fix Spring Security Authorization header not being passed?
In one of my REST services, I make use of Spring Security to validate the token that is being passed in the header. However, spring is unable to find the “Authorization” header, even though it is there. This was not a problem when testing in test, and even locally but when we deployed to PROD we get this issue. As
JAX RS MessageBodyWriter not found for media type=application/json
I am creating Rest client using JAX RS Jersey 2. The client works but only in my IDE (IntellIJ IDEA), when I build it with Maven, using maven-assembly-plugin and run the jar it doesn’t work anymore. I get MessageBodyWriter not found for media type=application/json error. I have tried adding more dependencies that people suggested in other posts but I don’t
Sending POST request with POSTMAN to Java REST API and getting null values in the xml response
I am creating a REST Service in Java and now I am building the post method which has 2 parameters that has to be inputted as xml in postman (for test) and get a response as xml in java and insert it in database. For starters I am trying to add the values as Query Params in POSTMAN with key
I am getting an error when the program tries to deserialise an object from the entity stream
I have an entity class called Activity, the class was deserialising and working fine untill i decided to add an id field of type int to the entity. The getters and setters for this field are public and seem to be fine, however when I run my tests for creating an object from the client side I get this deserialisation
Struts & Jersey Servlets with JSP & Webpack Front End
we currently have a struts 1.2 web application with casual JSP web pages. We want to migrate our application to Rest service web application with a webpack project front end. As this will be a migration process where old pages will be served under oracle weblogic server and new ones will be served under a different production server. We will
Tomcat 404 – Not Found: when Implementing REST API
I’m trying to implement simple RESTFUL API service using dynamic web application in Eclipse. Every time I am getting error message HTTP Status 404 – Not Found. I have attached my screen below Package structure I am able to run tomcat server on localhost:8080 as shown on the above figure but when I trying to access my api path I