def METHOD_NAME(minimal_swagger_dict):
    # pet_id param is #/parameters/PetId
    # sort_key param is #/parameters/SortKey
    parameters = {
        'PetId': {
            'name': 'pet_id',
            'in': 'query',
            'required': True,
            'type': 'integer',
        },
        'SortKey': {
            'name': 'sort_key',
            'in': 'query',
            'required': False,
            'type': 'string',
        },
    }
    op_spec = {
        'operationId': 'get_pet_by_id',
        'parameters': [
            {'$ref': '#/parameters/PetId'},
        ],
        'responses': {
            '200': {
            },
        },
    }
    path_spec = {
        'get': op_spec,
        'parameters': [
            {'$ref': '#/parameters/SortKey'},
        ],
    }
    minimal_swagger_dict['paths']['/pets'] = path_spec
    minimal_swagger_dict['parameters'] = parameters
    swagger_spec = Spec(minimal_swagger_dict)
    op = Operation(swagger_spec, '/pets', 'get', op_spec)
    params = build_params(op)
    assert len(params) == 2
    assert 'pet_id' in params
    assert 'sort_key' in params