Skip to content
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

CSSTUDIO-2026: add openapi/swagger + javadoc fix. #184

Merged
merged 2 commits into from
Jan 11, 2024

Conversation

cjenkscybercom
Copy link
Collaborator

Changes:

  • Adds support for openapi/swagger autogenerated API docs
    • UI available at at http://localhost:8080/api/docs
    • JSON available at http://localhost:8080/api/spec
    • Uses the autogenerated docs as-is; does not currently add additional annotations to the swagger docs to e.g. name resources, use tags, etc
    • Shows operation ids (generated from controller method names, or disambiguated if there are duplicates)

Fixes:

  • upgrades maven-javadoc-plugin to fix MJAVADOC-650 for Java 9+
Screenshot 2024-01-03 at 09 52 55

@thelarsjohansson
Copy link
Collaborator

thelarsjohansson commented Jan 9, 2024

Writing comments after talking to @cjenkscybercom

  • I recommend 1.7.0 instead of 1.6.10, as it's most recent release of springdoc
  • below is not necessary, at least not now and for this commit ( try to avoid nice to have )
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-security</artifactId>
            <version>${springdoc.version}</version>
        </dependency>
  • I recommend to have defaults values for Swagger paths and properties in order to have it work in similar ways as to other projects - i.e. not set
springdoc.api-docs.path
springdoc.swagger-ui.path

I also recommend to take care of other application.properties files but this can be done in other commit as those files need oversight anyway.

Good work!

@cjenkscybercom
Copy link
Collaborator Author

Writing comments after talking to @cjenkscybercom

  • I recommend 1.7.0 instead of 1.6.10, as it's most recent release of springdoc
  • below is not necessary, at least not now and for this commit ( try to avoid nice to have )
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-security</artifactId>
            <version>${springdoc.version}</version>
        </dependency>
  • I recommend to have defaults values for Swagger paths and properties in order to have it work in similar ways as to other projects - i.e. not set
springdoc.api-docs.path
springdoc.swagger-ui.path

I also recommend to take care of other application.properties files but this can be done in other commit as those files need oversight anyway.

Good work!

Thank you for your feedback!
Fair points, I'll update to the latest 1.x release and remove the security dependency for now.

I do respectfully disagree on using the defaults as they sit in the root path directly (/swagger-ui.html for example); I can see why the CCE team used /api/spec and /api/docs instead since they're in their own path and are easier to remember.

I shouldn't need to apply these changes to the other .properties files though? They inherit from application.properties so I should only need to add overriding or profile-specific properties`?

@thelarsjohansson
Copy link
Collaborator

I agree with your comments!

@cjenkscybercom
Copy link
Collaborator Author

I agree with your comments!

Thanks! I've pushed the updates as you suggested, please let me know if you have any other feedback or if you approve (if you have permission to)

@shroffk shroffk merged commit dba2894 into master Jan 11, 2024
3 checks passed
@cjenkscybercom
Copy link
Collaborator Author

Thanks Kunal!

@cjenkscybercom cjenkscybercom deleted the CSSTUDIO-2026-add-openapi-swagger branch January 12, 2024 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants