def get_schema_for_resource_parameters(parameters_schema, allow_additional_properties=False):
 def normalize(x):
  return {k: (v if v else SCHEMA_ANY_TYPE) for (k, v) in six.iteritems(x)}
 schema = {}
 properties = {}
 properties.update(normalize(parameters_schema))
 if properties:
  schema['type'] = 'object'
  schema['properties'] = properties
  schema['additionalProperties'] = allow_additional_properties
 return schema

def get_schema_for_resource_parameters ( parameters_schema , allow_additional_properties = False ) : def normalize ( x ) : return { k : ( v if v else SCHEMA_ANY_TYPE ) for ( k , v ) in six . iteritems ( x ) } schema = { } properties = { } properties . update ( normalize ( parameters_schema ) ) if properties : schema [ 'type' ] = 'object' schema [ 'properties' ] = properties schema [ 'additionalProperties' ] = allow_additional_properties return schema
dynamically construct json schema for the provided resource from the parameters metadata .