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

No flow in Design API #9242

Closed
exalate-issue-sync bot opened this issue Sep 19, 2023 · 1 comment
Closed

No flow in Design API #9242

exalate-issue-sync bot opened this issue Sep 19, 2023 · 1 comment

Comments

@exalate-issue-sync
Copy link

exalate-issue-sync bot commented Sep 19, 2023

Describe the bug :

There’s a bug with the MockPolicy only, or something that’s not compatible with it.

When importing the swagger for the api, the policies are missing in api created by stoplight.

To Reproduce :

Steps to reproduce the behaviour:

  1. Import api :

[MDMAPI.yaml^!/images/icons/link_attachment_7.gif!^| /rest/api/3/attachment/content/13047 "MDMAPI.yaml attached to APIM-2732"]

2. Check “Apply Mock policy“

3. Seer error banner

In the APIM API console we can sea a NPE in “MockOAIOperationVisitor

java.lang.NullPointerException: Cannot invoke \"io.swagger.v3.oas.models.Components.getSchemas()\" because the return value of \"io.swagger.v3.oas.models.OpenAPI.getComponents()\" is null
 io.gravitee.policy.mock.swagger.MockOAIOperationVisitor.getResponseFromSimpleRef(MockOAIOperationVisitor.java:176)
 io.gravitee.policy.mock.swagger.MockOAIOperationVisitor.getSchemaValue(MockOAIOperationVisitor.java:246)
 io.gravitee.policy.mock.swagger.MockOAIOperationVisitor.lambda$getResponseProperties$0(MockOAIOperationVisitor.java:184)
 java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Unknown Source)
 java.base/java.util.stream.ReduceOps$3ReducingSink.accept(Unknown Source)
 java.base/java.util.Iterator.forEachRemaining(Unknown Source)
 java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)
 java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
 java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
 java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
 java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
 java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
 io.gravitee.policy.mock.swagger.MockOAIOperationVisitor.getResponseProperties(MockOAIOperationVisitor.java:184)
 io.gravitee.policy.mock.swagger.MockOAIOperationVisitor.processResponseSchema(MockOAIOperationVisitor.java:140)
 io.gravitee.policy.mock.swagger.MockOAIOperationVisitor.visit(MockOAIOperationVisitor.java:93)
 io.gravitee.policy.mock.swagger.MockOAIOperationVisitor.visit(MockOAIOperationVisitor.java:46)

Check some parseOptions like setFlattenComposedSchemas note tested.

Expected behaviour :

No error OR understandable error

Current behavior :

Not having the policies after import

Useful information :

We have a workaround for this already in place.

tested in 3.20.6

@exalate-issue-sync
Copy link
Author

This issue has been fixed in versions 3.20.20, 4.0.9, 3.19.25, 4.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
API Management
Awaiting triage
Development

No branches or pull requests

0 participants