vitalik / django-ninja

💨 Fast, Async-ready, Openapi, type hints based framework for building APIs
https://django-ninja.dev
MIT License
7.03k stars 421 forks source link

Inconsistent Documentation Regarding Resolver #1264

Open leench opened 1 month ago

leench commented 1 month ago

I noticed in the Defining a Schema that it mentions using regular methods for resolvers. However, during testing, I encountered an error: NotImplementedError: Non static resolves are not supported yet.

Additionally, I found in the What's new in V1 section that it states: resolve_xxx(self, ...) - support resolve with (self) is dropped in favor of pydantic build-in functionality

Does this mean the old resolver method is no longer supported? If so, does the documentation need updating to reflect this change?

MisaoDev commented 2 weeks ago

It looked like a cool feature. I figure they might have dropped it in favor of using the context object? (Not sure if you can get the other attributes from it)

But the main thing for me is.. it could save you from adding @staticmethod to every resolver 😅 That's 1 less line every time.

jleclanche commented 5 days ago

The documentation is def a bit lackluster - it says dropped in favour of built-in functionality but doesn't say which / link to documentation.