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

fix: nullable ref is not a valid OpenAPI definition #12103

Merged
merged 1 commit into from
Oct 22, 2023

Conversation

acid-chicken
Copy link
Member

What

nullableoptional なオブジェクトで $ref を使う場合は allOf でラップするように

Why

nullableoptional キーワードと $ref の併用は OpenAPI 3.0 の定義として invalid なので

Additional info (optional)

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@acid-chicken acid-chicken added 🐛Bug Unexpected behavior packages/backend Server side specific issue/PR labels Oct 21, 2023
@codecov
Copy link

codecov bot commented Oct 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2697826) 79.36% compared to head (995db79) 79.25%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #12103      +/-   ##
===========================================
- Coverage    79.36%   79.25%   -0.11%     
===========================================
  Files          939      939              
  Lines       100332   100337       +5     
  Branches      8183     8157      -26     
===========================================
- Hits         79625    79522     -103     
- Misses       20707    20815     +108     
Files Coverage Δ
packages/backend/src/server/api/openapi/schemas.ts 100.00% <100.00%> (ø)

... and 17 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link
Contributor

このPRによるapi.jsonの差分

差分はこちら
--- base
+++ head
@@ -740,7 +740,11 @@
                         "nullable": true,
                         "optional": true,
                         "ref": "User",
-                        "$ref": "#/components/schemas/User"
+                        "allOf": [
+                          {
+                            "$ref": "#/components/schemas/User"
+                          }
+                        ]
                       }
                     },
                     "required": [
@@ -57890,7 +57894,11 @@
             "nullable": true,
             "optional": false,
             "ref": "Page",
-            "$ref": "#/components/schemas/Page"
+            "allOf": [
+              {
+                "$ref": "#/components/schemas/Page"
+              }
+            ]
           },
           "publicReactions": {
             "type": "boolean",
@@ -58495,14 +58503,22 @@
             "optional": true,
             "nullable": true,
             "ref": "Note",
-            "$ref": "#/components/schemas/Note"
+            "allOf": [
+              {
+                "$ref": "#/components/schemas/Note"
+              }
+            ]
           },
           "renote": {
             "type": "object",
             "optional": true,
             "nullable": true,
             "ref": "Note",
-            "$ref": "#/components/schemas/Note"
+            "allOf": [
+              {
+                "$ref": "#/components/schemas/Note"
+              }
+            ]
           },
           "isHidden": {
             "type": "boolean",
@@ -58786,7 +58802,11 @@
             "ref": "UserLite",
             "optional": true,
             "nullable": true,
-            "$ref": "#/components/schemas/UserLite"
+            "allOf": [
+              {
+                "$ref": "#/components/schemas/UserLite"
+              }
+            ]
           },
           "userId": {
             "type": "string",
@@ -58799,7 +58819,11 @@
             "ref": "Note",
             "optional": true,
             "nullable": true,
-            "$ref": "#/components/schemas/Note"
+            "allOf": [
+              {
+                "$ref": "#/components/schemas/Note"
+              }
+            ]
           },
           "reaction": {
             "type": "string",
@@ -58950,7 +58974,11 @@
             "optional": true,
             "nullable": true,
             "ref": "DriveFolder",
-            "$ref": "#/components/schemas/DriveFolder"
+            "allOf": [
+              {
+                "$ref": "#/components/schemas/DriveFolder"
+              }
+            ]
           },
           "userId": {
             "type": "string",
@@ -58964,7 +58992,11 @@
             "optional": true,
             "nullable": true,
             "ref": "UserLite",
-            "$ref": "#/components/schemas/UserLite"
+            "allOf": [
+              {
+                "$ref": "#/components/schemas/UserLite"
+              }
+            ]
           }
         },
         "required": [
@@ -59027,7 +59059,11 @@
             "optional": true,
             "nullable": true,
             "ref": "DriveFolder",
-            "$ref": "#/components/schemas/DriveFolder"
+            "allOf": [
+              {
+                "$ref": "#/components/schemas/DriveFolder"
+              }
+            ]
           }
         },
         "required": [
@@ -59064,7 +59100,11 @@
             "optional": true,
             "nullable": false,
             "ref": "UserDetailed",
-            "$ref": "#/components/schemas/UserDetailed"
+            "allOf": [
+              {
+                "$ref": "#/components/schemas/UserDetailed"
+              }
+            ]
           },
           "followerId": {
             "type": "string",
@@ -59077,7 +59117,11 @@
             "optional": true,
             "nullable": false,
             "ref": "UserDetailed",
-            "$ref": "#/components/schemas/UserDetailed"
+            "allOf": [
+              {
+                "$ref": "#/components/schemas/UserDetailed"
+              }
+            ]
           }
         },
         "required": [
@@ -59288,14 +59332,22 @@
             "optional": false,
             "nullable": true,
             "ref": "UserLite",
-            "$ref": "#/components/schemas/UserLite"
+            "allOf": [
+              {
+                "$ref": "#/components/schemas/UserLite"
+              }
+            ]
           },
           "usedBy": {
             "type": "object",
             "optional": false,
             "nullable": true,
             "ref": "UserLite",
-            "$ref": "#/components/schemas/UserLite"
+            "allOf": [
+              {
+                "$ref": "#/components/schemas/UserLite"
+              }
+            ]
           },
           "usedAt": {
             "type": "string",

Get diff files from Workflow Page

@syuilo syuilo merged commit 4b29508 into develop Oct 22, 2023
19 checks passed
@syuilo syuilo deleted the acid-chicken-patch-1 branch October 22, 2023 01:52
@syuilo
Copy link
Member

syuilo commented Oct 22, 2023

👍🏻 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛Bug Unexpected behavior packages/backend Server side specific issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants