Skip to content

Conversation

@tigloo
Copy link

@tigloo tigloo commented Jan 11, 2026

I encountered a Failure during REST processing: ca.uhn.fhir.context.ConfigurationException: HAPI-1716: Resource class[java.lang.String] does not contain any valid HAPI-FHIR annotations error when calling PlanDefinition/$apply in the HAPI FHIR JPA server starter project (using HAPI FHIR 8.6.0).

It seems that HAPI relies on either a typeName annotation or requires the use of typed classes such as StringType.

The fix adds typeName = "string" to all @OperationParam annotations that use String parameters.

Affected providers:

  • r4/plandefinition/PlanDefinitionApplyProvider
  • r4/activitydefinition/ActivityDefinitionApplyProvider
  • r4/graphdefinition/GraphDefinitionApplyProvider
  • dstu3/plandefinition/PlanDefinitionApplyProvider
  • dstu3/activitydefinition/ActivityDefinitionApplyProvider

Note that I tested this only with the R4 PlanDefinitionApplyProvider.

This fixes HAPI-1716 errors when using these providers with HAPI FHIR 8.x.

HAPI FHIR 8.x has stricter type checking for @OperationParam annotations.
When using java.lang.String without specifying typeName, HAPI FHIR tries
to scan String as a FHIR resource class, which fails with:

  HAPI-1716: Resource class[java.lang.String] does not contain any valid
  HAPI-FHIR annotations

The fix adds typeName = "string" to all @OperationParam annotations that
use String parameters. This tells HAPI FHIR to treat the parameter as a
FHIR string type mapped to a Java String.

Affected providers:
- r4/plandefinition/PlanDefinitionApplyProvider
- r4/activitydefinition/ActivityDefinitionApplyProvider
- r4/graphdefinition/GraphDefinitionApplyProvider
- dstu3/plandefinition/PlanDefinitionApplyProvider
- dstu3/activitydefinition/ActivityDefinitionApplyProvider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant