FOSRestBundle icon indicating copy to clipboard operation
FOSRestBundle copied to clipboard

Difference between nullable and strict ?

Open TheKassaK opened this issue 7 years ago • 0 comments

I'm working on a Symfony project in API mode with FosRestBundle and NelmioApiDoc.

So, I have an annotation for a param in my route like :

  • @Rest\QueryParam(name="code", requirements="[0-9]{4}[A−Za-z]{1}", strict=true, description="Naf Code") With this my param code is required both for the FosRest validation and for the Nelmio doc generated.

My question is, if you check the doc : https://symfony.com/doc/master/bundles/FOSRestBundle/annotations-reference.html you can see there is an option nullable but if I replace strict=true by nullable=false my param is not required anymore..

So, what's the strict option exactly ? And what's the nullable option exactly ?

Thanks !

TheKassaK avatar Feb 16 '18 13:02 TheKassaK