Skip to content

Commit

Permalink
http headers: use and adjust vnd.inveniordm.v1+json http accept header
Browse files Browse the repository at this point in the history
  • Loading branch information
anikachurilova authored and kpsherva committed Aug 9, 2024
1 parent 607597d commit 6a3c94b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
pip install ".[$EXTRAS]"
pip freeze
docker --version
docker-compose --version
docker compose --version
- name: Run tests
run: |
Expand Down
8 changes: 7 additions & 1 deletion invenio_drafts_resources/resources/records/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
with_content_negotiation,
)
from invenio_records_resources.resources import RecordResource as RecordResourceBase
from invenio_records_resources.resources import (
RecordResourceConfig as RecordResourceConfigBase,
)
from invenio_records_resources.resources.records.headers import etag_headers
from invenio_records_resources.resources.records.resource import (
request_data,
Expand Down Expand Up @@ -166,7 +169,10 @@ def publish(self):
@request_view_args
@with_content_negotiation(
response_handlers={
"application/json": ResponseHandler(JSONSerializer(), headers=etag_headers)
"application/vnd.inveniordm.v1+json": RecordResourceConfigBase.response_handlers[
"application/json"
],
**RecordResourceConfigBase.response_handlers,
},
default_accept_mimetype="application/json",
)
Expand Down

0 comments on commit 6a3c94b

Please sign in to comment.