feat: undefined json keys as defaults w/ Prefer:undefined-keys

This commit is contained in:
Steve Chavez
2023-03-22 02:44:14 -05:00
committed by GitHub
parent e731241b97
commit 439a96c578
16 changed files with 232 additions and 38 deletions
+3 -2
View File
@@ -109,6 +109,7 @@ createResponse QualifiedIdentifier{..} MutateReadPlan{mrMutatePlan} ctxApiReques
Nothing
else
toAppliedHeader <$> preferResolution
, toAppliedHeader <$> preferUndefinedKeys
]
if preferRepresentation == Full then
@@ -125,9 +126,9 @@ updateResponse ctxApiRequest@ApiRequest{iPreferences=Preferences{..}} resultSet
let
response = gucResponse rsGucStatus rsGucHeaders
contentRangeHeader =
RangeQuery.contentRangeH 0 (rsQueryTotal - 1) $
Just . RangeQuery.contentRangeH 0 (rsQueryTotal - 1) $
if shouldCount preferCount then Just rsQueryTotal else Nothing
headers = [contentRangeHeader]
headers = catMaybes [contentRangeHeader, toAppliedHeader <$> preferUndefinedKeys]
if preferRepresentation == Full then
response HTTP.status200