-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fasta API as a microservice #630
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
It appears that the target URL needs to be URL-encoded, or a 404 results. Could support for non-URL-encoded URLs be retained, to enhance usability (e.g., make URLs easier to copy/paste, and verify by visual inspection)? Otherwise, few places ALLOWED_HOSTS should be updated to change www.soybase.org/data/v2/ to data.soybase.org/ |
@nathanweeks regarding the URL encoding, @ctcncgr had asked me about this a while back and I opined that we ought to stick to URL standards (ie not allowing non-allowed characters without encoding); as I understood it, this had to do with URLs passed as query string parameters. But I'm not sure I entirely understand the use cases or what would be involved in bending the rules, so I'm open to further discussion about it if you have strong opinions. |
It's mainly about user experience: try starting fasta_api and submitting requests using a few different target URLs/filesystem paths. Having to translate those URLs/paths with a software layer (or by hand) when constructing the complete fasta_api URL-path is a noticeable speed bump. There are no query parameters per se, as there is no |
OK, sounds like I misunderstood what was being described when I gave @ctcncgr my opinion. Maybe he can elaborate on what he was having issues with. |
@nathanweeks @adf-ncgr Initially I really didn't like including things like colon and slash in any of this. I kind of think the query should be broken into something more like param1/param2/param3 (removing things like "-" and ":"), since all are required, encoded as URL parameters instead of parts of a dynamic URL, or sent as part of a POST request. I am however not willing to die on any of these hills and was asked to maintain the original behavior, so will change it to support this np (I think). I also asked the GPT if it was valid in the URI, which it was OK with, HOWEVER, when I asked it how best to use URLs as part of a URI it recommended that I encode it... Which was kinda funny lol. |
Changed to "Draft" after review. The following needs to be addressed:
|
@nathanweeks @adf-ncgr Technically, paths in dynamic URL paths is against OAS as commented on from FastAPI. From, https://fastapi.tiangolo.com/tutorial/path-params/#openapi-support, "OpenAPI doesn't support a way to declare a path parameter to contain a path inside, as that could lead to scenarios that are difficult to test and define. Nevertheless, you can still do it in FastAPI, using one of the internal tools from Starlette." I am going to settle on using url as a query parameter instead of as part of a dynamic path parameter to not violate OAS:
This allows you to put an unencoded path value into the request without violating OAS. |
sounds like a good solution to me, let us know your thoughts @nathanweeks |
That works OK for me! |
@nathanweeks awesome, thanks for being flexible with this. I'll get this done rq and remove the draft status. It should then prompt for review again. |
…ndler.py to handle new status codes #630
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
hey @nathanweeks and @alancleary. This is ready to go. I removed the dependency on fastapi completely, so it just uses our uvloop setup. Things should work now as discussed. Thanks! |
A few initial observations: README.md
Regarding the implementation:
Stack trace:
|
For consistencies sake, @nathanweeks do you think it would make more sense to just include all of the parameters as url parameters as opposed to part of a dynamic URL? |
I would prefer maintaining the current URL path convention, instead of a single endpoint ("/") with required URL parameters. While seemingly less-"flexible", I think it's easier to document, more-predictable/readable, and simpler to use interactively. |
Gotcha, let me fix the issues and I'll get back to you soon. |
@nathanweeks I think were good to go. Let me know if you run into more issues or have additional comments. Thanks |
Thanks! Still seeing an error with this request (that doesn't involve a range):
stack trace from the backend process:
|
For #629