Add some doc comments
This commit is contained in:
parent
7914593d89
commit
d99a96fc8a
4 changed files with 22 additions and 11 deletions
|
@ -6,12 +6,11 @@ use crate::JsonSchema;
|
|||
// Helper for generating schemas for flattened `Option` fields.
|
||||
pub fn json_schema_for_flatten<T: ?Sized + JsonSchema>(
|
||||
gen: &mut SchemaGenerator,
|
||||
required: Option<bool>,
|
||||
required: bool,
|
||||
) -> Schema {
|
||||
let mut schema = T::_schemars_private_non_optional_json_schema(gen);
|
||||
|
||||
let required = required.unwrap_or_else(|| !T::_schemars_private_is_option());
|
||||
if !required {
|
||||
if T::_schemars_private_is_option() && !required {
|
||||
if let Schema::Object(SchemaObject {
|
||||
object: Some(ref mut object_validation),
|
||||
..
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue