I have a query API that requires users to set the ...
# replication-troubleshooting
a
I have a query API that requires users to set the unique system ID for the query to fetch. I want to be able to allow users to generate as many streams as they want during source setup by giving each the query name (to be used as the stream name) and ID that should be fetched. How do I configure a template for this?
k
You can do this with Stream Templates in the Connector Builder by generating streams from user‑provided values at source setup (configuration‑based generation). High‑level steps: 1. Create a Stream Template. 2. Choose “Configuration-based stream generation” so the template reads items (name + ID) from the source config the user provides. [[Stream templates](https://docs.airbyte.com/platform/next/connector-development/connector-builder-ui/stream-templates)] 3. Define the user input in the connector config as an array of objects (each with query_name and query_id), then reference those values in the Generated Stream Template: - Stream Name: {{ components_values.query_name }} - URL Path (or request param/body as required by your API): use {{ components_values.query_id }} to inject the unique system ID. 4. Click Generate Streams; users can add as many entries as they want at setup, and each entry becomes a stream. Generated streams are read‑only; edit the template and re‑generate to change them. [[Stream templates](https://docs.airbyte.com/platform/next/connector-development/connector-builder-ui/stream-templates); [Step-by-step guide](https://docs.airbyte.com/platform/next/connector-development/connector-builder-ui/stream-templates#step-by-step-setup-guide---github-issues-api)] Notes: - If your API needs the ID in query params, headers, body, or path, map it accordingly; you can inject values into path or parameters using the template’s component mappings. [[Stream templates](https://docs.airbyte.com/platform/next/connector-development/connector-builder-ui/stream-templates)] - Stream Templates are available starting in 1.7. [[1.7 Stream templates](https://docs.airbyte.com/platform/1.7/connector-development/connector-builder-ui/stream-templates); [Roadmap issue](https://github.com/airbytehq/airbyte/issues/55853)]
a
@kapa.ai is this the correct syntax for creating user inputs for the stream name and stream id ? custom_queries: type: array description: Define custom query streams to sync from SKY API items: type: object required: - query_id - stream_name properties: query_id: type: integer description: The ID of the query in SKY API to execute title: Query ID stream_name: type: string description: Name for this stream in Airbyte (e.g., 'gift_query') title: Stream Name title: Custom Query Streams order: 6
k
A message from kapa.ai
Yes, that JSON Schema structure is valid for defining a config array of objects with query_id and stream_name. Make sure it’s placed under connectionSpecification.properties in your spec and use titles/descriptions per UX guidance. [[Connector spec](https://docs.airbyte.com/platform/1.6/connector-development/connector-specification-reference); [UX handbook](https://docs.airbyte.com/platform/connector-development/ux-handbook#input-configuration)] Example in context:
Copy code
connectionSpecification:   $schema: http://json-schema.org/draft-07/schema#   type: object   required: []   properties:     custom_queries:       type: array       title: Custom Query Streams       description: Define custom query streams to sync from SKY API       order: 6       items:         type: object         required:           - query_id           - stream_name         properties:           query_id:             type: integer             title: Query ID             description: The ID of the query in SKY API to execute           stream_name:             type: string             title: Stream Name             description: Name for this stream in Airbyte (e.g., 'gift_query')
If you later want to use these values to generate multiple streams (one per entry), configure partitioning or stream templates in the Builder to reference config values like {{ config['custom_queries'] }}. [[Partitioning](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/partitioning#dynamic-and-static-partitioning)]
a
I got that working. @kapa.ai I'm trying to do dynamic schema loader for async retriever... I'm getting the error '"Encountered an error while discovering streams. Error: ModelToComponentFactory.create_async_retriever() missing 1 required keyword-only argument: 'stream_slicer'"' ... what's the right piece that I need here, even if I don't need or want to slice
k
A message from kapa.ai
You’re seeing that error because AsyncRetriever requires a stream_slicer parameter in its schema, even if you don’t intend to slice. In other words, ModelToComponentFactory.create_async_retriever expects stream_slicer to be provided. The docs list AsyncRetriever’s properties but don’t explicitly mark stream_slicer as optional; in the retriever schema overview, the retriever includes a stream_slicer field. [[AsyncRetriever (1.7)](https://docs.airbyte.com/platform/1.7/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/AsyncRetriever); [Data retriever overview (1.7)](https://docs.airbyte.com/platform/1.7/connector-development/config-based/understanding-the-yaml-file/yaml-overview#data-retriever)] What to do: - Add a no-op stream slicer to your AsyncRetriever configuration. If your API doesn’t need slicing, provide a single-slice configuration (i.e., one slice for the whole stream). The documentation doesn’t provide a concrete “no-op” slicer example, but the schema requires the stream_slicer field, so you must define one to satisfy the interface. [[AsyncRetriever (1.7)](https://docs.airbyte.com/platform/1.7/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/AsyncRetriever); [Data retriever overview (1.7)](https://docs.airbyte.com/platform/1.7/connector-development/config-based/understanding-the-yaml-file/yaml-overview#data-retriever)] About DynamicSchemaLoader: - DynamicSchemaLoader supports using an AsyncRetriever for discovery-time schema inference, but you still need to supply a valid retriever (including its required fields like stream_slicer). [[DynamicSchemaLoader (1.7)](https://docs.airbyte.com/platform/1.7/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/DynamicSchemaLoader)] Limitations: - The knowledge sources don’t include an explicit “no-slicing” example or a named built-in “no-op” slicer component. If you need a concrete snippet, please share your current YAML and I can suggest how to add a minimal stream_slicer block consistent with your setup, but I can’t quote a ready-made component from the docs provided.