Just thinking out loud here, but I’m wondering if ...
# plugins-general
a
Just thinking out loud here, but I’m wondering if it’d be feasible to create a conversion tool to generate singer specs from OpenAPI/Swagger specs. (possibly even utilizing/abusing the OpenAPI codegen). Could be a nice way to streamline API singer specs.
a
That’s a cool idea!
This isn’t the same thing but there's some useful stuff in https://github.com/singer-io/singer-tools
Specifically the singer-infer-schema tool to generate a schema based on the output of the tap. I’ve also started trying out https://github.com/anelendata/tap-rest-api which has an —infer_schema option
a
Oh right, these are great.
It looks like it wouldn’t be all that much work to use one of these as a starting point to read an OpenAPI spec
Maybe I’ll give that a shot as a weekend project.
n
I was actually talking to @douwe_maan about that last week. I can't figure out if it would be better to have a tap that reads the openapi spec, or a java powered codegen to have the swagger tools build a well written tap off of a spec
a
Yep, I was thinking the same thing.
n
I finally made an issue to start collecting thoughts from the community on this possibility here https://gitlab.com/meltano/meltano/-/issues/2333
a
I can see pros and cons to both. • an openapi spec reader should stay up to date with a changing API spec, but that might also not be a good thing if radical changes break your ingest. • a codegen approach is useful to create more purpose built taps/targets, but then you have the issue of the taps/targets going stale if the spec changes. (of course with a proper REST API, that shouldn’t be a problem)
n
A spec reader tap could work well though if the user is supplying the spec each run. But does doing that coincide with the singer spec? I don't remember if it dictates tap inputs or not
d
@nevin_morgan Are you suggesting passing the spec over stdin? Why not just use a key in
config.json
?
n
not over stdin, but yeah a config.json key would work if a generic tap that understands the spec is built out
I don't really know how that sort of tap would handle authentication env vars