Skip to content

Commit

Permalink
Merge branch 'master' into top-level-serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Fatal1ty committed Nov 14, 2023
2 parents 754028b + b7d6435 commit 0fd4c6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1600,7 +1600,7 @@ By default, all collection data types are serialized as a copy to prevent
mutation of the original collection. As an example, if a dataclass contains
a field of type `list[str]`, then it will be serialized as a copy of the
original list, so you can safely mutate it after. The downside is that copying
is always slower that using a reference to the original collection. In some
is always slower than using a reference to the original collection. In some
cases we know beforehand that mutation doesn't take place or is even desirable,
so we can benefit from avoiding unnecessary copies by setting
`no_copy_collections` to a sequence of origin collection data types.
Expand Down Expand Up @@ -2494,7 +2494,7 @@ You can build JSON Schema not only for dataclasses but also for any other
[supported](#supported-data-types) data
types. There is support for the following standards:
* [Draft 2022-12](https://json-schema.org/specification.html)
* [OpenAPI Specification 3.1.0](https://swagger.io/specification/)
* [OpenAPI Specification 3.1.0](https://spec.openapis.org/oas/v3.1.0)

### Building JSON Schema

Expand Down
4 changes: 2 additions & 2 deletions mashumaro/jsonschema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ def fields(self) -> Iterable[Tuple[str, Type, bool, Any]]:
for f_name, f_type in self._self_builder.get_field_types(
include_extras=True
).items():
f = self._self_builder.dataclass_fields.get(f_name) # type: ignore
if f and not f.init:
f = self._self_builder.dataclass_fields.get(f_name)
if not f or f and not f.init:
continue
f_default = f.default
if f_default is MISSING:
Expand Down

0 comments on commit 0fd4c6f

Please sign in to comment.