ZtoField class abstract

Base class for all Zto field type annotations.

All parameters are named. Provide mapKey to explicitly set the JSON key, or omit it so the generator can infer it from the field name and the DTO's ParseType. When neither is provided, key returns an empty string.

Implementers

Constructors

ZtoField({String? mapKey, String? description, Object? example, String? failMessage, bool deprecated = false})
const

Properties

deprecated bool
Marks this field as deprecated in the OpenAPI schema.
final
description String?
Description shown in OpenAPI / Swagger UI.
final
example Object?
Example value shown in OpenAPI / Swagger UI.
final
failMessage String?
Custom message when type validation fails. If null, a default is used.
final
hashCode int
The hash code for this object.
no setterinherited
key String
The resolved JSON map key — mapKey if set, otherwise ''.
no setter
mapKey String?
Explicit JSON map key for this field. Takes precedence over inference.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited