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

adapter.http: implement the attachment routes #33

Merged
merged 4 commits into from
Apr 5, 2024

Conversation

Frosty2500
Copy link
Collaborator

No description provided.

Copy link

@jkhsjdhjs jkhsjdhjs left a comment

Choose a reason for hiding this comment

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

Most of my comments are just "use get_response_type()", so it should be easily implemented. While Response() it the correct type to use when returning values of Blob elements with the appropriate content_type, get_response_type() should be used in all other cases, as it automatically determines whether the client prefers a JSON or an XML response (e.g. for error messages).

Furthermore, you should use the "Return Early" pattern whenever possible. As already stated in several comments, I think the attachment routes shouldn't support File objects for now, at least not with unsanitized paths.

basyx/aas/adapter/http.py Outdated Show resolved Hide resolved
basyx/aas/adapter/http.py Outdated Show resolved Hide resolved
basyx/aas/adapter/http.py Outdated Show resolved Hide resolved
basyx/aas/adapter/http.py Outdated Show resolved Hide resolved
basyx/aas/adapter/http.py Outdated Show resolved Hide resolved
basyx/aas/adapter/http.py Outdated Show resolved Hide resolved
basyx/aas/adapter/http.py Outdated Show resolved Hide resolved
basyx/aas/adapter/http.py Outdated Show resolved Hide resolved
basyx/aas/adapter/http.py Outdated Show resolved Hide resolved
Copy link

@jkhsjdhjs jkhsjdhjs left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@jkhsjdhjs jkhsjdhjs merged commit 10f3301 into feature/http_api Apr 5, 2024
11 of 14 checks passed
@jkhsjdhjs jkhsjdhjs deleted the http_api/implement_attachment_routes branch April 5, 2024 12:59
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.

2 participants