HTTP-APIs / hydra-openapi-parser

OpenAPI to Hydra parser
MIT License
9 stars 9 forks source link

CLI Design for OpenAPI parser #17

Open de-sh opened 5 years ago

de-sh commented 5 years ago

I'm submitting a

Current Behaviour:

Currently the openapi-parser library is imported as a python package and that is about all the facilities it provides a user. A CLI would allow for a user to utilise this as a standalone app for purposes that might be divergent from what this was originally meant to be.

Expected Behaviour:

The CLI should allow for the user to use the command hydra-openapi-parser to generate a hydraDoc. This could be as simple as:

hydra-openapi-parser parse --openapi-doc-input api_doc.yaml --hydradoc-output hydra_doc.jsonld

Do you want to work on this issue?

Yes, but I would need help with designing the CLI

Guttz commented 5 years ago

hydra-openapi-parser parse --openapi-doc-input api_doc.yaml --hydradoc-output hydra_doc.jsonld

Setting a default for output file name would good, so it's not a mandatory param. Also short alternatives like "-i" for --openapi-doc-input and "-o" for --hydradoc-output would be handy.

de-sh commented 5 years ago

Please take a look at https://github.com/de-sh/hydra-openapi-parser/tree/cli

Also short alternatives like "-i" for --openapi-doc-input and "-o" for --hydradoc-output would be handy.

I think we can make use of simple CLI arguments for that. I also learned that in hydrus, hydrus run == hydrus serve almost anything after hydrus will still run the server, but there must be something...

I'll make a PR if we can solve the issue with CLI...

Guttz commented 5 years ago

I liked the smaller parameters, looks like it has the basic func. I find summing this up important for us to close https://github.com/HTTP-APIs/hydra-openapi-parser/issues/13, so we can add to the readme something like:

hydra-openapi-parser parse --apidoc samples/petstore_openapi.yaml --hydradoc hydra_doc_sample.py

Guess we need it to link with the package adding "entry_points" at the setup.py so we can use it as hydra-openapi-parser and have some documentation to use it.

Mec-iS commented 5 years ago

18 merged