Gitlab Community Edition Instance
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
openapi4restxq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
subugoe
openapi4restxq
Commits
90c7f8ec
Commit
90c7f8ec
authored
4 years ago
by
Michelle Weidling
Browse files
Options
Downloads
Patches
Plain Diff
fix: consider array for %rest:produces
parent
15957d11
No related branches found
Branches containing commit
Tags
v1.5.1
Tags containing commit
1 merge request
!1
fix: consider array for %rest:produces
Pipeline
#168261
passed
4 years ago
Stage: build
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
content/openapi-tests-full.xqm
+14
-14
14 additions, 14 deletions
content/openapi-tests-full.xqm
content/openapi.xqm
+8
-4
8 additions, 4 deletions
content/openapi.xqm
with
22 additions
and
18 deletions
content/openapi-tests-full.xqm
+
14
−
14
View file @
90c7f8ec
...
...
@@ -23,20 +23,20 @@ declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
: @see http://example.com/documentation/about/this
:)
declare
%rest:POST
(
"{$body}"
)
%rest:consumes
(
"application/xml"
,
"text/xml"
)
%rest:path
(
"/openapi-test/full/post/{$paramPath}/{$int}.{$format}"
)
%rest:query-param
(
"getParam"
,
"{$getParam}"
,
"2019"
)
%rest:produces
(
"application/
json
"
)
%output:method
(
"json"
)
%test:arg
(
"paramPath"
,
"here"
)
%test:arg
(
"int"
,
"123"
)
%test:arg
(
"format"
,
"xquery"
)
%test:arg
(
"getParam"
,
"and-get"
)
%test:arg
(
"body"
,
"<incom
m
ing><node/></incom
m
ing>"
)
%rest:POST
(
"{$body}"
)
%rest:consumes
(
"application/xml"
,
"text/xml"
)
%rest:path
(
"/openapi-test/full/post/{$paramPath}/{$int}.{$format}"
)
%rest:query-param
(
"getParam"
,
"{$getParam}"
,
"2019"
)
%rest:produces
(
"application/
xml"
,
"text/xml
"
)
%output:method
(
"json"
)
%test:arg
(
"paramPath"
,
"here"
)
%test:arg
(
"int"
,
"123"
)
%test:arg
(
"format"
,
"xquery"
)
%test:arg
(
"getParam"
,
"and-get"
)
%test:arg
(
"body"
,
"<incoming><node/></incoming>"
)
function
openapi-test-full:post
(
$paramPath
as
xs:string
,
$int
as
xs:int
,
...
...
This diff is collapsed.
Click to expand it.
content/openapi.xqm
+
8
−
4
View file @
90c7f8ec
...
...
@@ -316,15 +316,19 @@ as map(*)* {
declare
%private
function
openapi:mediaType-object
(
$function
)
as
map
(
*
)
{
let
$produces
:=
(
string
(
$function
/
annotation
[
@name
=
"rest:produces"
])
,
for
$v
in
$function
/
annotation
[
@name
=
"rest:produces"
]
/
value
return
string
(
$v
)
,
string
(
$function
/
annotation
[
@name
=
"output:media-type"
])
,
string
(
$function
/
annotation
[
@name
=
"output:method"
]
/
openapi:method-mediaType
(
string
(
.
)))
,
"application/xml"
)
return
map
{
$produces
[
.
!=
""
][
1
]
:
openapi:schema-object
(
$function
/
returns
)
}
map
:
merge
(
for
$iii
in
1
to
count
(
$produces
)
return
if
(
$produces
[
$iii
]
=
""
)
then
()
else
map
:
entry
(
$produces
[
$iii
]
,
openapi:schema-object
(
$function
/
returns
))
)
};
(:~
...
...
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