fix required properties for json schemas

This commit is contained in:
Julian Krings 2025-06-23 15:51:29 +02:00
parent e5cb4d82a3
commit e38dae0a32
No known key found for this signature in database
GPG Key ID: 208C6E08C3B718D2

View File

@ -140,6 +140,8 @@ public class SchemaBuilder {
JSONObject property = buildProperty(k, c); JSONObject property = buildProperty(k, c);
if (property.getBoolean("!required"))
required.put(k.getName());
property.remove("!required"); property.remove("!required");
properties.put(k.getName(), property); properties.put(k.getName(), property);
} }
@ -512,8 +514,9 @@ public class SchemaBuilder {
d.add(fancyType); d.add(fancyType);
d.add(getDescription(k.getType())); d.add(getDescription(k.getType()));
if (k.getType().isAnnotationPresent(Snippet.class)) { Snippet snippet = k.getType().getDeclaredAnnotation(Snippet.class);
String sm = k.getType().getDeclaredAnnotation(Snippet.class).value(); if (snippet != null) {
String sm = snippet.value();
d.add(" "); d.add(" ");
d.add("You can instead specify \"snippet/" + sm + "/some-name.json\" to use a snippet file instead of specifying it here."); d.add("You can instead specify \"snippet/" + sm + "/some-name.json\" to use a snippet file instead of specifying it here.");
} }