-
Notifications
You must be signed in to change notification settings - Fork 18
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
Remove dependency of class collection #45
Remove dependency of class collection #45
Conversation
samples/doc_writer_sample_output.py
Outdated
@@ -276,7 +288,7 @@ | |||
}, | |||
{ | |||
"@type": "SupportedProperty", | |||
"property": "vocab:anotherSingleClass", | |||
"property": "https://hydrus.com/api/anotherSingleClass", |
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's fine to expand this here because this is for doc_writer, but make sure that we are able to change this when we parse the same document with doc_maker and we change the URI and API name in that. Not sure how you can ensure that. I would suggest not giving outputs in expanded form, and instead use expanded forms only internally in python.
* Give user option to chose the location of the apidoc * Make sure identifiers are inside the apidoc namespace
ac3cf33
to
90c374d
Compare
@chrizandr I have made required changes. Please take a look. |
* add collections array to the entrypoint * add default manages block * allow configurable collection names * fix tests and pep8 format * add entrypoint property to the apidoc * add example of manages block in sample * fix id literal * fix id literal and generate sample doc * Add support for POST and DELETE on collection classes (#46) * Add support for POST and DELETE on collection classes As the collection will now be treated as a resource, we need to add support for POST and DELETE on collection/:uuid endpoint * Default readable and writable attributes of member property to True * Fix PEP8 errors * Discover collections in doc_maker.py (#41) * remove hardcoding of Collection keyword Remove hardcoding of "Collection" keyword for checking if a class is a collection. Check either using 'collection' property defined in 'EntryPoint' or 'manages' property defined in that class * Fix tests Use get_endpoint_and_path function instead of class_in_endpoint or collection_in_endpoint as they are changed to get_endpoint_and_path function * Remove dependency of class collection (#45) * add method for adding HydraCollection * Remove dependency of collection on classes 🎉 * Remove unnecessary comments * add missing context * Bring class uris to the apidoc url namespace * Give user option to chose the location of the apidoc * Make sure identifiers are inside the apidoc namespace * fix ids of supported Operations * Expansion of JSONLD and parsing of API DOC (#42) * [WIP] expand jsonld and use hydra namespace * Extract endpoint classes and collections * add comments * Store Link ids in the endpoints. * make HydraClass for classes endpoints * finish parsing of expanded apidoc 🎉 * Write new tests * resolve conflicts, make minor changes * add ids for base classes, * Add Docs (#47) * add docs with sphinx * add readthedocs yml and requirements.txt * change version * change sys.path * Bug Fixes (#48) * Add the namespace test and fix test due to adding of new manages block * Add base classes just once * place instantation at the right place * Case sensitive URLs * fix tests * avoid rewriting of the collections array * Parse HydraLinks in context * entrypoint uri correct Co-authored-by: Priyanshu Nayan <priyanshunayan456@gmail.com> Co-authored-by: Samesh Lakhotia <43701530+sameshl@users.noreply.github.com>
Fixes #44
Checklist
Description
This PR removes the dependency of collections on classes. Earlier, one had to use
add_supported_class(classname, collection=True)
Now the writers have flexibility to tweak collections as per their preferences. They can create collections and then add to HydraDoc via
apidoc.add_supported_collection(collection_name)
In other words, now there is no forced dependency of classes on collection
Change logs
_:singleclass_retrieve
. Replaced them with proper URIs.