Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nomad-FAIR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nomad-lab
nomad-FAIR
Commits
5121e9ab
Commit
5121e9ab
authored
4 years ago
by
Markus Scheidgen
Browse files
Options
Downloads
Patches
Plain Diff
Change the content type based on the given format parameter.
parent
2f661aab
No related branches found
No related tags found
3 merge requests
!254
Merging these two branches concerning the encylopedia complex search
,
!246
Merge for release
,
!238
Add dcat API for stream project.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
nomad/app/dcat/catalog.py
+2
-1
2 additions, 1 deletion
nomad/app/dcat/catalog.py
nomad/app/dcat/datasets.py
+2
-1
2 additions, 1 deletion
nomad/app/dcat/datasets.py
with
4 additions
and
2 deletions
nomad/app/dcat/catalog.py
+
2
−
1
View file @
5121e9ab
...
@@ -73,7 +73,8 @@ class Catalog(Resource):
...
@@ -73,7 +73,8 @@ class Catalog(Resource):
mapping
=
Mapping
()
mapping
=
Mapping
()
mapping
.
map_catalog
(
es_response
.
hits
)
mapping
.
map_catalog
(
es_response
.
hits
)
content_type
=
'
application/xml
'
if
format_
==
'
xml
'
else
'
text/%s
'
%
format_
return
Response
(
return
Response
(
mapping
.
g
.
serialize
(
format
=
format_
).
decode
(
'
utf-8
'
),
200
,
mapping
.
g
.
serialize
(
format
=
format_
).
decode
(
'
utf-8
'
),
200
,
{
'
Content-Type
'
:
'
application/xml
'
})
{
'
Content-Type
'
:
content_type
})
This diff is collapsed.
Click to expand it.
nomad/app/dcat/datasets.py
+
2
−
1
View file @
5121e9ab
...
@@ -59,6 +59,7 @@ class Dataset(Resource):
...
@@ -59,6 +59,7 @@ class Dataset(Resource):
mapping
=
Mapping
()
mapping
=
Mapping
()
mapping
.
map_entry
(
entry
)
mapping
.
map_entry
(
entry
)
content_type
=
'
application/xml
'
if
format_
==
'
xml
'
else
'
text/%s
'
%
format_
return
Response
(
return
Response
(
mapping
.
g
.
serialize
(
format
=
format_
).
decode
(
'
utf-8
'
),
200
,
mapping
.
g
.
serialize
(
format
=
format_
).
decode
(
'
utf-8
'
),
200
,
{
'
Content-Type
'
:
'
application/xml
'
})
{
'
Content-Type
'
:
content_type
})
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment