Skip to main content

Validation rules

The processor validates your code at compile time and reports errors for:

API specification errors

ErrorCause
Must be an object or concrete classAPI spec is an interface or abstract class
Must extend ApiSpecMissing ApiSpec base class or not overriding baseUrl
Duplicate API nameMultiple API spec classes with same name in package

Request class errors

ErrorCause
Must end with 'Request' suffixClass name doesn't end with Request
Must be a data classHas properties but isn't a data class
Marker class must be an objectNo properties but isn't an object declaration
Object cannot have propertiesObject declaration has properties
Cannot be abstract, sealed, or innerRequest class is abstract, sealed, or inner
Multiple HTTP method annotationsMore than one of @GET, @POST, etc.
Must specify a pathHTTP annotation has empty path
Must have @Returns annotationMissing @Returns annotation

Parameter errors

ErrorCause
@Path must be annotated with @TransientPath parameter missing @Transient
@Path must be String, Int, Long, Short, Float, Double, or BooleanInvalid path parameter type
Path variable has no matching @Path parameterURL has {var} but no matching property
@Query must be annotated with @TransientQuery parameter missing @Transient
@Query must be nullableNon-nullable query parameter
@Query not allowed on POST/PUT/PATCHQuery params on body requests
@Header type not allowedHeader parameter type not in allowed set
@Header must be annotated with @TransientHeader parameter missing @Transient
@Header must be nullableNon-nullable header parameter
Invalid HTTP header nameHeader name violates RFC 7230
Cannot have multiple parameter annotationsProperty has more than one of @Path, @Query, @Header
Body parameters not allowed on GET/DELETEBody params on non-body requests
Body parameter must be nullable or have defaultNon-nullable body param without default

Return type errors

ErrorCause
Return type not @SerializableResponse type missing @Serializable
Return type could not be resolvedInvalid or missing type in @Returns