generateSchema static method
Generates a complete JSON schema from a map of property definitions.
properties should be a Map where keys are parameter names and values
are Maps containing schema details like 'type', 'description', 'enum', etc.
required is an optional list of required parameter names. If not provided,
all properties are assumed to be required.
Implementation
static Map<String, dynamic> generateSchema(
Map<String, dynamic> properties, {
List<String>? required,
}) {
final requiredFields = required ?? properties.keys.toList();
return {
'type': 'object',
'properties': properties,
'required': requiredFields,
};
}