Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. def create_doc(doc: Dict[str, Any], HYDRUS_SERVER_URL: str = None,
  2.                API_NAME: str = None) -> HydraDoc:
  3.     """Create the HydraDoc object from the API Documentation.
  4.  
  5.    Raises:
  6.        SyntaxError: If the `doc` doesn't have an entry for `@id` key.
  7.        SyntaxError: If the `@id` key of the `doc` is not of
  8.            the form : '[protocol] :// [base url] / [entrypoint] / vocab'
  9.  
  10.    """
  11.     # Check @id
  12.     try:
  13.         id_ = doc["@id"]
  14.     except KeyError:
  15.         raise SyntaxError("The API Documentation must have [@id]")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement