News for hackers. Stuff that matters.
Re:Visualize FastAPI endpoints with FastAPI-Voyager by brulard on Sunday November 09, 2025 @07:51AM (#45865201)
I would appreciate some quick info what this is all about. Clicking on link presents me with a huge diagram i know nothing about. What am I looking at?
Re:Visualize FastAPI endpoints with FastAPI-Voyager by tank-34 on Sunday November 09, 2025 @07:55AM (#45865236)
this project is inspired by https://apis.guru/graphql-voyager/, which visualize the entity relationships based on graphviz and add fancy ui effects.

fastapi-voyager, from left to right, is tag, routes(apis) and response_models, it indicates the internal relationship between routes, which can help developers/PO easily figure out the data structure.

Re:Visualize FastAPI endpoints with FastAPI-Voyager by agumonkey on Sunday November 09, 2025 @08:10AM (#45865335)
Pretty nice
Re:Visualize FastAPI endpoints with FastAPI-Voyager by tonyhart7 on Sunday November 09, 2025 @08:07AM (#45865313)
ok, how is this better than OpenAPI schema???
Re:Visualize FastAPI endpoints with FastAPI-Voyager by tank-34 on Sunday November 09, 2025 @08:10AM (#45865336)
in swagger, from the definition of schema you are not able to easily figure out the related class, the name is marked as <object> or array<object>

in voyager their relationships are visualized and very close to the source code.

Re:Visualize FastAPI endpoints with FastAPI-Voyager by Noumenon72 on Sunday November 09, 2025 @11:40AM (#45866821)
What are the files like router.sample_1.schema? Is that a convention you use for your Pydantic models or something generated by OpenApi?
Re:Visualize FastAPI endpoints with FastAPI-Voyager by tank-34 on Sunday November 09, 2025 @05:02PM (#45869642)
https://github.com/allmonday/composition-oriented-developmen...

those are clusters based on modules, you can swith off by toggle 'show module cluster'

Re:Visualize FastAPI endpoints with FastAPI-Voyager by Noumenon72 on Sunday November 09, 2025 @07:12PM (#45870670)
So this isn't really "visualize FastAPI endpoints", it's "visualize the inheritance cascade caused by using the pydantic-resolve approach to data fetching/transformation, which involves adding post-hooks to compositions of Pydantic objects". A vanilla FastAPI user like myself is going to have trouble understanding it without realizing how tied it is to that framework.
Re:Visualize FastAPI endpoints with FastAPI-Voyager by nine_k on Sunday November 09, 2025 @08:00PM (#45870983)
While at it, what do you use to parse / validate / cast request data into nice typechecked objects?
Re:Visualize FastAPI endpoints with FastAPI-Voyager by tank-34 on Tuesday November 11, 2025 @01:06AM (#45884554)
the return value in resolve/post method will be automatically validated by the pydantic class defined in field annotation.
Re:Visualize FastAPI endpoints with FastAPI-Voyager by tank-34 on Sunday November 09, 2025 @08:09PM (#45871027)
it's not bound with pydantic-resolve, for vanilla fastapi user if the business model are well designed and composed, it can benefited from this visualization approach too.

the goal is to make the dependencies clear for developers, and figure out the potential impacts from one node to others.

pydantic-resolve is just another my project to make the process of data composition close to ER model and get rid of glue codes like 'for loops'.

Re:Visualize FastAPI endpoints with FastAPI-Voyager by tank-34 on Tuesday November 11, 2025 @01:14AM (#45884587)
to better describe the relationship, it borrows the concept 'subset' from pydantic-resolve, which act like pick several fields from original class but you can still reference to it.

@subset(User) class PickedUser: ....

Re:Visualize FastAPI endpoints with FastAPI-Voyager by tracker1 on Monday November 10, 2025 @10:43AM (#45877002)
This seems to show much deeper into the backend... OpenAPI really only shows the API surface as kind of a black box for external usage... this seems to be to aid diagnostics and understanding of internal calls and relationships.
Re:Visualize FastAPI endpoints with FastAPI-Voyager by tank-34 on Tuesday November 11, 2025 @01:09AM (#45884567)
you are right, in fact the most valuable part in our backend is 'business mode/logic', with voyager we can have a new choice to better understand them.