request without sort_dir specified in query generate SortDir = asc in interactor input.
Expected behavior
(1) SortDir default value asc should be applied for requests without sort_dir in query when default value is specified using schema.WithDefault (similar how default field tag works).
(2) When both schema.WithDefault and default field tag are specified, openapi.json does not contain default definition from tag, just schema reference #/components/schemas/SortDir so default definition from field tag should be ignored in such scenario probably but is not (as above).
Describe bug According to https://github.com/swaggest/rest/discussions/132#discussioncomment-4873894 it's possible to define default type value with
schema.WithDefault
like thisbut when
interactor input contains empty
SortDir
field for request withoutsort_dir
specified (should be default valueasc
). After changingrequest without
sort_dir
specified in query generateSortDir
=asc
in interactor input.Expected behavior (1)
SortDir
default valueasc
should be applied for requests withoutsort_dir
in query when default value is specified usingschema.WithDefault
(similar howdefault
field tag works).(2) When both
schema.WithDefault
anddefault
field tag are specified, openapi.json does not containdefault
definition from tag, just schema reference#/components/schemas/SortDir
sodefault
definition from field tag should be ignored in such scenario probably but is not (as above).