fix: application/vnd.pgrst.array not accepted as a valid mediatype
This commit is contained in:
committed by
Steve Chavez
parent
c820efb64a
commit
87d6a0d0fe
@@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- #2899, Fix `application/vnd.pgrst.array` not accepted as a valid mediatype - @taimoorzaeem
|
||||||
|
|
||||||
## [11.2.0] - 2023-08-10
|
## [11.2.0] - 2023-08-10
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ decodeMediaType mt =
|
|||||||
"application/vnd.pgrst.object+json":rest -> checkSingularNullStrip rest
|
"application/vnd.pgrst.object+json":rest -> checkSingularNullStrip rest
|
||||||
"application/vnd.pgrst.object":rest -> checkSingularNullStrip rest
|
"application/vnd.pgrst.object":rest -> checkSingularNullStrip rest
|
||||||
"application/vnd.pgrst.array+json":rest -> checkArrayNullStrip rest
|
"application/vnd.pgrst.array+json":rest -> checkArrayNullStrip rest
|
||||||
|
"application/vnd.pgrst.array":rest -> checkArrayNullStrip rest
|
||||||
"*/*":_ -> MTAny
|
"*/*":_ -> MTAny
|
||||||
other:_ -> MTOther other
|
other:_ -> MTOther other
|
||||||
_ -> MTAny
|
_ -> MTAny
|
||||||
|
|||||||
@@ -45,6 +45,16 @@ spec =
|
|||||||
, matchHeaders = [matchCTArrayStrip]
|
, matchHeaders = [matchCTArrayStrip]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
it "strips nulls when Accept: application/vnd.pgrst.array;nulls=stripped" $
|
||||||
|
request methodGet "/organizations?select=*"
|
||||||
|
[("Accept","application/vnd.pgrst.array;nulls=stripped")]
|
||||||
|
""
|
||||||
|
`shouldRespondWith`
|
||||||
|
[json|[{"id":1,"name":"Referee Org","manager_id":1},{"id":2,"name":"Auditor Org","manager_id":2},{"id":3,"name":"Acme","referee":1,"auditor":2,"manager_id":3},{"id":4,"name":"Umbrella","referee":1,"auditor":2,"manager_id":4},{"id":5,"name":"Cyberdyne","referee":3,"auditor":4,"manager_id":5},{"id":6,"name":"Oscorp","referee":3,"auditor":4,"manager_id":6}]|]
|
||||||
|
{ matchStatus = 200
|
||||||
|
, matchHeaders = [matchCTArrayStrip]
|
||||||
|
}
|
||||||
|
|
||||||
it "strips nulls when Accept: application/vnd.pgrst.object+json;nulls=stripped" $
|
it "strips nulls when Accept: application/vnd.pgrst.object+json;nulls=stripped" $
|
||||||
request methodGet "/organizations?limit=1"
|
request methodGet "/organizations?limit=1"
|
||||||
[singularStrip]
|
[singularStrip]
|
||||||
|
|||||||
Reference in New Issue
Block a user