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

Discover collections in doc_maker.py #41

Merged
merged 2 commits into from
Jul 31, 2020

Conversation

sameshl
Copy link
Member

@sameshl sameshl commented Jul 9, 2020

Related to #39

Checklist

  • My branch is up-to-date with upstream/develop branch.
  • Everything works and tested for Python 3.5.2 and above.

Description

The doc_maker now does not depend on hardcoded "Collection" keyword to identify if a given class dict is a class or a collection.
It finds all collections in two ways:

  • if all the collections are defined in collection property in the EntryPoint of the given Hydra API
  • if the given class dict has a manages block(property).

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
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
Copy link
Member

@chrizandr chrizandr left a comment

Choose a reason for hiding this comment

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

Looks good to me

@chrizandr chrizandr merged commit 104bf96 into HTTP-APIs:develop Jul 31, 2020
chrizandr added a commit that referenced this pull request Aug 11, 2020
* 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>
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.

None yet

2 participants