3 ms·
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
by tank-34 11mo ago
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.
- Noumenon72 11mo agoWhat are the files like router.sample_1.schema? Is that a convention you use for your Pydantic models or something generated by OpenApi?
- tank-34 11mo agohttps://github.com/allmonday/composition-oriented-development-pattern/blob/master/src/router/sample_1/router.py https://github.com/allmonday/composition-oriented-developmen... those are clusters based on modules, you can swith off by toggle 'show module cluster'
- Noumenon72 11mo agoSo 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.
- nine_k 11mo agoWhile at it, what do you use to parse / validate / cast request data into nice typechecked objects?
- tank-34 11mo agothe return value in resolve/post method will be automatically validated by the pydantic class defined in field annotation.
- tank-34 11mo agoit'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'.
- tank-34 11mo agoto 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: ....