Closed vrutik2809 closed 2 years ago
please check if the same declaration is present in other parts of the codebase
insert_classes
in doc_parse.py
module (line: 60)insert_properties
in doc_parse.py
module (line: 61)Need to remove those lines
you should provide the changes to fix those then. Are those methods unused or they changed names? Check hydra-python-core
repository also.
Those methods have been removed from hydrus/data/doc_parse.py
so demo.py
should be updated.
@farazkhanfk7 do you know what we use now in place of insert_classes
to generate the class objects?
In hydrus/data/db_models.py
, there is a Resource class which is used to create a Class or Collection. It has a function make_db_table
, which is called by another function create_database_tables
to insert classes in the database.
https://github.com/HTTP-APIs/hydrus/blob/c6a8587c7904afe64c31f74da1f9d4edc7139ed2/hydrus/data/db_models.py#L217-L220
Unavailable method removed from demo.py
file
ok. but now the demo should work by using the new methods.
@vrutik2809 you can take a look at app.py
for reference and also make sure that hydrus server is working fine after running demo.py
.
While running demo.py
, it is running two times:
First, when I run demo.py
it's running on http://localhost:8080/api
without going in the if
block
Second when I hit Ctrl + c
(in order to stop the server) then it actually goes into the if
block and starts running on http://localhost:8080/serverapi
but it shows 404 not found
I'm not able to figure out why it is happening.
While debugging it, I also observed that even if pass a different port
or api-name
it still listen to base-url & api-name
provided while making documentation using doc.writer.HydraDoc()
. It can be verified in the above image also. Api-name in the doc.py
(reference image attached below) is api
but in demo.py
it is passed as serverapi
then it is throwing 404
but when I fire a request on /api
then it gives me 200
snap of doc.py :
I have opened new issue (#613) regarding PORT
and API_NAME
problem.
Thanks!
Fixes #610
Checklist
Current behaviour
There is a typo in the
demo.py
file. Due to that the following error was occurring:New expected behaviour
The typo has been removed. Now it will work completely fine.
Change logs
Fixed