What went wrong

This page is to collate some of the common issues that may prevent WidgetDefinitions making their way into the ui-dashboard FrontEnd, as well as the log outputs which signal them.

Invalid against the generic widgetdefinition schema

2021-05-21 16:17:49.671 INFO --- [ XNIO-1 task-1] org.olf.WidgetDefinitionService : WidgetDefinitionService::validateDefinition : ERM Agreements v1.2 2021-05-21 
16:17:49.671 INFO --- [ XNIO-1 task-1] org.olf.UtilityService : UtilityService::validateAgainstSchema : Validating against schema (Generic Widget Definition Schema)
2021-05-21 16:17:49.676 ERROR --- [ XNIO-1 task-1] org.olf.UtilityService : #/type/version: string [1.f] does not match pattern ^(0|(?:[1-9]\d*))\.(0|(?:[1-9]\d*))$
2021-05-21 16:17:49.679 ERROR --- [ XNIO-1 task-1] org.olf.WidgetDefinitionService : WidgetDefinition ERM Agreements (v1.2) is not valid

Here the validateDefinition method is attempting to validate ERM Agreements v1.2.

Firstly it validates the incoming JSON as a whole against the generic widget definition schema, which can be found here. In the case above ERM Agreements v1.2 has incorrectly entered "1.f" in the field type.version.

Missing/Incompatible WidgetType

2021-05-21 16:31:18.359 INFO --- [ XNIO-1 task-1] org.olf.WidgetDefinitionService : WidgetDefinitionService::validateDefinition : ERM Agreements v1.0
2021-05-21 16:31:18.367 INFO --- [ XNIO-1 task-1] org.olf.UtilityService : UtilityService::validateAgainstSchema : Validating against schema (Generic Widget Definition Schema)
2021-05-21 16:31:18.461 ERROR --- [ XNIO-1 task-1] org.olf.WidgetDefinitionService : No compatible WidgetType found for Foo v1.0
2021-05-21 16:31:18.461 ERROR --- [ XNIO-1 task-1] org.olf.WidgetDefinitionService : WidgetDefinition ERM Agreements (v1.0) is not valid

After the generic schema step, the service will attempt to find a matching WidgetType in the system from what is declared in the incoming JSON. In the case above WidgetType "Foo" does not exist in the database, and so the system returns an error message. The same message will be returned if no compatible versions can be found, ie searching for "Bar" version 2.0 and the only WidgetType in the system is "Bar" version 1.4.


Invalid against the specific WidgetType schema

2021-05-21 16:35:46.587 INFO --- [ XNIO-1 task-1] org.olf.WidgetDefinitionService : WidgetDefinitionService::validateDefinition : ERM Agreements v1.0
2021-05-21 16:35:46.587 INFO --- [ XNIO-1 task-1] org.olf.UtilityService : UtilityService::validateAgainstSchema : Validating against schema (Generic Widget Definition Schema)
2021-05-21 16:35:46.591 INFO --- [ XNIO-1 task-1] org.olf.UtilityService : UtilityService::validateAgainstSchema : Validating against schema (SimpleSearch widget)
2021-05-21 16:35:46.603 ERROR --- [ XNIO-1 task-1] org.olf.UtilityService : #: 5 schema violations found
2021-05-21 16:35:46.607 ERROR --- [ XNIO-1 task-1] org.olf.UtilityService : 	#/filters/columns: 4 schema violations found
2021-05-21 16:35:46.607 ERROR --- [ XNIO-1 task-1] org.olf.UtilityService : 		#/filters/columns/0: #: only 2 subschema matches out of 3
2021-05-21 16:35:46.608 ERROR --- [ XNIO-1 task-1] org.olf.UtilityService : 			#/filters/columns/0: #: no subschema matched out of the total 2 subschemas
2021-05-21 16:35:46.608 ERROR --- [ XNIO-1 task-1] org.olf.UtilityService : 				#/filters/columns/0: #: only 1 subschema matches out of 2
2021-05-21 16:35:46.608 ERROR --- [ XNIO-1 task-1] org.olf.UtilityService : 					#/filters/columns/0/valueType: subject must not be valid against schema {"const":"Enum"}
2021-05-21 16:35:46.608 ERROR --- [ XNIO-1 task-1] org.olf.UtilityService : 				#/filters/columns/0: required key [enumValues] not found
2021-05-21 16:35:46.608 ERROR --- [ XNIO-1 task-1] org.olf.UtilityService : 			#/filters/columns/2: #: only 2 subschema matches out of 3
2021-05-21 16:35:46.608 ERROR --- [ XNIO-1 task-1] org.olf.UtilityService : 				#/filters/columns/2: extraneous key [extraField] is not permitted
2021-05-21 16:35:46.608 ERROR --- [ XNIO-1 task-1] org.olf.UtilityService : 			#/filters/columns/4: #: only 2 subschema matches out of 3
2021-05-21 16:35:46.608 ERROR --- [ XNIO-1 task-1] org.olf.UtilityService : 				#/filters/columns/4: subject must not be valid against schema {"required":["resource"],"properties":{"valueType":{"not":{"const":"UUID"}}}}
2021-05-21 16:35:46.608 ERROR --- [ XNIO-1 task-1] org.olf.UtilityService : 	#/results/columns/0/valueType: #: only 1 subschema matches out of 2
2021-05-21 16:35:46.608 ERROR --- [ XNIO-1 task-1] org.olf.UtilityService : 		#/results/columns/0/valueType: Enum is not a valid enum value
2021-05-21 16:35:46.608 ERROR --- [ XNIO-1 task-1] org.olf.WidgetDefinitionService : WidgetDefinition ERM Agreements (v1.0) is not valid

The above is an example of the output when several schema violations are detected on input. Each level should be indented to help parsing of the errors.