Skip to content

Swagger json Automation#134

Open
DurgaPrasad-54 wants to merge 3 commits intoPSMRI:mainfrom
DurgaPrasad-54:main
Open

Swagger json Automation#134
DurgaPrasad-54 wants to merge 3 commits intoPSMRI:mainfrom
DurgaPrasad-54:main

Conversation

@DurgaPrasad-54
Copy link
Contributor

@DurgaPrasad-54 DurgaPrasad-54 commented Feb 4, 2026

Summary by CodeRabbit

  • New Features

    • Automated workflow to sync API Swagger/OpenAPI JSON into the docs repository.
  • Documentation

    • Added DeepWiki badge to the README.
    • Added runtime configuration for generating local Swagger documentation and defaults.
  • Chores

    • Added H2 as a runtime database dependency.
    • Added a profile toggle to enable/disable Swagger-related runtime configuration.

@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

Adds a GitHub Actions workflow to sync Swagger JSON from Identity-API to AMRIT-Docs, introduces an H2 runtime dependency and a swagger profile properties file, disables FilterConfig under the swagger profile, and adds a README badge.

Changes

Cohort / File(s) Summary
GitHub Actions Automation
​.github/workflows/swagger-json.yml
New workflow "Sync Swagger to AMRIT-Docs": builds the API (Java 17, Maven), runs it with the swagger profile, polls /v3/api-docs, formats/validates JSON with jq, checks out AMRIT-Docs, copies identity-api.json to docs/swagger/, and opens a PR.
Build Dependency
pom.xml
Added com.h2database:h2 dependency with runtime scope to support in-memory H2 for the swagger profile runtime.
Swagger runtime config
src/main/resources/application-swagger.properties
New properties file configuring an in-memory H2 datasource, JPA create-drop, optional Redis settings, CORS origins, JWT secret default, and logging level for the swagger profile.
Profile gating
src/main/java/com/iemr/common/identity/utils/FilterConfig.java
Annotated FilterConfig with @Profile("!swagger") so the filter is disabled when the swagger profile is active.
Docs / Branding
README.md
Added a DeepWiki badge next to the existing license badge in the README header.

Sequence Diagram

sequenceDiagram
    participant GHA as GitHub Actions
    participant Runner as Build Runner
    participant API as Identity API
    participant Swagger as /v3/api-docs
    participant jq as jq
    participant Docs as AMRIT-Docs
    participant GH as GitHub API

    GHA->>Runner: checkout repo, setup Java 17, Maven cache
    Runner->>Runner: mvn package (skip tests)
    Runner->>API: start with profile=swagger (H2 in-memory)
    loop poll until ready (30 × 5s)
        GHA->>Swagger: GET /v3/api-docs
        Swagger-->>GHA: Swagger JSON (when ready)
    end
    GHA->>jq: validate/format JSON -> identity-api.json
    GHA->>API: stop process
    GHA->>Docs: checkout AMRIT-Docs (token), copy `identity-api.json` -> `docs/swagger/`
    GHA->>GH: create PR (branch auto/swagger-update-...)
    GH-->>GHA: PR created
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped through builds and ports of spring,

grabbed the JSON that APIs bring,
stored it neat with H2's light,
pushed a PR to set docs right,
badges twinkled — what a thing!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Swagger json Automation' is directly related to the main change: a GitHub Actions workflow that automates syncing Swagger JSON from Identity-API to AMRIT-Docs repository, which is the primary objective of the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 4, 2026

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.

1 participant