Skip to content

63 update template response#64

Open
jsjiang wants to merge 2 commits into
mainfrom
63_update_TemplateResponse
Open

63 update template response#64
jsjiang wants to merge 2 commits into
mainfrom
63_update_TemplateResponse

Conversation

@jsjiang

@jsjiang jsjiang commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

@datadavev @sfisher
This is to update TemplateResponse to use newer version signature and syntax introduced by FastAPI/Starlette upgrade. Resolver is on FastAPI v0.138.0 and Starlette 1.3.1 now.

From Fastapi:

Before FastAPI 0.108.0, Starlette 0.29.0, the name was the first parameter.

Also, before that, in previous versions, the request object was passed as part of the key-value pairs in the context for Jinja2.

A test case test_root_template_response is added with basic functional tests. This test triggered templateResponse related TypeError: unhashable type: 'dict' with current code.

Please review and let me now if you have questions.

Thank you

Jing

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the root (/) template rendering to match the newer Jinja2Templates.TemplateResponse call signature used by the current FastAPI/Starlette versions, and adds a basic regression test to ensure the HTML template response works.

Changes:

  • Update TemplateResponse invocation to the newer keyword-based signature (request=..., name=...).
  • Add test_root_template_response to validate GET / returns HTML and HTTP 200.
  • Bump project version to 0.11.5 and update uv.lock accordingly.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
rslv/app.py Updates the TemplateResponse call to the newer FastAPI/Starlette templating signature.
tests/test_service.py Adds a regression test asserting / returns an HTML response successfully.
pyproject.toml Bumps project version to 0.11.5.
uv.lock Updates lockfile to reflect the new version and regenerated wheel entries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sfisher sfisher left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems good to me. Thanks for adding the test and fixing this.

I don't know this service well, but was able to update with uv and run tests successfully.

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 this pull request may close these issues.

3 participants