Commit 6ddfb17
committed
fix(api): address Copilot review issues in Hubble 2.0 API adaptation
- SchemaTemplateAPI: add ensurePdModeEnabled() guard to all endpoints
to prevent NPE when MetaManager is not initialized in standalone mode
- SchemaTemplateAPI: add null body check in create() and update() to
return 400 instead of NPE/500 on missing request body
- GraphsAPI.listProfile: format default_update_time consistently with
create_time using DATE_FORMATTER instead of raw Date serialization
- GraphsAPI.manage: guard value.getClass() against null action value
to prevent NPE when building the validation error message
- GraphSpaceAPI.deleteDefaultRole: wrap HugeDefaultRole.valueOf() in
try/catch to return 400 for invalid role values instead of 500
- GraphManager: add isPDEnabled() guard to all schema-template methods
to prevent NPE when MetaManager is not available in standalone mode
- GraphManager.updateGraphNickname: propagate PD persistence failure to
caller with in-memory rollback, preventing silent state inconsistency1 parent f868dbc commit 6ddfb17
4 files changed
Lines changed: 47 additions & 6 deletions
File tree
- hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph
- api
- profile
- space
- core
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
188 | 194 | | |
189 | 195 | | |
190 | 196 | | |
| |||
342 | 348 | | |
343 | 349 | | |
344 | 350 | | |
345 | | - | |
| 351 | + | |
346 | 352 | | |
347 | 353 | | |
348 | 354 | | |
| |||
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
235 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
236 | 241 | | |
237 | 242 | | |
238 | 243 | | |
| |||
hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/space/SchemaTemplateAPI.java
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| 85 | + | |
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
| |||
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
100 | 105 | | |
101 | 106 | | |
102 | 107 | | |
| |||
120 | 125 | | |
121 | 126 | | |
122 | 127 | | |
| 128 | + | |
123 | 129 | | |
124 | 130 | | |
125 | 131 | | |
| |||
148 | 154 | | |
149 | 155 | | |
150 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
151 | 160 | | |
152 | 161 | | |
153 | 162 | | |
| |||
Lines changed: 23 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2226 | 2226 | | |
2227 | 2227 | | |
2228 | 2228 | | |
2229 | | - | |
2230 | | - | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
2231 | 2236 | | |
2232 | 2237 | | |
2233 | 2238 | | |
| |||
2240 | 2245 | | |
2241 | 2246 | | |
2242 | 2247 | | |
| 2248 | + | |
| 2249 | + | |
| 2250 | + | |
| 2251 | + | |
2243 | 2252 | | |
2244 | 2253 | | |
2245 | 2254 | | |
2246 | 2255 | | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
2247 | 2260 | | |
2248 | 2261 | | |
2249 | 2262 | | |
2250 | 2263 | | |
2251 | 2264 | | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
2252 | 2269 | | |
2253 | 2270 | | |
2254 | 2271 | | |
2255 | 2272 | | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
2256 | 2277 | | |
2257 | 2278 | | |
2258 | 2279 | | |
| |||
0 commit comments