Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
134 changes: 110 additions & 24 deletions apollo-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/OpenAppDTO'
example:
dataChangeCreatedBy: 'apollo'
dataChangeLastModifiedBy: 'apollo'
dataChangeCreatedTime: '2024-01-15T10:30:00.000Z'
dataChangeLastModifiedTime: '2024-01-15T10:30:00.000Z'
name: 'Sample Application'
appId: 'sample-app'
orgId: 'default'
orgName: 'Default Organization'
ownerName: 'Apollo Admin'
ownerEmail: 'admin@apollo.com'
$ref: '#/components/schemas/SuccessEmptyResponse'
headers: {}
'400':
description: '请求参数错误'
Expand Down Expand Up @@ -290,6 +279,12 @@ paths:
required: true
schema:
type: string
- name: operator
in: query
description: '操作人用户名'
required: true
schema:
type: string
Comment on lines +282 to +287
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Reconsider forcing operator as a required query parameter.

Turning operator into a required query parameter here (and across the other endpoints in this PR) is a breaking change: any existing client omitting it will now receive 4xx responses. Please either keep it optional with a default/fallback server-side, introduce a versioned path, or ship clear migration guidance before flipping the requirement.

🤖 Prompt for AI Agents
In apollo-openapi.yaml around lines 282 to 287, the change marks the query
parameter "operator" as required which is a breaking change for existing
clients; revert that breaking change by making "operator" optional again (remove
or set required: false) in this and all similar endpoint definitions, and either
implement a server-side fallback/default for missing operator or introduce a
versioned endpoint and clear migration notes; ensure the OpenAPI schema and
server validation remain consistent (if you choose fallback, update server
request handling to supply the default and add a note in the API changelog; if
you choose versioning, add the new path and keep the old one unchanged).

requestBody:
content:
application/json:
Expand Down Expand Up @@ -345,6 +340,12 @@ paths:
required: true
schema:
type: string
- name: operator
in: query
description: '操作人用户名'
required: true
schema:
type: string
responses:
'200':
description: '应用删除成功'
Expand Down Expand Up @@ -454,9 +455,7 @@ paths:
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/OpenEnvClusterInfo'
$ref: '#/components/schemas/MultiResponseEntity'
example:
- env: 'DEV'
clusters:
Expand Down Expand Up @@ -487,6 +486,12 @@ paths:
required: true
schema:
type: string
- name: operator
in: query
description: '操作人用户名'
required: true
schema:
type: string
requestBody:
content:
application/json:
Expand Down Expand Up @@ -540,9 +545,7 @@ paths:
content:
application/json:
schema:
type: array
items:
type: string
$ref: '#/components/schemas/MultiResponseEntity'
headers: {}
'404':
description: '应用不存在'
Expand Down Expand Up @@ -743,7 +746,7 @@ paths:
- name: operator
in: query
description: '操作人用户名'
required: false
required: true
schema:
type: string
responses:
Expand Down Expand Up @@ -882,6 +885,12 @@ paths:
required: true
schema:
type: string
- name: operator
in: query
description: '操作人用户名'
required: true
schema:
type: string
requestBody:
content:
application/json:
Expand Down Expand Up @@ -1112,7 +1121,7 @@ paths:
- name: operator
in: query
description: ''
required: false
required: true
schema:
type: string
responses:
Expand Down Expand Up @@ -1160,6 +1169,12 @@ paths:
required: true
schema:
type: string
- name: operator
in: query
description: '操作人用户名'
required: true
schema:
type: string
requestBody:
content:
application/json:
Expand Down Expand Up @@ -1402,6 +1417,12 @@ paths:
required: true
schema:
type: string
- name: operator
in: query
description: '操作人用户名'
required: true
schema:
type: string
requestBody:
content:
application/json:
Expand Down Expand Up @@ -1528,6 +1549,12 @@ paths:
required: true
schema:
type: string
- name: operator
in: query
description: '操作人用户名'
required: true
schema:
type: string
responses:
'200':
description: '配置项更改撤销成功'
Expand Down Expand Up @@ -1630,6 +1657,12 @@ paths:
required: true
schema:
type: string
- name: operator
in: query
description: '操作人用户名'
required: true
schema:
type: string
responses:
'200':
description: '集群删除成功'
Expand Down Expand Up @@ -2113,7 +2146,7 @@ paths:
- name: operator
in: query
description: '操作人用户名'
required: false
required: true
schema:
type: string
responses:
Expand Down Expand Up @@ -2868,6 +2901,12 @@ paths:
required: true
schema:
type: string
- name: operator
in: query
description: '操作人用户名'
required: true
schema:
type: string
responses:
'200':
description: 'AppNamespace删除成功'
Expand Down Expand Up @@ -3105,6 +3144,12 @@ paths:
required: true
schema:
type: string
- name: operator
in: query
description: '操作人用户名'
required: true
schema:
type: string
responses:
'200':
description: '解除关联成功'
Expand Down Expand Up @@ -3261,7 +3306,7 @@ paths:
- name: operator
in: query
description: '操作人用户名'
required: false
required: true
schema:
type: string
responses:
Expand Down Expand Up @@ -3334,7 +3379,7 @@ paths:
- name: operator
in: query
description: 操作人用户名
required: false
required: true
schema:
type: string
responses:
Expand Down Expand Up @@ -3397,6 +3442,12 @@ paths:
example: 'true'
schema:
type: boolean
- name: operator
in: query
description: '操作人用户名'
required: true
schema:
type: string
requestBody:
content:
application/json:
Expand Down Expand Up @@ -3527,7 +3578,7 @@ paths:
- name: operator
in: query
description: 操作人用户名
required: false
required: true
schema:
type: string
requestBody:
Expand Down Expand Up @@ -4160,5 +4211,40 @@ components:
projectB:
darkMode: true

MultiResponseEntity:
type: object
description: A response container holding multiple RichResponseEntity objects
properties:
code:
type: integer
description: Overall HTTP status code
example: 200
entities:
type: array
description: List of rich response entities
items:
$ref: '#/components/schemas/RichResponseEntity'
required:
- code
- entities

RichResponseEntity:
type: object
description: A wrapper for a single response entity with code, message, and body
properties:
code:
type: integer
description: HTTP status code
example: 200
message:
type: object
description: Response message (can be string or object)
example: "OK"
body:
type: object
description: Response payload (generic type T)
required:
- code
- message

Comment on lines +4214 to 4249
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix RichResponseEntity typing; current definition conflicts with examples

  • message is typed object, but examples use a string ("OK"). Use oneOf for string|object.
  • Consider allowing body to be null when no payload is present.

Minimal schema tweaks:

 RichResponseEntity:
   type: object
   properties:
     code:
       type: integer
       description: HTTP status code
       example: 200
     message:
-      type: object
-      description: Response message (can be string or object)
-      example: "OK"
+      description: Response message (string or object)
+      oneOf:
+        - type: string
+        - type: object
+      example: "OK"
     body:
-      type: object
-      description: Response payload (generic type T)
+      type: object
+      nullable: true
+      description: Response payload (generic type)

Optionally, if different endpoints have known concrete body types, define specialized wrappers (e.g., RichResponseEntityOfNamespace) to retain strong typing in OpenAPI.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
MultiResponseEntity:
type: object
description: A response container holding multiple RichResponseEntity objects
properties:
code:
type: integer
description: Overall HTTP status code
example: 200
entities:
type: array
description: List of rich response entities
items:
$ref: '#/components/schemas/RichResponseEntity'
required:
- code
- entities
RichResponseEntity:
type: object
description: A wrapper for a single response entity with code, message, and body
properties:
code:
type: integer
description: HTTP status code
example: 200
message:
type: object
description: Response message (can be string or object)
example: "OK"
body:
type: object
description: Response payload (generic type T)
required:
- code
- message
RichResponseEntity:
type: object
description: A wrapper for a single response entity with code, message, and body
properties:
code:
type: integer
description: HTTP status code
example: 200
message:
description: Response message (string or object)
oneOf:
- type: string
- type: object
example: "OK"
body:
type: object
nullable: true
description: Response payload (generic type)
required:
- code
- message
🤖 Prompt for AI Agents
In apollo-openapi.yaml around lines 4225 to 4260, RichResponseEntity's message
is typed as object but examples use a string and body cannot currently be null;
update the schema so message accepts either a string or an object (use oneOf
with type: string and type: object) and make body nullable (either set nullable:
true or use oneOf with object and "null") so endpoints that return no payload
are valid; keep code and message as required but ensure examples still match the
updated types and consider creating specialized RichResponseEntityOfX wrappers
for endpoints that need concrete body schemas.

