Comments (17)
Hi. The swagger.json seems fine. Is it possible to share the jax-rs java code ? Or even better the whole project so that I can recreate on my pc. ?
from apiee.
yes it is - do you have an email adress or a Gitlab account?
EDIT: I sent you my project via email
I work with a generic boilerplate service, but since the generated json is fine that doesnt seem to be the problem. Apiee also doesnt recognize my UploadServlet i think?
from apiee.
from apiee.
UploadServlet is not a JAX-RS resource. Swagger only works on REST endpoints, not on servlets.
Change the upload to use JAX-RS, for example see https://stackoverflow.com/questions/25797650/fileupload-with-jax-rs
Hope that helps. Let me know.
from apiee.
from apiee.
Try adding @ApiOperation(value = "...", notes = "...") to the methods that are REST endpoints.
Also see https://github.com/phillip-kruger/notes-example/blob/master/notes-application/src/main/java/com/github/phillipkruger/notes/NotesApi.java as an example.
Let me know if that worked.
from apiee.
I dont quite understand what you mean - my Generic EntityService methods have @apiOperation annotations - and it works in 2 of the 4 cases? i cant annotate them in the classes that inherit the generic abstract class because they dont have any extra code concerning them in there - are you saying that that is not supported?
I mean your linked example would force me to make a few big rest endpoint classes again, which i am trying to avoid as it would also force me to edit code in more places as opposed to only the generic one
from apiee.
I am not sure if that is supported. This is more a swagger question than an Apiee one. Why don't you try without the super class and see ?
from apiee.
from apiee.
Ok so then it must be in swagger-ui... let me have another look.
from apiee.
Right. Since we know this is a swagger-ui issue, I looked the web console in the browser. There is an error there that points us in the direction of the problem:
So if I comment out the swagger annotations in service. Service in the getFile method:
So swagger ui do not know how to interpret the File input or output.
Hope that helps to get you on the right track with fixing your problem.
Let me know.
from apiee.
from apiee.
So Apiee does not actually add it, it's swagger that does that. All Jax-rs methods are scanned and added. You can ignore this by adding hidden=true, example:
@ApiOperation(value = "Getting a file", hidden = true)
Then swagger will ignore this when creating the json/yaml and the UI should work
Let me know if that helps, and then I'll close the issue.
from apiee.
@Jiraci any feedback?
from apiee.
from apiee.
from apiee.
Closing
from apiee.
Related Issues (15)
- @ApiResponse annotation value is not getting displayed in Swagger UI HOT 3
- Using proxy HOT 3
- Open API specification HOT 4
- Entities HOT 4
- Disable Swagger UI programmatically HOT 2
- How can I back to Swagger 2.0? HOT 7
- Parameter Deccription cant be set HOT 4
- The request format is XML? HOT 3
- Not compatible with newest Jackson HOT 15
- Server Port detection HOT 1
- Use Jwt Authentication Bearer HOT 8
- not showing all swaggerdefinition attribute if they are listed in aipee.properties HOT 5
- Need Help: swagger.json file is generating swagger UI HOT 1
- Change swagger to pass a json instead of the default form values HOT 4
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 apiee.