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

Proposal to rename params with path_params #457

Closed
sansyrox opened this issue Apr 1, 2023 · 2 comments · Fixed by #460
Closed

Proposal to rename params with path_params #457

sansyrox opened this issue Apr 1, 2023 · 2 comments · Fixed by #460

Comments

@sansyrox
Copy link
Member

sansyrox commented Apr 1, 2023

Imo, params don't really indicate anything meaningful. We should be referring them as path_params and being more explicit

@carlosm27
Copy link
Contributor

I was trying to change the params in the Request class:

@dataclass
class Request:
    queries: dict[str, str]
    headers: dict[str, str]
    path_params: dict[str, str]
    body: Union[str, bytes]
    method: str
    url: Url

And change the functions in base_routes.py to test the changes:

@app.get("/sync/param/:id")
def sync_param(request: Request):
    id = request.path_params["id"]
    return id



But when I ran base_routes.py a go to /sync/param/:id I receive this message: ERROR:robyn.server:Error while executing route function: AttributeError: 'builtins.Request' object has no attribute 'path_params' and Internal Server Error message.

@sansyrox
Copy link
Member Author

sansyrox commented Apr 3, 2023

@carlosm27 , only changing params in python will not be sufficient. You will also need to rename the code in rust here - https://github.com/sansyrox/robyn/search?q=params

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

Successfully merging a pull request may close this issue.

2 participants