Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement/parser resolve responses flag #2127

Merged
merged 2 commits into from
Oct 22, 2024

Conversation

micryc
Copy link
Contributor

@micryc micryc commented Oct 16, 2024

Due to unexpected results during parsing OAS with options - resolve and flatten set to true, we decided to create resolveResponses flag, from now responses will not be fully resolved by default with option resolve - true.
If anyone wants to keep previous behaviour needs to use option setResolveResponses(true)

@micryc micryc requested a review from frantuma October 16, 2024 08:30
@@ -70,8 +70,8 @@ public void processOperation(Operation operation) {
for (String responseCode : responses.keySet()) {
ApiResponse response = responses.get(responseCode);
if(response != null) {
//This part allows parser to put response inline without the resolveFully option set to true
if (response.get$ref() != null) {
//This part allows parser to put response inline within resolveResponses or ResolveFully
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would replace with // This part allows parser to put response inline when resolveResponses = true

see below

//This part allows parser to put response inline without the resolveFully option set to true
if (response.get$ref() != null) {
//This part allows parser to put response inline within resolveResponses or ResolveFully
if (response.get$ref() != null && cache != null && cache.getParseOptions() != null && (cache.getParseOptions().isResolveResponses() || cache.getParseOptions().isResolveFully())) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't be triggered by resolveFully but only by the flag. It's true that we currently don't process components/responses in ResolveFully as we do for requestBodies, but this should be addressed in separate ticket and logic added to ResolveFully and not here

@micryc micryc requested a review from frantuma October 21, 2024 11:31
@micryc micryc force-pushed the enhancement/parser-resolveResponses-flag branch from d6bed18 to 6bed0f6 Compare October 21, 2024 11:52
@micryc micryc merged commit 0d10a67 into master Oct 22, 2024
6 checks passed
@micryc micryc deleted the enhancement/parser-resolveResponses-flag branch October 22, 2024 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants