HTTP-APIs / hydra-python-core

This library provides the core functions to implement Hydra Official Specification in Python
MIT License
14 stars 19 forks source link

Adding "ExportHydradoc" method to doc_writer class #69

Closed Purvanshsingh closed 3 years ago

Purvanshsingh commented 3 years ago

I'm submitting a

Current Behaviour:

Currently, we have to explicitly write the code for Saving the HydraDoc Object to a file, for later use.

Expected Behaviour:

We can have a method inside the doc_writer class named ExportHydradoc() which will save the HydraDoc object to the api_doc_output.py file.

Steps to reproduce:

Do you want to work on this issue?

yes

chrizandr commented 3 years ago

There is already a generate function to export doc into a python dictionary. It's not a good idea to save docs as python files. The correct way would be to serialize the dictionary into json and save. Which would then be loaded into a python dictionary elsewhere. This requires no additional functions in core to do.

Purvanshsingh commented 3 years ago

Yes, got your point but where can we add the method to store doc into JSON, Because for the doc_maker we need to store and load it.

chrizandr commented 3 years ago

That's not within the scope of the core library. It's upto the user to decide how to serialize the dictionary. They may use json, yaml, pickle anything. We provide a python dictionary.

Purvanshsingh commented 3 years ago

Okay. Closing the Issue.