servers: []
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix pipeline failure: Remove extra trailing line endings.

The pipeline reports multiple trailing line endings at the end of this file.

Apply this fix to remove extra blank lines:

-

-
+

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In apollo-openapi.yaml around line 4250, the file ends with extraneous
blank/trailing line endings; remove the extra blank lines at the end so the file
ends immediately after the final content (e.g., the line "servers: []") with a
single newline (no multiple empty lines) to satisfy the pipeline check.

14 changes: 7 additions & 7 deletions generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ echo "📦 Adding Maven Wrapper to Spring Boot 2 project..."
cd "$SPRING_BOOT2_DIR"
mvn -N io.takari:maven:wrapper -Dmaven=3.8.6

# this is for removing illegal symbols generated by a generator.
echo "Cleaning files (trailing spaces, CRLF, EOF newlines)..."
find . -type d \( -name .git -o -name .idea -o -name .mvn -o -name target -o -name build -o -name node_modules \) -prune -o \
-type f \( -name "*.java" -o -name "*.xml" -o -name "*.properties" -o -name "*.md" -o -name "*.yml" -o -name "*.yaml" -o -name "*.sh" -o -name ".editorconfig" -o -name ".gitignore" -o -name "mvnw" \) -print0 \
| xargs -0 perl -i -0777 -pe 's/[ \t]+(?=\r?$)//mg; s/\r//g; s/\s*\z/\n/s'
echo "Cleaning files (trailing spaces, CRLF, EOF newlines)... Done!"

cd ..

echo "💡 Spring Boot 2 project ready! To start the server, run:"
Expand All @@ -77,3 +70,10 @@ openapi-generator generate \
--additional-properties=packageName=apollo-openapi,packageVersion=0.0.1

echo "✅ SDK generation complete."

# this is for removing illegal symbols generated by a generator.
echo "Cleaning files (trailing spaces, CRLF, EOF newlines, wrong spellings)..."
find . -type d \( -name .git -o -name .idea -o -name .mvn -o -name target -o -name build -o -name node_modules \) -prune -o \
-type f \( -name "*.java" -o -name "*.xml" -o -name "*.properties" -o -name "*.md" -o -name "*.yml" -o -name "*.yaml" -o -name "*.gradle" -o -name "*.sh" -o -name "*.py" -o -name "*.pyi" -o -name "*.ts" -o -name "*.rs" -o -name ".editorconfig" -o -name ".gitignore" -o -name ".npmignore" -o -name "mvnw" -o -name "VERSION" \) -print0 \
| xargs -0 perl -i -0777 -pe 's/[ \t]+(?=\r?$)//mg; s/\r//g; s/filesystme/filesystem/g; s/\s*\z/\n/s'
echo "Cleaning files (trailing spaces, CRLF, EOF newlines, wrong spellings)... Done!"
6 changes: 3 additions & 3 deletions java-client/.github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 17, 21 ]
java: [ '8' ]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v4
uses: actions/setup-java@v2
Comment on lines +22 to +24
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Restore the hardened action versions

Rolling back to actions/checkout@v2 and actions/setup-java@v2 reintroduces Node 12/16 based actions, which GitHub is removing; the workflow will start failing once those runtimes are disabled. Please stick with the latest majors.

Apply this diff to revert the downgrade:

-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v4
     - name: Set up JDK
-      uses: actions/setup-java@v2
+      uses: actions/setup-java@v4
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v4
uses: actions/setup-java@v2
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
🤖 Prompt for AI Agents
In java-client/.github/workflows/maven.yml around lines 22 to 24, the workflow
was downgraded to older action majors that rely on Node 12/16; update the action
references to the current major releases to avoid future failures: replace
actions/checkout@v2 with actions/checkout@v4 and actions/setup-java@v2 with
actions/setup-java@v3 (or the latest stable majors) so the workflow uses
hardened versions that do not depend on deprecated Node runtimes.

with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
Expand Down
Loading