(parameter)
return wrap_with_any_of(schemas)
Convert an `inspect.Parameter` to a single JSON schema

    This will create the schemas using `annotation_to_json_schemas()`,
    set the default values based on the parameters default value
    annotation, and combine the schemas with `wrap_with_any_of()`
Convert an `inspect.Parameter` to a single JSON schema
Convert an inspect . Parameter to a single JSON schema
def parameter_to_schema(parameter):
    """Convert an `inspect.Parameter` to a single JSON schema

    This will create the schemas using `annotation_to_json_schemas()`,
    set the default values based on the parameters default value
    annotation, and combine the schemas with `wrap_with_any_of()`
    """
    type_schemas = annotation_to_json_schemas(parameter.annotation, parameter.default)
    if not type_schemas:
        return {}

    schemas = []
    for type_schema in type_schemas:
        if parameter.default is not empty:
            type_schema["default"] = parameter.default
        schemas.append(type_schema)

    return wrap_with_any_of(schemas)
def parameter_to_schema ( parameter ) : type_schemas = annotation_to_json_schemas ( parameter . annotation , parameter . default ) if not type_schemas : return { } schemas = [ ] for type_schema in type_schemas : if parameter . default is not empty : type_schema [ "default" ] = parameter . default schemas . append ( type_schema ) return wrap_with_any_of ( schemas )