-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix/openapi endpoints #361
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #361 +/- ##
===========================================
+ Coverage 92.93% 93.03% +0.09%
===========================================
Files 32 32
Lines 1373 1363 -10
===========================================
- Hits 1276 1268 -8
+ Misses 97 95 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eimrek thanks. It looks all good to me.
Hi @CasperWA, since this is not a big PR and a quick fix of things that bring issues to materials cloud page. I will do the merge without your approval, hope you don't mind. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eimrek make a test on materials cloud and still not working.
Important to use Everything works well on materialscloud, if
|
APP = FastAPI( | ||
root_path=CONFIG.root_path, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'd remove this it should read from CONFIG
or we also explicitly set base_url
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing root_path
didn't work. So i added also base_url
to be consistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is tested and works fine on Materials cloud
Currently the endpoints
are not available on materialscloud. See e.g. https://aiida.materialscloud.org/optimade-sample/optimade/v1/extensions/docs
(but they are listed on https://aiida.materialscloud.org/optimade-sample/optimade/v1/info)
On localhost, they are available.
The problem seems to stem from here:
aiida-optimade/aiida_optimade/main.py
Lines 78 to 80 in b48cb39
Comparing with similar code in optimade-python-tools
https://github.com/Materials-Consortia/optimade-python-tools/blob/281ca780881d9529d7d247e5075eddf08152a362/optimade/server/main.py#L57-L59
they don't add the full path to the corresponding arguments.
I changed the code to be similar as optimade-python-tools and now everything seems to work. I removed the
get_custom_base_url_path()
function for maintainability, as it remains unused now.