Open schloerke opened 4 years ago
Hello, just curious as to if/where you're tracking progress on the second task above (i.e., "produce a stub plumber file given the open api file"). Would love to see plumber
support a workflow where the OpenAPI spec is designed first, then plumber
server stubs are generated a la Swagger Codegen. Many thanks!
cc @blairj09
@mcjudd Last time I looked at the Swagger Codegen, they were producing functions via R6.
Integrating with Swagger Codegen would introduce a very external dependency. I am hoping we will be able to produce this within plumber with native R.
A reverse parseBlock? I'll think about it while generalizing lines parsing. So each block (endpoint) has a from and to open api definition. What I am afraid is that plumber does not fully support openapi entire definition. You would obviously lose some details if you used unsupported tags. Also types are not quite the same.
I agree it should be done internally. Now comes the hardest part. Pick a function name
I kind of like jsonlite naming.
fromOpenAPI({openapi.json})
toOpenAPI({router})
@meztez fromOpenAPI
and toOpenAPI
sound great to me!
Goal:
If we can loop back between steps 3 and 4, I'd call it a success
@blairj09 I'm stuck on this one trying to dereference input OpenApi specification. https://swagger.io/docs/specification/using-ref/. Is it something you have tackled before?
I'm not sure this should be a problem solved by plumber as it a more general feature.
cc @krlmlr
Related: https://github.com/rstudio/plumber/issues/354