Skip to main content
JSON Schema files define the structure, validation, and UI rendering of FlowApp action inputs. They are compiled into your code at build time.

Schema basics

Every action requires a JSON Schema file with the same base name:

Minimal schema

Build-time schema generation

The FlowAppSchemaGenerator source generator automatically creates the GetInputSchemaJson() method:
1

Naming convention

The generator looks for a JSON file matching the action class name:
IqraGenerators/FlowAppSchemaGenerator.cs:68-72
2

Same directory requirement

The JSON file must be in the same directory as the C# file:
IqraGenerators/FlowAppSchemaGenerator.cs:83-84
3

Code generation

The generator creates a partial class method:
IqraGenerators/FlowAppSchemaGenerator.cs:102-117
If the JSON file is not found or is invalid, compilation will fail with an exception.

Field types

String fields

Number fields

Boolean fields

Enum fields

Array fields

Nested objects

Dynamic dropdowns with fetchers

Use the custom x-fetcher property to populate fields from a data fetcher:
IqraInfrastructure/Managers/FlowApp/Apps/CalCom/Actions/BookMeeting.json:38-44
The fetcher key must match a registered IFlowDataFetcher:
IqraInfrastructure/Managers/FlowApp/Apps/CalCom/Fetchers/GetEventTypesByIdFetcher.cs:15
When the UI renders this field, it calls:
The fetcher returns options:
IqraInfrastructure/Managers/FlowApp/Apps/CalCom/Fetchers/GetEventTypesByIdFetcher.cs:38-43

Context-dependent fetchers

Fetchers receive the current form state via the context parameter:
This enables dependent dropdowns:

Conditional schemas with oneOf

Use oneOf to define mutually exclusive field groups:
IqraInfrastructure/Managers/FlowApp/Apps/CalCom/Actions/BookMeeting.json:34-74
The UI presents a mode selector, showing only the relevant fields.

Handling oneOf in actions

Check which variant was provided:
IqraInfrastructure/Managers/FlowApp/Apps/CalCom/Actions/BookMeetingAction.cs:64-77

Validation

All inputs are validated at runtime before action execution:
IqraInfrastructure/Managers/FlowApp/FlowAppManager.cs:289-299

Common validation rules

Scriban template support

All string fields support Scriban templates at runtime:
Users can enter:
Which resolves before validation:
IqraInfrastructure/Managers/FlowApp/FlowAppManager.cs:274-280
Templates are resolved before schema validation, so the final rendered value must still satisfy the schema.

Schema file location requirements

The schema generator enforces strict file placement:
If the schema is not found:
IqraGenerators/FlowAppSchemaGenerator.cs:87-90

Best practices

Descriptions appear as tooltips in the UI.
Defaults reduce friction for common use cases.
Leverage built-in JSON Schema formats:
Flat schemas are easier for AI to populate:
Use nesting only when logically required.

Troubleshooting

Ensure:
  1. JSON file is in the same directory as the action class
  2. File name matches the action name (minus “Action” suffix)
  3. JSON file is included in the project with AdditionalFiles build action
Check:
  1. Schema matches the data structure your code expects
  2. Required fields are marked correctly
  3. Data types match (string vs integer, etc.)
  4. Scriban templates resolve to valid values
Verify:
  1. FetcherKey in the fetcher class matches x-fetcher in schema
  2. Fetcher is registered in the app’s DataFetchers list
  3. Integration credentials are valid
  4. Fetcher is not throwing an exception (check logs)

Next steps

Examples

Explore complete FlowApp implementations with advanced schemas