openapi-python-client icon indicating copy to clipboard operation
openapi-python-client copied to clipboard

Add Documentation for using POST requests with client

Open danaelhe opened this issue 4 years ago • 2 comments

Describe the solution you'd like Could you provide other request examples (besides just GET) either in the repo or generated in the docs?

danaelhe avatar Apr 16 '21 15:04 danaelhe

Hi @danaelhe ! There shouldn't be any significant difference between how generated functions work. Which HTTP method is used, how the payload is serialized, where the parameters are put (path vs query), all of that should be abstracted away by the generator. Regardless of how it's working under the hood, it should be the_operations_name.sync() (or the async/_detailed variants).

I think we definitely need a full example somewhere of an OpenAPI document and the resulting generated code describing how each piece works... and I have a long-overdue issue #47 to build such a tutorial... it's just gotten buried under the pile of enhancements 😅.

Until we get that full tutorial written, is there something specific in the existing documentation that was confusing to you? Should we rename the example function in the generated README.md so it doesn't use the word "get"? I'd love to make this project easier to get started with, but won't have the bandwidth for the full tutorial for some time 😞

dbanty avatar Apr 16 '21 20:04 dbanty

Thanks for that thoughtful response! I'll try to contribute that back when I find time myself :)

It's a great tool btw! I like it more than the other generators out there.

danaelhe avatar Apr 21 '21 15:04 danaelhe