php-dt.model_query_var.mustache Maven / Gradle / Ivy
{{#isArray
}}{{#isPrimitiveType
}} * @DTA\Strategy(subset="{{internal.parameterLocation}}", name="QueryStringScalarArray", options={"type":{{>list_item_type}}, "format":"{{internal.collectionFormat}}"})
* @DTA\Validator(subset="{{internal.parameterLocation}}", name="QueryStringScalarArray", options={"type":{{>list_item_type}}, "format":"{{internal.collectionFormat}}"{{#minItems}}, "min_items":{{minItems}}{{/minItems}}{{#maxItems}}, "max_items":{{maxItems}}{{/maxItems}}})
{{/isPrimitiveType
}}{{^isPrimitiveType
}} * TODO add validator(s) and strategy for list of {{>list_item_type}} and collection format {{internal.collectionFormat}} inside query string
{{/isPrimitiveType
}}{{/isArray
}}{{#isMap
}} * TODO add validator(s) and strategy for map of {{>map_item_type}} and collection format {{internal.collectionFormat}} inside query string
{{/isMap
}}{{^isContainer
}}{{#isPrimitiveType
}} * @DTA\Strategy(subset="{{internal.parameterLocation}}", name="QueryStringScalar", options={"type":"{{dataType}}"})
* @DTA\Validator(subset="{{internal.parameterLocation}}", name="QueryStringScalar", options={"type":"{{dataType}}"})
{{/isPrimitiveType
}}{{#isDate
}} * @DTA\Strategy(subset="{{internal.parameterLocation}}", name="Date")
* @DTA\Validator(subset="{{internal.parameterLocation}}", name="Date")
{{/isDate
}}{{#isDateTime
}} * @DTA\Strategy(subset="{{internal.parameterLocation}}", name="DateTime")
* @DTA\Validator(subset="{{internal.parameterLocation}}", name="Date", options={"format": \DateTime::RFC3339})
{{/isDateTime
}}{{^isPrimitiveType
}}{{^isDate}}{{^isDateTime
}} * TODO add validator(s) and strategy for {{dataType}} inside query string
{{/isDateTime}}{{/isDate
}}{{/isPrimitiveType
}}{{/isContainer
}}{{#hasValidation
}}{{#minLength}}{{#maxLength
}} * @DTA\Validator(subset="{{internal.parameterLocation}}", name="StringLength", options={"min":{{minLength}}, "max":{{maxLength}}})
{{/maxLength}}{{/minLength
}}{{^minLength}}{{#maxLength
}} * @DTA\Validator(subset="{{internal.parameterLocation}}", name="StringLength", options={"max":{{maxLength}}})
{{/maxLength}}{{/minLength
}}{{#minLength}}{{^maxLength
}} * @DTA\Validator(subset="{{internal.parameterLocation}}", name="StringLength", options={"min":{{minLength}}})
{{/maxLength}}{{/minLength
}}{{#minimum
}} * @DTA\Validator(subset="{{internal.parameterLocation}}", name="GreaterThan", options={"min":{{minimum}}{{^exclusiveMinimum}}, "inclusive":true{{/exclusiveMinimum}}})
{{/minimum
}}{{#maximum
}} * @DTA\Validator(subset="{{internal.parameterLocation}}", name="LessThan", options={"max":{{maximum}}{{^exclusiveMaximum}}, "inclusive":true{{/exclusiveMaximum}}})
{{/maximum
}}{{#pattern
}} * @DTA\Validator(subset="{{internal.parameterLocation}}", name="Regex", options={"pattern":"{{{pattern}}}"})
{{/pattern
}}{{/hasValidation}}