Skip to content

Commit

Permalink
add utoipa attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
asmello authored and idubrov committed Mar 19, 2024
1 parent fbdb9b4 commit 1e6ae7b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ impl std::ops::Deref for Patch {
pub struct AddOperation {
/// JSON-Pointer value [RFC6901](https://tools.ietf.org/html/rfc6901) that references a location
/// within the target document where the operation is performed.
#[cfg_attr(feature = "utoipa", schema(value_type = String))]
pub path: Pointer,
/// Value to add to the target location.
pub value: Value,
Expand All @@ -160,6 +161,7 @@ impl_display!(AddOperation);
pub struct RemoveOperation {
/// JSON-Pointer value [RFC6901](https://tools.ietf.org/html/rfc6901) that references a location
/// within the target document where the operation is performed.
#[cfg_attr(feature = "utoipa", schema(value_type = String))]
pub path: Pointer,
}

Expand All @@ -171,6 +173,7 @@ impl_display!(RemoveOperation);
pub struct ReplaceOperation {
/// JSON-Pointer value [RFC6901](https://tools.ietf.org/html/rfc6901) that references a location
/// within the target document where the operation is performed.
#[cfg_attr(feature = "utoipa", schema(value_type = String))]
pub path: Pointer,
/// Value to replace with.
pub value: Value,
Expand All @@ -184,9 +187,11 @@ impl_display!(ReplaceOperation);
pub struct MoveOperation {
/// JSON-Pointer value [RFC6901](https://tools.ietf.org/html/rfc6901) that references a location
/// to move value from.
#[cfg_attr(feature = "utoipa", schema(value_type = String))]
pub from: Pointer,
/// JSON-Pointer value [RFC6901](https://tools.ietf.org/html/rfc6901) that references a location
/// within the target document where the operation is performed.
#[cfg_attr(feature = "utoipa", schema(value_type = String))]
pub path: Pointer,
}

Expand All @@ -198,9 +203,11 @@ impl_display!(MoveOperation);
pub struct CopyOperation {
/// JSON-Pointer value [RFC6901](https://tools.ietf.org/html/rfc6901) that references a location
/// to copy value from.
#[cfg_attr(feature = "utoipa", schema(value_type = String))]
pub from: Pointer,
/// JSON-Pointer value [RFC6901](https://tools.ietf.org/html/rfc6901) that references a location
/// within the target document where the operation is performed.
#[cfg_attr(feature = "utoipa", schema(value_type = String))]
pub path: Pointer,
}

Expand All @@ -212,6 +219,7 @@ impl_display!(CopyOperation);
pub struct TestOperation {
/// JSON-Pointer value [RFC6901](https://tools.ietf.org/html/rfc6901) that references a location
/// within the target document where the operation is performed.
#[cfg_attr(feature = "utoipa", schema(value_type = String))]
pub path: Pointer,
/// Value to test against.
pub value: Value,
Expand Down

0 comments on commit 1e6ae7b

Please sign in to comment.