Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Submission API
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FIT-Connect
Submission API
Merge requests
!167
BiDiKo Teil 2 - The attack (
planning#460
)
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
BiDiKo Teil 2 - The attack (
planning#460
)
feat/460-bidirectional-communication-part-2
into
main
Overview
68
Commits
3
Pipelines
0
Changes
79
Merged
Jonas Gröger
requested to merge
feat/460-bidirectional-communication-part-2
into
main
1 year ago
Overview
68
Commits
3
Pipelines
0
Changes
79
Expand
1
0
Merge request reports
Compare
main
version 15
e901f8b2
1 year ago
version 14
8e0af2f8
1 year ago
version 13
6242af2e
1 year ago
version 12
9881bbc7
1 year ago
version 11
067bcf83
1 year ago
version 10
88efd74c
1 year ago
version 9
d798ba51
1 year ago
version 8
d7950bcb
1 year ago
version 7
b7550deb
1 year ago
version 6
1d520573
1 year ago
version 5
f297d3e2
1 year ago
version 4
64c78eff
1 year ago
version 3
cfaf1b86
1 year ago
version 2
63ee113c
1 year ago
version 1
63ee113c
1 year ago
main (base)
and
latest version
latest version
e818d69c
3 commits,
1 year ago
version 15
e901f8b2
17 commits,
1 year ago
version 14
8e0af2f8
16 commits,
1 year ago
version 13
6242af2e
15 commits,
1 year ago
version 12
9881bbc7
14 commits,
1 year ago
version 11
067bcf83
12 commits,
1 year ago
version 10
88efd74c
11 commits,
1 year ago
version 9
d798ba51
10 commits,
1 year ago
version 8
d7950bcb
9 commits,
1 year ago
version 7
b7550deb
8 commits,
1 year ago
version 6
1d520573
7 commits,
1 year ago
version 5
f297d3e2
5 commits,
1 year ago
version 4
64c78eff
4 commits,
1 year ago
version 3
cfaf1b86
2 commits,
1 year ago
version 2
63ee113c
2 commits,
1 year ago
version 1
63ee113c
16 commits,
1 year ago
79 files
+
1400
−
169
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
79
Search (e.g. *.vue) (Ctrl+P)
functions/pagination-response.js deleted
100644 → 0
+
0
−
75
Options
const
RESPONSE_ATTRIBUTES
=
[
'
offset
'
,
'
totalCount
'
,
'
count
'
]
const
QUERY_PARAMS
=
[
'
limit
'
,
'
offset
'
]
const
MINIMUM_ATTR_COUNT
=
4
module
.
exports
=
(
operation
,
_opts
,
paths
)
=>
{
// operation should be a get or post operation
if
(
operation
===
null
||
typeof
operation
!==
'
object
'
)
{
return
[]
}
const
path
=
paths
.
given
||
[]
// responses is required property of an operation in OpenAPI 2.0, so if
// isn't present this will be flagged elsewhere -- just return
if
(
!
operation
.
responses
||
typeof
operation
.
responses
!==
'
object
'
)
{
return
[]
}
// Find success response code
const
resp
=
Object
.
keys
(
operation
.
responses
)
.
find
((
code
)
=>
code
.
startsWith
(
'
2
'
))
// No success response will be flagged elsewhere, just return
if
(
!
resp
)
{
return
[]
}
// available content types
const
content
=
operation
.
responses
[
resp
].
content
// Get the schema of the success response
const
responseSchema
=
content
[
Object
.
keys
(
content
)[
0
]].
schema
||
{}
const
errors
=
[]
const
responseHasArray
=
Object
.
values
(
responseSchema
.
properties
||
{})
.
some
((
prop
)
=>
prop
.
type
===
'
array
'
)
const
operationId
=
operation
.
operationId
?
`'
${
operation
.
operationId
}
'`
:
''
if
(
responseHasArray
&&
Object
.
keys
(
responseSchema
.
properties
).
length
<=
MINIMUM_ATTR_COUNT
)
{
RESPONSE_ATTRIBUTES
.
forEach
((
entry
)
=>
{
if
(
!
Object
.
keys
(
responseSchema
.
properties
).
includes
(
entry
))
{
errors
.
push
({
message
:
`Operation
${
operationId
}
might be pageable. Property '
${
entry
}
' is missing.`
,
path
,
})
}
})
if
(
operation
.
parameters
)
{
const
queryParams
=
operation
.
parameters
.
filter
((
param
)
=>
param
.
in
===
'
query
'
)
if
(
queryParams
)
{
const
names
=
queryParams
.
map
((
param
)
=>
param
.
name
)
QUERY_PARAMS
.
forEach
((
e
)
=>
{
if
(
!
names
.
includes
(
e
))
{
errors
.
push
({
message
:
`Operation
${
operationId
}
might be pageable. Query parameter '
${
e
}
' is missing.`
,
path
,
})
}
})
}
}
else
{
errors
.
push
({
message
:
`Operation
${
operationId
}
might be pageable. Query parameters are missing.`
,
path
,
})
}
}
return
errors
}
Loading