Introducing hrefs: hyperlinks for pydantic models #4198
jasujm
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introducing hrefs: hyperlinks for pydantic models
Shamelessly promoting a project I started recently (let me know if it's inappropriate!), but I really think this might interest some FastAPI users.
I love FastAPI. And I want to write APIs where relationships between models are represented with URLs. That's why I found myself writing lots of
request.url_for()
calls over and over again, and wanted to start doing that in a more declarative fashion.So I started writing a generic solution: hrefs. With the library I can write something like:
It's still in early stages, and missing many features (right now the way to set up the hyperlinkable models isn't very flexible). Would love to hear your thoughts, and get some feedback.
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions