Fatal1ty / mashumaro

Fast and well tested serialization library
Apache License 2.0
751 stars 44 forks source link

Fix "<locals>" in generated code #186

Closed vovanbo closed 7 months ago

vovanbo commented 7 months ago

Fix #182. Another try to fix this bug with simple decoration of type_name method.

mishamsk commented 7 months ago

the reason why I didn't use decorator in #180 (which also fixes this issue + adds tests) is because decorators are a bit of magic and less explicit. They may even not work in some cases, e.g. we compile a project depending on mashumaro using Nuitka, which sometimes struggles with overly "magical" stuff.

What I didn't do in my PR is adding a schema test. Maybe it would make sense to merge the test from this PR with the change from mine?

Anyways, we need @Fatal1ty to return from vacation;-)

Fatal1ty commented 7 months ago

Anyways, we need @Fatal1ty to return from vacation;-)

I promise to get back to the business this weekend 👀

vovanbo commented 7 months ago

Is this pull request still required? #182 is fixed now as i see. When new version of mashumaro will be released?

Fatal1ty commented 7 months ago

Is this pull request still required? #182 is fixed now as i see.

182 is fixed but it was all about serialization / deserialization. The same issue still persist in JSON Schema generation which you discovered in #181. I need more time to think through possible solutions. Probably, I'll reopen and accept #181.

As @mishamsk pointed out, it'll be worth merging the tests from here, I'll do it after.

When new version of mashumaro will be released?

Right after getting this and #187 done if nothing new comes up :)

Fatal1ty commented 7 months ago

The fix for discriminators was easy to implement #189. I believe local types are now fully supported.