datanator_rest_api.spec package¶
Submodules¶
datanator_rest_api.spec.SpecUtils module¶
Datanator API Utils
- Author
Bilal Shaikh <bilalshaikh42@gmail.com>
- Date
2019-08-16
- Copyright
2019, Karr Lab
- License
MIT
-
class
datanator_rest_api.spec.SpecUtils.
SpecUtils
[source]¶ Bases:
object
-
static
parseAPI
(api_dir: str = './datanator_rest_api/spec/', src_file: str = 'root.yaml')[source]¶ - Takes the root open api yaml file and resolves the embedded refrences for local and remote yaml files.
Generates a complete JSON specification of the API
- Parameters
api_dir (str) – The directory storing the api definition
src_file (str) – The name of the root api file
- Returns
A string containing the parsed API
- Return type
str
-
static
validateAPI
(res_api: str)[source]¶ Opens the API specification and validates against the open api schema
- Parameters
res_api (str) – A string containing the resolved API definition
- Raises
OpenAPIValidationError – The provided specification is invalid
ExtraParametersError – A required paramter has no corresponding properties description
ParameterDuplicateError – A parameter has been included more than once in the definition
UnresolvableParamaterError –
-
static
Module contents¶
API init
- Author
Bilal Shaikh <bilalshaikh42@gmail.com>
- Date
2019-08-16
- Copyright
2019, Karr Lab
- License
MIT