Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] explain rest api url schema design #143

Closed
LeiYangGH opened this issue Aug 2, 2024 · 3 comments
Closed

[docs] explain rest api url schema design #143

LeiYangGH opened this issue Aug 2, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@LeiYangGH
Copy link

LeiYangGH commented Aug 2, 2024

I tried both fastapi-crudrouter and fastcrud, and yes, fastcrud is actively maintained and support latest libraries versions, thank you!

but comparing the auto generated(default) api urls, I'm wondering why fastcrud not reuse the original fastapi-crudrouter api schema.

for example,

get all:

  • fastapi-crudrouter
    model

  • fastcrud
    model/get_multi

create

  • fastapi-crudrouter
    model

  • fastcrud
    model/create

though url patterns can be customized, personally I think fastapi-crudrouter is more elegant(at least it requires less typing ^_^).

So could you add document section on the design thoughts?

@LeiYangGH LeiYangGH added the enhancement New feature or request label Aug 2, 2024
@igorbenav
Copy link
Owner

Hey, @LeiYangGH, tbh I didn't know about fastapi-crudrouter until after I had almost released fastcrud, so it didn't inspire my design decisisons.

Since the EndpointCreator was - for me - a natural evolution of the FastCRUD class, I used the same urls for the endpoints as I used for the methods names.

Indeed I think the way fastapi-crudrouter does it is better, which is why @JakNowy fixed this here, for now we added a warning, but in 0.15 it will become the standard way.

You can see the warning in the docs here or when you don't pass endpoint names when using crud_router or EndpointCreator.

Thanks for the question!

@igorbenav
Copy link
Owner

(The warning in the docs)

Screenshot_20240802_120527_Chrome

@LeiYangGH
Copy link
Author

thanks! in fact i got to know fastcrud by your comments at fastapi-crudrouter. but i'm glad your version is actively maintained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants