Skip to content

Re-Enabling Swagger Documentation for Intersection API#324

Open
jacob6838 wants to merge 21 commits into
developfrom
swagger-docs
Open

Re-Enabling Swagger Documentation for Intersection API#324
jacob6838 wants to merge 21 commits into
developfrom
swagger-docs

Conversation

@jacob6838

@jacob6838 jacob6838 commented May 11, 2026

Copy link
Copy Markdown
Collaborator

PR Details

Description

Resolving multiple bugs blocking automatic swagger documentation:

  • Upgrading springfoc-openapi-starter-webmpv-ui to be compatible with latest spring version
  • Removing WebConfig
    • This config was altering serialization for the swagger docs while supplying no additional value, as serialization of timestamps works correctly without it
  • Disabling unintended JPA repository REST controllers

How Has This Been Tested?

After running the Intersection API through docker or java, open the swagger docs page: http://localhost:8089/swagger-ui/index.html

Types of changes

  • Defect fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)

Checklist:

  • My changes require new environment variables:
    • I have updated the docker-compose, K8s YAML, and all dependent deployment configuration files.
  • My changes require updates to the documentation:
    • I have updated the documentation accordingly.
  • My changes require updates and/or additions to the unit tests:
    • I have modified/added tests to cover my changes.
  • All existing tests pass.

@jacob6838 jacob6838 changed the title Swagger docs Re-Enabling Swagger Documentation for Intersection API May 11, 2026
@jacob6838 jacob6838 marked this pull request as ready for review May 11, 2026 17:48
@jacob6838 jacob6838 requested a review from Copilot May 11, 2026 17:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to restore Swagger/OpenAPI documentation for the Intersection API after Spring upgrades by updating the Springdoc dependency, ensuring the OpenAPI JSON can be rendered/serialized correctly, and preventing unintended Spring Data REST repository endpoints from being exposed.

Changes:

  • Upgraded springdoc-openapi-starter-webmvc-ui to 2.8.9.
  • Allowed unauthenticated access to Springdoc endpoints (/v3/api-docs*, /swagger-ui*) in the security filter chain and adjusted MVC message converters to support Springdoc output types.
  • Disabled Spring Data REST export on a broad set of JPA repositories via @RepositoryRestResource(exported = false).

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
services/intersection-api/api/pom.xml Bumps Springdoc OpenAPI UI starter version to restore compatibility with the current Spring stack.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/keycloak/config/KeycloakSecurityConfig.java Permits unauthenticated access to OpenAPI/Swagger UI endpoints.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/WebConfig.java Adjusts MVC message converters to support Springdoc/OpenAPI serialization.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/UserRepository.java Disables Spring Data REST export for the repository.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/UserOrganizationRepository.java Disables Spring Data REST export for the repository.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/UserEmailNotificationRepository.java Disables Spring Data REST export for the repository.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/SnmpProtocolRepository.java Disables Spring Data REST export for the repository.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/SnmpMsgfwdConfigRepository.java Disables Spring Data REST export for the repository.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/SnmpCredentialRepository.java Disables Spring Data REST export for the repository.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/ScmsHealthRepository.java Disables Spring Data REST export and reformats query documentation.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/RsuRepository.java Disables Spring Data REST export for the repository.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/RsuOrganizationRepository.java Disables Spring Data REST export for the repository.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/RsuOptionRepository.java Disables Spring Data REST export for the repository.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/RsuModelRepository.java Disables Spring Data REST export for the repository.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/RsuIntersectionRepository.java Disables Spring Data REST export and removes extra whitespace in the interface.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/RsuCredentialRepository.java Disables Spring Data REST export for the repository.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/RoleRepository.java Disables Spring Data REST export for the repository.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/PingRepository.java Disables Spring Data REST export for the repository.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/OrganizationRepository.java Disables Spring Data REST export for the repository.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/MaxRetryLimitReachedInstanceRepository.java Disables Spring Data REST export for the repository.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/ManufacturerRepository.java Disables Spring Data REST export for the repository.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/IntersectionRepository.java Disables Spring Data REST export and reformats repository method documentation.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/IntersectionOrganizationRepository.java Disables Spring Data REST export for the repository.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/FirmwareUpgradeRuleRepository.java Disables Spring Data REST export for the repository.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/EmailTypeRepository.java Disables Spring Data REST export for the repository.
services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/ConsecutiveFirmwareUpgradeFailureRepository.java Disables Spring Data REST export for the repository.
services/intersection-api/api/src/test/java/us/dot/its/jpo/ode/api/services/AdminIntersectionServiceTest.java Refactors/normalizes test formatting and keeps DB cleanup + auth context helpers for integration tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/WebConfig.java Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@jacob6838 jacob6838 requested review from mcook42 and payneBrandon May 11, 2026 19:40
@jacob6838 jacob6838 requested a review from Michael7371 May 20, 2026 14:39
Base automatically changed from iapi-email-unsubscription-backend to develop June 4, 2026 19:36
@jacob6838 jacob6838 removed the request for review from mcook42 June 24, 2026 21:37

@Michael7371 Michael7371 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified /v3/api-docs returns valid OpenAPI 3.1.0 and controller routes; no obvious JPA REST repo paths in the spec. Swagger fix LGTM.

Two things before merge:

  1. /v3/api-docs is reachable without auth; is this intended?
  2. Rebase onto the latest develop branch and drop the dead ManageSubscriptionsBody.

Comment thread resources/deprecated/sql_scripts/update_scripts/email_type_required_role.sql Outdated
@jacob6838 jacob6838 requested a review from Michael7371 June 25, 2026 03:40

@Michael7371 Michael7371 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Not sure if it is intended to allow access to Swagger docs without auth, but I don't have a problem with it.

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