Repository: wafflespeanut/paperclip
Pull request #238 (2020-10-01 23:14:27)

Update insta requirement from 0.16 to 1.0
Updates the requirements on [insta](https://github.com/mitsuhiko/insta) to permit the latest version.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md">insta's changelog</a>.</em></p>
<blockquote>
<h2>1.0.0</h2>
<ul>
<li>Globs now follow links (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/132">#132</a>)</li>
<li>Added CSV Support (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/134">#134</a>)</li>
<li>Changed globs to also include directories not just files.</li>
<li>Support snapshots outside source folder. (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/70">#70</a>)</li>
<li>Update RON to 0.6.</li>
</ul>
<h2>0.16.1</h2>
<ul>
<li>Add <code>Settings::bind_async</code> when the <code>async</code> feature is enabled. (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/121">#121</a>)</li>
<li>Bumped <code>console</code> dependency to 0.11. (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/124">#124</a>)</li>
<li>Fixed incorrect path handling for <code>glob!</code>. (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/123">#123</a>)</li>
<li>Remove <code>cargo-insta</code> from workspace and add <code>Cargo.lock</code>. (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/116">#116</a>)</li>
</ul>
<h2>0.16.0</h2>
<ul>
<li>Made snapshot names optional for inline snapshots. (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/106">#106</a>)</li>
<li>Remove legacy macros. (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/115">#115</a>)</li>
<li>Made small improvements to cargo-insta's messaging and flags (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/114">#114</a>)</li>
<li>Added new logo.</li>
<li>Added <code>glob</code> support. (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/112">#112</a>)</li>
<li>Made <code>MetaData</code> fields internal. (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/111">#111</a>)</li>
</ul>
<h2>0.15.0</h2>
<ul>
<li>Added test output control (<code>INSTA_OUTPUT</code> envvar). (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/103">#103</a>)</li>
</ul>
<h2>0.14.0</h2>
<ul>
<li>Dependency bump for <code>console</code> (lowers total dependency count)</li>
<li>Change binary name to <code>cargo insta</code> in help pages.</li>
</ul>
<h2>0.13.1</h2>
<ul>
<li>Added support for <code>INSTA_UPDATE=unseen</code> to write out unseen snapshots without review (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/96">#96</a>)</li>
<li>Added the <code>backtrace</code> feature which adds support for test name (and thus snapshot name)
recovery from the backtrace if rust-test is not used in concurrent mode (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/94">#94</a>, <a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/98">#98</a>)</li>
</ul>
<h2>0.13</h2>
<ul>
<li>Add support for deep wildcard matches (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/92">#92</a>)</li>
<li>Use module paths for test names (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/87">#87</a>)</li>
<li>Do not emit useless indentations for empty lines (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/88">#88</a>)</li>
</ul>
<h2>0.12</h2>
<ul>
<li>Improve redactions support (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/81">#81</a>)</li>
<li>Deprecated macros are now hidden</li>
<li>Reduce number of dependencies further.</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/mitsuhiko/insta/commit/d1857e93e958a0f68dd4b848a4566f5bcc543d40"><code>d1857e9</code></a> 1.0.0</li>
<li><a href="https://github.com/mitsuhiko/insta/commit/c64fcf26cd22dae926ef6d8d8964ff8f589cbce8"><code>c64fcf2</code></a> Update dependencies including ron.</li>
<li><a href="https://github.com/mitsuhiko/insta/commit/2d891eca5d753ddc7717cca2789ba25426bf9379"><code>2d891ec</code></a> Support snapshots outside of source folders.</li>
<li><a href="https://github.com/mitsuhiko/insta/commit/429505dc6241ceb9e98c9465b210e75239b6791e"><code>429505d</code></a> Change globbing to include directories</li>
<li><a href="https://github.com/mitsuhiko/insta/commit/86e022328be1dcb9c59c305f59b46014e7959504"><code>86e0223</code></a> Update changelog</li>
<li><a href="https://github.com/mitsuhiko/insta/commit/ec9388dd96730075dc47fa2e7f3e27adb412b6a3"><code>ec9388d</code></a> Check more doc code blocks (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/110">#110</a>)</li>
<li><a href="https://github.com/mitsuhiko/insta/commit/659f1a33d745ea56eab2460939306f1f19c62c94"><code>659f1a3</code></a> Let globs follow links (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/132">#132</a>)</li>
<li><a href="https://github.com/mitsuhiko/insta/commit/910ea6cb9a4023f2d217e9b404a03ef99bb17967"><code>910ea6c</code></a> Add CSV support (<a href="https://github-redirect.dependabot.com/mitsuhiko/insta/issues/134">#134</a>)</li>
<li><a href="https://github.com/mitsuhiko/insta/commit/fcfaa497472f05945d4f5205e37eb8dc40fb9302"><code>fcfaa49</code></a> 0.16.1</li>
<li><a href="https://github.com/mitsuhiko/insta/commit/98fc9e7b3780434d26f82fa12ab9679a02fad519"><code>98fc9e7</code></a> Updated changelog</li>
<li>Additional commits viewable in <a href="https://github.com/mitsuhiko/insta/compare/0.16.0...1.0.0">compare view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>


Patch:
diff --git a/Cargo.toml b/Cargo.toml
index 7fbbd062..b140f77d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -51,7 +51,7 @@ futures = "0.3"
 uuid_dev = { version = "0.8", features = ["serde"], package = "uuid" }
 reqwest = { version = "0.10", features = ["blocking", "json"] }
 log = { version = "0.4", features = ["kv_unstable"] }
-insta = "0.16"
+insta = "1.0"
 env_logger = "0.7"
 
 [features]
diff --git a/core/src/v2/schema.rs b/core/src/v2/schema.rs
index 9ca8a89b..71b5f4d9 100644
--- a/core/src/v2/schema.rs
+++ b/core/src/v2/schema.rs
@@ -196,6 +196,8 @@ impl_type_simple!(
     DataType::String,
     DataTypeFormat::DateTime
 );
+#[cfg(feature = "chrono")]
+impl_type_simple!(chrono::NaiveDate, DataType::String, DataTypeFormat::Date);
 #[cfg(feature = "rust_decimal")]
 impl_type_simple!(
     rust_decimal::Decimal,
@@ -216,6 +218,16 @@ impl<T: chrono::offset::TimeZone> TypedData for chrono::DateTime<T> {
     }
 }
 
+#[cfg(feature = "chrono")]
+impl<T: chrono::offset::TimeZone> TypedData for chrono::Date<T> {
+    fn data_type() -> DataType {
+        DataType::String
+    }
+    fn format() -> Option<DataTypeFormat> {
+        Some(DataTypeFormat::Date)
+    }
+}
+
 /// Represents a OpenAPI v2 schema object convertible. This is auto-implemented by
 /// framework-specific macros:
 ///


Test patch:
diff --git a/tests/test_app.rs b/tests/test_app.rs
index cf25d494..329427d8 100644
--- a/tests/test_app.rs
+++ b/tests/test_app.rs
@@ -39,6 +39,7 @@ struct Pet {
     name: String,
     class: PetClass,
     id: Option<u64>,
+    birthday: chrono_dev::NaiveDate,
     updated_on: Option<chrono_dev::NaiveDateTime>,
     #[serde(rename = "uuid")]
     uid: Option<uuid_dev::Uuid>,
@@ -49,6 +50,7 @@ impl Default for Pet {
         Self {
             name: "".to_string(),
             class: PetClass::EverythingElse,
+            birthday: chrono_dev::NaiveDate::from_ymd(2012, 3, 10),
             id: None,
             updated_on: None,
             uid: None,
@@ -138,6 +140,10 @@ fn test_simple_app() {
                           "description": "Pick a good one.",
                           "type": "string"
                         },
+                        "birthday": {
+                          "format": "date",
+                          "type": "string"
+                        },
                         "updatedOn": {
                           "format": "date-time",
                           "type": "string"
@@ -147,7 +153,7 @@ fn test_simple_app() {
                           "type": "string"
                         }
                       },
-                      "required":["class", "name"]
+                      "required":["birthday", "class", "name"]
                     }
                   },
                   "paths": {
@@ -1038,6 +1044,10 @@ fn test_list_in_out() {
                           "description": "Pick a good one.",
                           "type": "string"
                         },
+                        "birthday": {
+                          "format": "date",
+                          "type": "string"
+                        },
                         "updatedOn": {
                           "format": "date-time",
                           "type": "string"
@@ -1047,7 +1057,7 @@ fn test_list_in_out() {
                           "type": "string"
                         }
                       },
-                      "required":["class", "name"]
+                      "required":["birthday", "class", "name"]
                     }
                   },
                   "paths": {
@@ -1158,6 +1168,10 @@ fn test_impl_traits() {
                           "description": "Pick a good one.",
                           "type": "string"
                         },
+                        "birthday": {
+                          "format": "date",
+                          "type": "string"
+                        },
                         "updatedOn": {
                           "format": "date-time",
                           "type": "string"
@@ -1167,7 +1181,7 @@ fn test_impl_traits() {
                           "type": "string"
                         }
                       },
-                      "required":["class", "name"]
+                      "required":["birthday", "class", "name"]
                     }
                   },
                   "paths": {
@@ -1273,6 +1287,10 @@ fn test_operation_with_generics() {
                                  "description":"Pick a good one.",
                                  "type":"string"
                               },
+                              "birthday": {
+                                "format": "date",
+                                "type": "string"
+                              },
                               "updatedOn":{
                                  "format":"date-time",
                                  "type":"string"
@@ -1283,6 +1301,7 @@ fn test_operation_with_generics() {
                               }
                            },
                            "required":[
+                             "birthday",
                               "class",
                               "name"
                            ]
@@ -1430,6 +1449,10 @@ fn test_operations_documentation() {
                           "description": "Pick a good one.",
                           "type": "string"
                         },
+                        "birthday": {
+                          "format": "date",
+                          "type": "string"
+                        },
                         "updatedOn": {
                           "format": "date-time",
                           "type": "string"
@@ -1439,7 +1462,7 @@ fn test_operations_documentation() {
                           "type": "string"
                         }
                       },
-                      "required":["class", "name"]
+                      "required":["birthday", "class", "name"]
                     }
                   },
                   "paths": {
@@ -1565,6 +1588,10 @@ fn test_operations_macro_attributes() {
                                     "description": "Pick a good one.",
                                     "type": "string"
                                 },
+                                "birthday": {
+                                  "format": "date",
+                                  "type": "string"
+                                },
                                 "updatedOn": {
                                     "format": "date-time",
                                     "type": "string"
@@ -1575,6 +1602,7 @@ fn test_operations_macro_attributes() {
                                 }
                             },
                             "required":[
+                                "birthday",
                                 "class",
                                 "name"
                             ]
@@ -1871,6 +1899,10 @@ fn test_errors_app() {
                           "description": "Pick a good one.",
                           "type": "string"
                         },
+                        "birthday": {
+                          "format": "date",
+                          "type": "string"
+                        },
                         "updatedOn": {
                           "format": "date-time",
                           "type": "string"
@@ -1880,7 +1912,7 @@ fn test_errors_app() {
                           "type": "string"
                         }
                       },
-                      "required":["class", "name"]
+                      "required":["birthday", "class", "name"]
                     }
                   },
                   "paths": {
@@ -2028,6 +2060,10 @@ fn test_security_app() {
                           "description": "Pick a good one.",
                           "type": "string"
                         },
+                        "birthday": {
+                          "format": "date",
+                          "type": "string"
+                        },
                         "updatedOn": {
                           "format": "date-time",
                           "type": "string"
@@ -2037,7 +2073,7 @@ fn test_security_app() {
                           "type": "string"
                         }
                       },
-                      "required":["class", "name"]
+                      "required":["birthday", "class", "name"]
                     }
                   },
                   "paths": {