RestEntity

@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class RestEntity(val read: KClass<*> = Unit::class, val readAll: KClass<*> = Unit::class, val create: KClass<*> = Unit::class, val update: KClass<*> = Unit::class)(source)

Declares the REST DTO types of a DomainEntity: the response DTO of one entity (read) and of a page of entities (readAll), and the request DTO of its creation (create) and update (update).

None of them is used as a type: only their names are matched against the OpenAPI spec loaded for a codegen run. Each is optional; Unit falls back to the schema named by convention: playset, playset_list, create_playset and update_playset for Playset. Nothing declares there is no DTO to map in that direction: the endpoint's delegate then receives the request DTO as is. The annotation is repeatable, one per spec.

A response DTO is filled from the entity, a request DTO is read into the generated create or update command (see DomainCreate). Every property of either must be mapped, or the build fails.

Properties

Link copied to clipboard
val create: KClass<*>
Link copied to clipboard
val read: KClass<*>
Link copied to clipboard
val readAll: KClass<*>
Link copied to clipboard
val update: KClass<*>