ApiQuery class

Provides OpenAPI documentation for a query parameter.

Use this annotation along with @Query to document query parameters in the generated OpenAPI documentation.

Example:

@Controller('/api/users')
class UserController {
  @Get('/')
  @ApiOperation(summary: 'Search users')
  Future<Response> searchUsers(
    Request request,
    @Query('name') @ApiQuery(description: 'Filter by name', required: false) String? name,
    @Query('age') @ApiQuery(description: 'Filter by age', required: false) int? age
  ) {
    // Method implementation...
  }
}

Constructors

ApiQuery.new({String? name, String description = '', bool required = false})
Creates an ApiQuery annotation with the specified name, description, and required flag.
const

Properties

description String
A description of the query parameter.
final
hashCode int
The hash code for this object.
no setterinherited
name String?
The name of the query parameter.
final
required bool
Indicates whether the query parameter is required.
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