PatchMapping class

Shorthand annotation for a PATCH HTTP method mapping on a controller method.

Extends RequestMapping with method fixed to HttpMethod.PATCH. Supports the same parameters as RequestMapping:

  • value → URL path
  • params → Required request parameters
  • headers → Required request headers
  • consumes → Supported request content types
  • produces → Produced response content types

Example

@RestController()
class UserController {
  @PatchMapping(value: '/users/{id}')
  User updateUserPartial(String id, Map<String, dynamic> updates) {
    return userService.updatePartial(id, updates);
  }
}

This method will handle PATCH /users/{id} requests with partial updates.

Inheritance
Annotations
  • @Target.new({TargetKind.method})

Constructors

PatchMapping({List<MediaType> consumes = const [], List<MediaType> produces = const [], String? path})
Shorthand annotation for a PATCH HTTP method mapping on a controller method.
const

Properties

annotationType Type
Returns the annotation _type of this annotation.
no setterinherited
consumes List<MediaType>
Supported content types for the request body.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
method HttpMethod
The HTTP method for this mapping (GET, POST, etc.).
finalinherited
path String?
The URL path pattern for this mapping.
finalinherited
produces List<MediaType>
Produced content types for the response.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

equalizedProperties() List<Object?>
Mixin-style contract for value-based equality, hashCode, and toString.
inherited
equals(Object other) bool
Checks whether the given object is logically equivalent to this annotation.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Returns a string representation of this annotation.
inherited

Operators

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