php-dt-modern.model_query_var.mustache Maven / Gradle / Ivy
{{#isArray
}}{{#isPrimitiveType
}} #[DTA\Strategy("QueryStringScalarArray", ["type" => {{>list_item_type}}, "format" => "{{internal.collectionFormat}}"], "{{internal.parameterLocation}}")]
#[DTA\Validator("QueryStringScalarArray", ["type" => {{>list_item_type}}, "format" => "{{internal.collectionFormat}}"{{#minItems}}, "min_items" => {{minItems}}{{/minItems}}{{#maxItems}}, "max_items" => {{maxItems}}{{/maxItems}}], subset: "{{internal.parameterLocation}}")]
{{/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("QueryStringScalar", ["type" => "{{dataType}}"], "{{internal.parameterLocation}}")]
#[DTA\Validator("QueryStringScalar", ["type" => "{{dataType}}"], subset: "{{internal.parameterLocation}}")]
{{/isPrimitiveType
}}{{#isDate
}} #[DTA\Strategy("Date", subset: "{{internal.parameterLocation}}")]
#[DTA\Validator("Date", subset: "{{internal.parameterLocation}}")]
{{/isDate
}}{{#isDateTime
}} #[DTA\Strategy("DateTime", subset: "{{internal.parameterLocation}}")]
#[DTA\Validator("DateTime", subset: "{{internal.parameterLocation}}")]
{{/isDateTime
}}{{^isPrimitiveType
}}{{^isDate}}{{^isDateTime
}} // TODO add validator(s) and strategy for {{dataType}} inside query string
{{/isDateTime}}{{/isDate
}}{{/isPrimitiveType
}}{{/isContainer
}}{{#hasValidation
}}{{#minLength}}{{#maxLength
}} #[DTA\Validator("Length", ["min" => {{minLength}}, "max" => {{maxLength}}], subset: "{{internal.parameterLocation}}")]
{{/maxLength}}{{/minLength
}}{{^minLength}}{{#maxLength
}} #[DTA\Validator("Length", ["max" => {{maxLength}}], subset: "{{internal.parameterLocation}}")]
{{/maxLength}}{{/minLength
}}{{#minLength}}{{^maxLength
}} #[DTA\Validator("Length", ["min" => {{minLength}}], subset: "{{internal.parameterLocation}}")]
{{/maxLength}}{{/minLength
}}{{#minimum}}{{#maximum
}} #[DTA\Validator("Range", ["min" => {{minimum}}, "max" => {{maximum}}{{#exclusiveMinimum}}, "exclude_min" => true{{/exclusiveMinimum}}{{#exclusiveMaximum}}, "exclude_max" => true{{/exclusiveMaximum}}], subset: "{{internal.parameterLocation}}")]
{{/maximum}}{{/minimum
}}{{^minimum}}{{#maximum
}} #[DTA\Validator("Range", ["max" => {{maximum}}{{#exclusiveMaximum}}, "exclude_max" => true{{/exclusiveMaximum}}], subset: "{{internal.parameterLocation}}")]
{{/maximum}}{{/minimum
}}{{#minimum}}{{^maximum
}} #[DTA\Validator("Range", ["min" => {{minimum}}{{#exclusiveMinimum}}, "exclude_min" => true{{/exclusiveMinimum}}], subset: "{{internal.parameterLocation}}")]
{{/maximum}}{{/minimum
}}{{#pattern
}} #[DTA\Validator("Match", ["pattern" => "{{{pattern}}}"], subset: "{{internal.parameterLocation}}")]
{{/pattern
}}{{/hasValidation}}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy