-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat: raw output w/ request.accepts #2701
Conversation
@@ -1047,7 +1047,8 @@ spec actualPgVersion = do | |||
, matchHeaders = ["Content-Type" <:> "text/plain; charset=utf-8"] | |||
} | |||
|
|||
it "can get raw xml output with Accept: text/xml" $ | |||
it "can get raw xml output with Accept: text/xml" $ do | |||
pendingWith "Should work later with aggregates" | |||
request methodGet "/xmltest?select=xml" (acceptHdrs "text/xml") "" | |||
`shouldRespondWith` | |||
"<myxml>foo</myxml>bar<foobar><baz/></foobar>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, this wasn't working properly because the xmlagg
function requires a column(unlike json_agg
). Will replace this with the aggregate solution mentioned on #1582.
da6298c
to
70bd2eb
Compare
* BREAKING removes the raw-media-types config * BREAKING no longer Accepts text/xml by default
70bd2eb
to
e3dbb52
Compare
I might be able to make this work without breaking the |
Been trying to not break existing xml functionality, but it's turning out to be complicated. Also, I thought it would be useful to keep the Additionally the The only way to get a scalar response is with a scalar returning function, so we should just keep it to that. Will proceed with breaking the select only one column magic and instead support aggregates. |
Closing this one as doing |
Partly addresses #1582.
BREAKING removes the raw-media-types config
BREAKING no longer Accepts text/xml by default
This already works much better than
raw-media-types
. We're able to override existing media types and add new ones. For example:With that we can output
xml
without an explicitAccept
header(because it accepts*/*
), removing the need for Nginx as mentioned here on the docs.cc @fjf2002
Tasks
request.accepts
for scalar functions- [ ]request.accepts
for aggregate functionstext/bytea