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

[1.0.0b1] Multiple endpoints for one model overrides randomly #668

Closed
lennartblom opened this issue Nov 8, 2017 · 0 comments
Closed

[1.0.0b1] Multiple endpoints for one model overrides randomly #668

lennartblom opened this issue Nov 8, 2017 · 0 comments

Comments

@lennartblom
Copy link

Currently I have the given scenario:
I have one complexe model, which I want to publish on a suitable url endpoint.This works like a charm! Thanks for that!

Given the complexity of the model and the use case that I need only one attribute of the model sometimes, I defined a new url endpoint for the retrievement of just the attribute (with help of the only=[”attribute_name"])

Route for the overall model

api_manater.create_api(
    model=entities.User,
    methods=['GET', 'POST', 'PATCH'],
    primary_key="id",
    collection_name="users",
)

Route for the one attribute only model

api_manater.create_api(
    model=entities.User,
    methods=['GET'],
    primary_key="id",
    collection_name="user_email_validations"
    only=[”email_validated"]
)

So after this the results of endpoints "localhost/api/users" and localhost/api/user_email_validations" randomly switch from either all attributes or just the defined email_validated.

Is the usage with multiple endpoints for one SQLAlchemy model not wanted? Or did I miss something?

Thank in advance and thanks for the package anyway!

@lennartblom lennartblom changed the title [1.0.0b1] Multiple endpoints for Model overrides randomly [1.0.0b1] Multiple endpoints for one model overrides randomly Nov 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant