dylan
04/18/2024, 1:58 PM$ref
keyword? If it does, are there any examples I can look at? I'm working on extracting data from an endpoint where parts of the structure is super specific but also repeated everywhere, so being able to reference a single definition of that structure would really be helpful. I've tried defining references in a couple of different ways but I always end up with an empty object when I invoke the tap catalog discovery. Any help or insight is appreciated! 🙏Edgar Ramírez (Arch.dev)
04/18/2024, 9:30 PMth.PropertiesList
and similar schema helpers to programmatically construct your schemas. That way you have all the language features available to reuse code.
That said, if you still prefer using JSON schema files and $ref
, there's a (currently undocumented 🫤) resolve_schema_references
function in singer_sdk._singerlib
. Some usage examples live as tests in the repo: https://github.com/meltano/sdk/blob/main/tests/_singerlib/test_schema.py#L91-L252. There are also examples on my GitHub, mostly for taps with OpenAPI specs: https://github.com/search?q=owner%3Aedgarrmondragon%20resolve_schema_references&type=code.
Let me know if that works for you!dylan
04/20/2024, 3:03 AMresolve_schema_references
function is exactly what I was looking for! Thank you! 🎉
Good point about using the sdk schema helpers! These schema files are already generated for another service we use though, so just reusing them here becomes super convenient 😄