question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong class in documentation generation

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
coding-bunnycommented, Apr 27, 2018

not getting much difference unfortunately.

  1. I’ve removed the ModelConverter as requested, so the pom.xml was reduced in configuration.
  2. Updated my ApiReader to be even more simple, to not convert/change anything.
public class SwaggerExtendedApiReader extends JaxrsReader {

	public SwaggerExtendedApiReader(Swagger swagger, Log log) {
		super(swagger, log);
	}

	/**
	 * <p>
	 * Override the public read method, and enforce the reading of hidden operations.
	 * </p>
	 */
	@Override
	public Swagger read(Class<?> cls) {
		return read(cls, "", null, true, new String[0], new String[0], new HashMap<String, Tag>(), new ArrayList<Parameter>());
	}
}

So it simply exposes hidden APIs when it’s used, otherwise relies on the standard implementation. Swagger still seems to be using some kind of different class for the example unfortunately:

image

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.

1reaction
coding-bunnycommented, Apr 27, 2018

Tried setting the springmvc configuration to false, did not seem to have any direct result/difference on the generated documentation.

Here’s a link to the gist for the fully generated swagger file: https://gist.github.com/coding-bunny/56a586d425846faaea74817dca398fe5

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android - failed to generate Javadoc with Android Studio ...
I just spent 5 days on this error and found a solution that works (for me. ... Normally documentation generation failed with "exit...
Read more >
Documenting Your Classes and Methods - Courses
This tool can automatically extract documentation comments from source code and generate HTML class descriptions, like those in the cs1705 Package API.
Read more >
How to Write Doc Comments for the Javadoc Tool - Oracle
This document describes the style guide, tag and image conventions we use in documentation comments for Java programs written at Java Software, ...
Read more >
Javadocs | IntelliJ IDEA Documentation - JetBrains
Add Javadoc comments, generate your own Javadoc reference, and view downloaded Javadocs right from the IntelliJ IDEA editor.
Read more >
Common issues and solutions - mypy 0.991 documentation
There are several common reasons why obviously wrong code is not flagged as an error. ... considered as untyped method foo(1) # No...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found