Code Monkey home page Code Monkey logo

Comments (17)

phillip-kruger avatar phillip-kruger commented on August 15, 2024

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.

FireRedDev avatar FireRedDev commented on August 15, 2024

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.

phillip-kruger avatar phillip-kruger commented on August 15, 2024

from apiee.

phillip-kruger avatar phillip-kruger commented on August 15, 2024

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.

FireRedDev avatar FireRedDev commented on August 15, 2024

from apiee.

phillip-kruger avatar phillip-kruger commented on August 15, 2024

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.

FireRedDev avatar FireRedDev commented on August 15, 2024

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.

phillip-kruger avatar phillip-kruger commented on August 15, 2024

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.

FireRedDev avatar FireRedDev commented on August 15, 2024

from apiee.

phillip-kruger avatar phillip-kruger commented on August 15, 2024

Ok so then it must be in swagger-ui... let me have another look.

from apiee.

phillip-kruger avatar phillip-kruger commented on August 15, 2024

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:
apiee_error

So if I comment out the swagger annotations in service. Service in the getFile method:
code_change

Then it's working fine:
apiee_no_error

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.

FireRedDev avatar FireRedDev commented on August 15, 2024

from apiee.

phillip-kruger avatar phillip-kruger commented on August 15, 2024

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.

phillip-kruger avatar phillip-kruger commented on August 15, 2024

@Jiraci any feedback?

from apiee.

FireRedDev avatar FireRedDev commented on August 15, 2024

from apiee.

FireRedDev avatar FireRedDev commented on August 15, 2024

from apiee.

phillip-kruger avatar phillip-kruger commented on August 15, 2024

Closing

from apiee.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.