Skip to content

Commit

Permalink
utoipa-gen: Migrate to snapshot testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Dec 21, 2024
1 parent 7dfb6b5 commit a234f42
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion utoipa-gen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3033,7 +3033,7 @@ pub fn into_responses(input: TokenStream) -> TokenStream {
/// .required("name")
/// )
/// ));
/// # assert_json_diff::assert_json_eq!(serde_json::to_value(&schema).unwrap(), serde_json::to_value(&generated).unwrap());
/// # insta::assert_json_snapshot!("schema", &schema);
/// ```
///
/// [primitive]: https://doc.rust-lang.org/std/primitive/index.html
Expand Down
24 changes: 24 additions & 0 deletions utoipa-gen/src/snapshots/doctest_lib_rs__schema.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
source: utoipa-gen/src/lib.rs
expression: "&schema"
snapshot_kind: text
---
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "integer",
"format": "int32"
},
"name": {
"type": "string"
}
}
}
}

0 comments on commit a234f42

Please sign in to comment.