-
Notifications
You must be signed in to change notification settings - Fork 5
Repeated "Prefer" header overrides the previous one in SwaggerUI #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can Also relevant: OAI/OpenAPI-Specification#2109 |
After doing some experiments, using an array type with {
"count": "exact",
"return": "representation"
} curl ... \
-H `Prefer: count=exact, return=representation` The advantage over |
It seems that it behaves differently for each UI. Redocly listed the available values and examples nicely, although I couldn't test the CURL generation since it doesn't have that feature. In Rapidoc, it also lists the schema but does not generate the CURL example correctly (ignores the header). I'll fix and implement it that way to avoid blockers. User feedback may be needed here. Edit: Just noticed that it still needs the use of |
I had the idea to repeat the
Prefer
header for each preference that PostgREST has (count, tx, etc.). This would be useful to allow more than one Prefer Header at a time (which is not possible right now in the core repo).But in SwaggerUI, the other Prefer headers are overridden and have the same value as the first one (since they all have the same
name: Prefer
). A solution would be to just add the valid transactions in the description e.g. "Valid values are:tx=commit
,return=minimal
,...
" or find if it's possible to allow manyenum
s (couldn't find a way yet).This is the relevant function:
postgrest-openapi/sql/postgrest.sql
Line 615 in 81f5b64
The text was updated successfully, but these errors were encountered: