Skip to content

Commit 351ebc3

Browse files
committed
Making type-name checks consistent across the schema
1 parent 08a6efa commit 351ebc3

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

docs/reference-manual/native-image/assets/reachability-metadata-schema-v1.2.0.json

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@
282282
"$ref": "#/$defs/condition"
283283
},
284284
"class": {
285-
"type": "string",
285+
"$ref": "#/$defs/className",
286286
"title": "Fully-qualified class name (e.g., `org.package.OuterClass$InnerClass`)"
287287
},
288288
"method": {
@@ -328,6 +328,14 @@
328328
"additionalProperties": false,
329329

330330
"$defs": {
331+
"className": {
332+
"type": "string",
333+
"pattern": "^[a-zA-Z_$][a-zA-Z0-9_$]*(\\.[a-zA-Z_$][a-zA-Z0-9_$]*)*$"
334+
},
335+
"typeName": {
336+
"type": "string",
337+
"pattern": "^[a-zA-Z_$][a-zA-Z0-9_$]*(\\.[a-zA-Z_$][a-zA-Z0-9_$]*)*(\\[\\])*$"
338+
},
331339
"reason": {
332340
"title": "A reason(s) for including this element (e.g., needed for establishing connections, or needed by method X#Y for task Z)",
333341
"oneOf": [
@@ -361,8 +369,7 @@
361369
"title": "Type descriptors used by GraalVM Native Image metadata files",
362370
"oneOf": [
363371
{
364-
"type": "string",
365-
"pattern": "^[a-zA-Z_$][a-zA-Z0-9_$]*(\\.[a-zA-Z_$][a-zA-Z0-9_$]*)*(\\[\\])*$"
372+
"$ref": "#/$defs/typeName"
366373
},
367374
{
368375
"type": "object",
@@ -373,8 +380,7 @@
373380
"default": [],
374381
"items": {
375382
"title": "Fully-qualified name of the interface defining the proxy class",
376-
"type": "string",
377-
"pattern": "^[a-zA-Z_$][a-zA-Z0-9_$]*(\\.[a-zA-Z_$][a-zA-Z0-9_$]*)*(\\[\\])*$"
383+
"$ref": "#/$defs/className"
378384
}
379385
},
380386
"lambda": {
@@ -383,7 +389,7 @@
383389
"properties": {
384390
"declaringClass": {
385391
"title": "The class in which the lambda class is defined",
386-
"$ref": "#/$defs/type"
392+
"$ref": "#/$defs/className"
387393
},
388394
"declaringMethod": {
389395
"title": "The method in which the lambda class is defined",
@@ -395,7 +401,8 @@
395401
"type": "array",
396402
"items": {
397403
"title": "Fully-qualified name of the interface implemented by the lambda class",
398-
"type": "string"
404+
"type": "string",
405+
"$ref": "#/$defs/className"
399406
},
400407
"minItems": 1
401408
}
@@ -435,7 +442,7 @@
435442
"default": [],
436443
"items": {
437444
"title": "List of the method's parameter types",
438-
"type": "string"
445+
"$ref": "#/$defs/typeName"
439446
},
440447
"type": "array"
441448
}

0 commit comments

Comments
 (0)