In an action, inter alia, for a judgment declaring that Local City Ordinance 21-2007 of the City of New Rochelle is unconstitutional and in violation of state law, the plaintiffs appeal, as limited by their brief, from so much of an order and judgment (one paper) of the Supreme Court, Westchester County (Dono*534van, J.), dated September 10, 2007, as denied those branches of their motion which were to compel certain discovery and, sua sponte, dismissed the complaint for failure to state a cause of action.
Ordered that the order and judgment is modified, on the law, (1) by deleting the provision thereof sua sponte dismissing the complaint, and (2) by deleting the provision thereof denying those branches of the plaintiffs’ motion which were to compel discovery of document requests 6, 7, 15, 16, and 21 and substituting therefor a provision granting those branches of the motion only to the extent that those document requests pertain to the calculation of the costs of administering Local City Ordinance 21-2007 of the City of New Rochelle incurred by the municipality; as so modified, the order and judgment is affirmed insofar as appealed from, with costs to the plaintiffs, the complaint is reinstated, and the matter is remitted to the Supreme Court, Westchester County, for further proceedings on the complaint.
In the absence of notice to the parties and an application by the defendant for such relief, it was error for the Supreme Court to, sua sponte, dismiss the complaint (see Abinanti v Pascale, 41 AD3d 395, 396 [2007]; Jacobs v Mostow, 23 AD3d 623, 623-624 [2005]; Gibbs v Kinsey, 120 AD2d 701 [1986]).
The Supreme Court also erred in part in denying those branches of the plaintiffs’ motion which were to compel the discovery of document requests 6, 7, 15, 16, and 21. The defendant’s failure to make a timely challenge to the plaintiffs’ first set of document requests “forecloses inquiry into the propriety of the information sought except with regard to material that is privileged pursuant to CPLR 3101 or requests that are palpably improper” (Hunt v Odd Job Trading, 44 AD3d 714, 716 [2007], quoting Garcia v Jomber Realty, 264 AD2d 809, 810 [1999]). Although disclosure of the motivation for enacting legislation should be precluded, pretrial discovery as to the circumstances surrounding the enactment is legitimate (see D & S Realty Dev., LP v Town of Huntington, 22 AD3d 455 [2005]; Consolidated Petroleum Term, v Incorporated Vil. of Port Jefferson, 75 AD2d 611, 612 [1980]). Moreover, a document request will be found proper as long as it is sufficiently specific to apprise the defendant of the category of documents which must be produced and is relevant to the plaintiff’s cause of action (see Fausto v City of New York, 17 AD3d 520, 522 [2005]; Stevens v Metropolitan Suburban Bus Auth., 117 AD2d 733, 734 [1986]).
Here, the plaintiffs’ document requests 6, 7, 15, 16, and 21 do not require disclosure of the motives for enacting the ordinance *535at issue. Moreover, document requests 6, 7, 15, 16, and 21 are clearly relevant to the plaintiffs’ claims insofar as they pertain to the calculation of the costs of administering Local City Ordinance 21-2007 of the City of New Rochelle incurred by the municipality.
Motion by the respondent on an appeal from an order and judgment (one paper) of the Supreme Court, Westchester County, dated September 10, 2007, inter alia, to dismiss the appeal. By decision and order on motion of this Court dated March 20, 2008 [2008 NY Slip Op 67127(U)], that branch of the motion which was to dismiss the appeal was held in abeyance and referred to the Justices hearing the appeal for determination upon the argument or submission of the appeal.
Upon the papers filed in support of the motion, the papers filed in opposition thereto, and upon the argument of the appeal, it is
Ordered that the branch of the motion which is to dismiss the appeal is denied. Mastro, J.E, Lifson, Garni and Eng, JJ., concur.