Skip to content

Commit 77b75f2

Browse files
sionsmithclaude
andcommitted
feat: initial release of Akka OpenAPI Maven Plugin
This plugin generates OpenAPI 3.1 specifications from Akka SDK HTTP endpoint annotations at compile time. Features: - OpenAPI 3.1 specification generation from @HttpEndpoint annotations - Automatic schema generation from Java POJOs using jsonschema-generator - Support for Akka SDK HTTP method annotations (@get, @post, @put, @delete, @patch) - Path parameter extraction from URL patterns - Request body inference from complex type parameters - Response schema generation from method return types - Custom OpenAPI annotations (@OpenAPITag, @OpenAPIResponse, @OpenAPIInfo, @OpenAPIExample) - Jakarta Validation annotation support for schema constraints - Jackson annotation support for property naming and formatting - Server configuration in plugin settings - YAML and JSON output format options - OpenAPI specification validation using swagger-parser - Circular reference detection and handling CI/CD: - GitHub Actions workflows for CI/CD - Multi-stage release workflow with GPG signing - SonarCloud integration for code quality - Codecov integration for coverage reporting - Dependabot for automated dependency updates Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
0 parents  commit 77b75f2

File tree

103 files changed

+15520
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+15520
-0
lines changed

.github/RELEASE_TEMPLATE.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
## Version X.Y.Z - Release Date
2+
3+
### Features
4+
- New feature A
5+
- New feature B
6+
7+
### Bug Fixes
8+
- Fixed bug A (fixes #123)
9+
- Fixed bug B (fixes #456)
10+
11+
### Dependency Updates
12+
- Updated Jackson to X.Y.Z
13+
- Updated Maven plugins
14+
15+
### Security
16+
- Fixed XSS vulnerability in input validation (CVE-XXXX-XXXXX)
17+
18+
### Breaking Changes
19+
- Removed deprecated method X
20+
- Changed behavior of Y
21+
22+
### Contributors
23+
- @contributor1
24+
- @contributor2
25+
26+
### Installation
27+
28+
```xml
29+
<plugin>
30+
<groupId>com.github.osodevops</groupId>
31+
<artifactId>akka-openapi-maven-plugin</artifactId>
32+
<version>X.Y.Z</version>
33+
<executions>
34+
<execution>
35+
<goals>
36+
<goal>generate</goal>
37+
</goals>
38+
</execution>
39+
</executions>
40+
</plugin>
41+
```
42+
43+
### Changelog
44+
See full changelog: [CHANGELOG.md](CHANGELOG.md)
45+
46+
### Getting Help
47+
- Documentation: [README.md](README.md)
48+
- Issues: [GitHub Issues](../../issues)
49+
- Discussions: [GitHub Discussions](../../discussions)

.github/dependabot.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
version: 2
2+
updates:
3+
# Maven dependencies
4+
- package-ecosystem: "maven"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "monday"
9+
time: "09:00"
10+
timezone: "Europe/London"
11+
open-pull-requests-limit: 10
12+
commit-message:
13+
prefix: "deps"
14+
include: "scope"
15+
labels:
16+
- "dependencies"
17+
- "maven"
18+
groups:
19+
jackson:
20+
patterns:
21+
- "com.fasterxml.jackson*"
22+
swagger:
23+
patterns:
24+
- "io.swagger*"
25+
testing:
26+
patterns:
27+
- "org.junit*"
28+
- "org.assertj*"
29+
- "org.mockito*"
30+
maven-plugins:
31+
patterns:
32+
- "org.apache.maven.plugins:*"
33+
json-schema:
34+
patterns:
35+
- "com.github.victools:*"
36+
ignore:
37+
# Ignore major version updates for Akka SDK for stability
38+
- dependency-name: "io.akka:akka-javasdk"
39+
update-types: ["version-update:semver-major"]
40+
# Ignore major version updates for ClassGraph
41+
- dependency-name: "io.github.classgraph:classgraph"
42+
update-types: ["version-update:semver-major"]
43+
44+
# GitHub Actions
45+
- package-ecosystem: "github-actions"
46+
directory: "/"
47+
schedule:
48+
interval: "weekly"
49+
day: "monday"
50+
time: "09:00"
51+
timezone: "Europe/London"
52+
open-pull-requests-limit: 5
53+
commit-message:
54+
prefix: "ci"
55+
include: "scope"
56+
labels:
57+
- "dependencies"
58+
- "github-actions"

.github/workflows/ci.yml

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
name: CI Build & Test
2+
3+
on:
4+
pull_request:
5+
branches: [ main, develop ]
6+
push:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
java-version: [ '17', '21' ]
16+
17+
name: Build with Java ${{ matrix.java-version }}
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Set up JDK ${{ matrix.java-version }}
26+
uses: actions/setup-java@v4
27+
with:
28+
java-version: ${{ matrix.java-version }}
29+
distribution: 'temurin'
30+
cache: 'maven'
31+
32+
- name: Build and test
33+
run: |
34+
mvn clean verify \
35+
--batch-mode \
36+
--no-transfer-progress
37+
38+
- name: Upload test results
39+
uses: actions/upload-artifact@v4
40+
if: always()
41+
with:
42+
name: test-results-java-${{ matrix.java-version }}
43+
path: |
44+
**/target/surefire-reports/*.xml
45+
**/target/failsafe-reports/*.xml
46+
47+
- name: Publish test results
48+
uses: EnricoMi/publish-unit-test-result-action@v2
49+
if: always()
50+
with:
51+
files: '**/target/surefire-reports/TEST-*.xml'
52+
check_name: Test Results (JDK ${{ matrix.java-version }})
53+
54+
code-quality:
55+
runs-on: ubuntu-latest
56+
needs: build-and-test
57+
58+
steps:
59+
- name: Checkout code
60+
uses: actions/checkout@v4
61+
with:
62+
fetch-depth: 0
63+
64+
- name: Set up JDK 17
65+
uses: actions/setup-java@v4
66+
with:
67+
java-version: '17'
68+
distribution: 'temurin'
69+
cache: 'maven'
70+
71+
- name: Build for analysis
72+
run: |
73+
mvn clean compile test-compile \
74+
--batch-mode \
75+
--no-transfer-progress
76+
77+
- name: Run SpotBugs
78+
run: |
79+
mvn spotbugs:check \
80+
--batch-mode \
81+
--no-transfer-progress \
82+
-Dspotbugs.failOnError=false || true
83+
84+
- name: Run Checkstyle
85+
run: |
86+
mvn checkstyle:check \
87+
--batch-mode \
88+
--no-transfer-progress \
89+
-Dcheckstyle.failOnViolation=false || true
90+
91+
- name: Check dependencies for vulnerabilities
92+
run: |
93+
mvn org.owasp:dependency-check-maven:check \
94+
--batch-mode \
95+
--no-transfer-progress \
96+
-DfailBuildOnCVSS=11 || true
97+
98+
- name: Check for uncommitted changes
99+
run: |
100+
if [[ -n $(git status --porcelain) ]]; then
101+
echo "There are uncommitted changes after the build"
102+
git status
103+
exit 1
104+
fi
105+
106+
coverage:
107+
runs-on: ubuntu-latest
108+
needs: build-and-test
109+
110+
steps:
111+
- name: Checkout code
112+
uses: actions/checkout@v4
113+
with:
114+
fetch-depth: 0
115+
116+
- name: Set up JDK 17
117+
uses: actions/setup-java@v4
118+
with:
119+
java-version: '17'
120+
distribution: 'temurin'
121+
cache: 'maven'
122+
123+
- name: Build with coverage
124+
run: |
125+
mvn clean verify \
126+
--batch-mode \
127+
--no-transfer-progress
128+
129+
- name: Upload coverage to Codecov
130+
uses: codecov/codecov-action@v4
131+
with:
132+
files: |
133+
**/target/site/jacoco/jacoco.xml
134+
flags: unittests
135+
fail_ci_if_error: false
136+
token: ${{ secrets.CODECOV_TOKEN }}
137+
138+
- name: Upload coverage report artifact
139+
uses: actions/upload-artifact@v4
140+
with:
141+
name: coverage-report
142+
path: |
143+
**/target/site/jacoco/
144+
145+
example-project:
146+
runs-on: ubuntu-latest
147+
needs: build-and-test
148+
149+
steps:
150+
- name: Checkout code
151+
uses: actions/checkout@v4
152+
153+
- name: Set up JDK 17
154+
uses: actions/setup-java@v4
155+
with:
156+
java-version: '17'
157+
distribution: 'temurin'
158+
cache: 'maven'
159+
160+
- name: Build and generate OpenAPI
161+
run: |
162+
mvn -B clean install -DskipTests
163+
echo "=== Generated OpenAPI Specification ==="
164+
cat akka-openapi-example/target/openapi.yaml
165+
166+
- name: Upload generated OpenAPI spec
167+
uses: actions/upload-artifact@v4
168+
with:
169+
name: openapi-spec
170+
path: akka-openapi-example/target/openapi.yaml

0 commit comments

Comments
 (0)