@@ -174,7 +174,9 @@ public JsonNode getSchemas(
174
174
catalogService
175
175
.getChartByVersion (catalogId , chartName , version )
176
176
.orElseThrow (NotFoundException ::new );
177
-
177
+ if (chart .getConfig () == null ) {
178
+ return null ;
179
+ }
178
180
return jsonSchemaResolutionService .resolveReferences (chart .getConfig (), user .getRoles ());
179
181
}
180
182
@@ -531,23 +533,26 @@ private Collection<Object> publishApps(
531
533
Map <String , Object > fusion = new HashMap <>();
532
534
fusion .putAll ((Map <String , Object >) requestDTO .getOptions ());
533
535
534
- JSONObject jsonSchema =
535
- new JSONObject (
536
- new JSONTokener (
537
- jsonSchemaResolutionService
538
- .resolveReferences (pkg .getConfig (), user .getRoles ())
539
- .toString ()));
540
-
541
- SchemaLoader loader =
542
- SchemaLoader .builder ()
543
- .schemaJson (jsonSchema )
544
- .draftV6Support () // or draftV7Support()
545
- .build ();
546
- org .everit .json .schema .Schema schema = loader .load ().build ();
547
- // Convert the options map to a JSONObject
548
- JSONObject jsonObject = new JSONObject (fusion );
549
- // Validate the options object against the schema
550
- schema .validate (jsonObject );
536
+ // If getConfig is null that means that no schema is provided : skip validation
537
+ if (pkg .getConfig () != null ) {
538
+ JSONObject jsonSchema =
539
+ new JSONObject (
540
+ new JSONTokener (
541
+ jsonSchemaResolutionService
542
+ .resolveReferences (pkg .getConfig (), user .getRoles ())
543
+ .toString ()));
544
+
545
+ SchemaLoader loader =
546
+ SchemaLoader .builder ()
547
+ .schemaJson (jsonSchema )
548
+ .draftV6Support () // or draftV7Support()
549
+ .build ();
550
+ org .everit .json .schema .Schema schema = loader .load ().build ();
551
+ // Convert the options map to a JSONObject
552
+ JSONObject jsonObject = new JSONObject (fusion );
553
+ // Validate the options object against the schema
554
+ schema .validate (jsonObject );
555
+ }
551
556
552
557
boolean skipTlsVerify = catalog .getSkipTlsVerify ();
553
558
String caFile = catalog .getCaFile ();
0 commit comments