-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong class in documentation generation #608
Comments
Could you please add a small, failing example, so that we can reproduce your problem? |
I can share some basic code on how we have it setup if that helps. But I'll have to do some digging in what dependencies etc we use everywhere. |
Basic code example should be enough. Dependencies don't matter too much, please just make sure that you use the current version of swagger-maven-plugin (3.1.7). |
we're on 3.1.6 |
Okay, I've updated the plugin to 3.1.7, which took quite some effort due dependency conflicts I had to resolve on our side, but I succeeded. So now I've regenerated the swagger documentation on the 3.1.7. This is the model that I have created:
The model inherits from a few classes that simply add more properties to it. There's really nothing special about this class, as it's just a data-container. In the upper classes a few properties are marked with The endpoint has been defined as follows:
Basic Resource class that listen to incoming PATCH requests.
Which is a completely different class than the one I have defined. Things I've tried:
|
I tried to reproduce this behavior using a wildfly-swarm 2018.4.1 project, no luck. Model
package de.procrafting.tools.recordjarconverter.rest.model;
Resource
|
We have a customized parser that overwrites the hidden flag depending on the kind of build we are doing. The issue not that no documentation is generated, it's the wrong documentation. What do you mean with paste the generated swagger documentation? The plugin is configured as follows in our pom.xml:
We have 2 executions, generating 2 different JSON files. |
Yes, the geneated swagger.json file would be helpful. My current best guess is that your custom reader and the swagger-maven-plugin don't play along nicely, since this is the only big difference in our configurations. |
The swagger.json is rather large, will try to upload it somewhere and give you the link. The readers inherit from the Will be on three week vacation, but will keep you posted |
Tried setting the Here's a link to the gist for the fully generated swagger file: https://gist.github.com/coding-bunny/56a586d425846faaea74817dca398fe5 |
I looked at the generated swagger.json, but did not see anything unusual. |
running a test, hold on |
not getting much difference unfortunately.
So it simply exposes hidden APIs when it's used, otherwise relies on the standard implementation. I have no idea to what this is being mapped, but it doesn't resemble a single class we have in use for our code. |
Can you please try extending your |
Will do when I'm back from vacation
send from my android
…On Wed, 2 May 2018, 16:55 Martin Panzer, ***@***.***> wrote:
Can you please try extending your SwaggerExtendedApiReader from
com.github.kongchen.swagger.docgen.reader.SwaggerReader. This reader only
calls the io.swagger.jaxrs.Reader from Swagger internally, and does
nothing more.
This way, we can figure out if the problem lies somewhere in the
swagger-core itself or in swagger-maven-plugin, and can therefore restrict
where we have to search for this possible bug.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#608 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAsWhWeptwoOaT-qMWWfXb-bjpyoBugUks5tuh1RgaJpZM4TfWGn>
.
|
I've changed the inheritance to the class mentioned, however it still does not resolve the 2 problems:
This is my extended reader to make sure all hidden api endpoints are read:
This is our class that does some tweaking to certain class parsing to ensure our customer SDK values are supported:
|
I've finally solved the problem! For some reason our Swagger configuration was not loading the Jackson annotation module, ignoring all annotations used.
|
Hello,
I might be missing something, but in one of API endpoints, I implemented a PATCH operation, which takes a
DocumentType
as parameter. This is however one of our custom models, and not the DocumentType defined in several namespaces.The
import
statements etc are all correct, as is the annotations.When running the maven build, my documentation get's generated, however the output contains the wrong
DocumentType
class. It's as if the plugin seems to take the first matching class, and not the one I specified.The text was updated successfully, but these errors were encountered: