Skip to content

fix: replace break with continue in getNoContentRequestResponsePair() - #2189

Merged
lbroudoux merged 1 commit into
microcks:masterfrom
Harishrs2006:fix/break-to-continue-in-getNoContentRequestResponsePair
Jun 26, 2026
Merged

lbroudoux merged 1 commit into
microcks:masterfrom
Harishrs2006:fix/break-to-continue-in-getNoContentRequestResponsePair

Conversation

@Harishrs2006

Copy link
Copy Markdown
Contributor

Description:

Fixes #2188

In getNoContentRequestResponsePair(), when an example from x-microcks-refs
is missing path parameters for a URI_PARTS or URI_ELEMENTS dispatcher, the
previous break exited the entire requestRefsIterator loop silently dropping
all remaining valid examples after the incomplete one.

The intent is clearly to skip only the current example (the comment says
"Do not register this request / response pair"). continue is the correct
statement.

Note: the equivalent block in the sibling method already uses continue correctly
(line 647) this brings getNoContentRequestResponsePair() into the same pattern.

Change

webapp/src/main/java/io/github/microcks/util/openapi/OpenAPIImporter.java line 740:
break - continue

When an x-microcks-refs example is missing path parameters for a URI_PARTS
or URI_ELEMENTS dispatcher, the previous break exited the entire iterator
loop, silently dropping all remaining valid examples. Using continue skips
only the incomplete example and processes the rest.

Fixes microcks#2188

Signed-off-by: Harish R S <[email protected]>
@lbroudoux lbroudoux added this to the 1.15.0 milestone Jun 26, 2026
@lbroudoux
lbroudoux merged commit b9c262e into microcks:master Jun 26, 2026
15 checks passed
lbroudoux pushed a commit that referenced this pull request Aug 5, 2026
…#2189)

When an x-microcks-refs example is missing path parameters for a URI_PARTS
or URI_ELEMENTS dispatcher, the previous break exited the entire iterator
loop, silently dropping all remaining valid examples. Using continue skips
only the incomplete example and processes the rest.

Fixes #2188

Signed-off-by: Harish R S <[email protected]>
(cherry picked from commit b9c262e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAPI import: break should be continue in getNoContentRequestResponsePair() causing valid examples to be silently skipped

2 participants