Comments (3)
Hi @jeanloop, thanks very much for getting in touch!
Do you have an example before/after JSON you could share that reproduces the issue?
Also, please could you let me know the version of swagger UI you’re using; is it the embedded one? If so, this was updated in the latest beta, so would be keen to see if it’s still an issue.
from imposter.
Hi @outofcoffee,
sorry for the delay, I didn't find the time to setup a simple test case until today.
So here it is:
Simply unzip the attached file into a folder, cd into it on the command line and run:
docker run --rm -ti -p 8080:8080 -v $(pwd)/:/opt/imposter/config outofcoffee/imposter-openapi
I used the OAS3 spec from the examples here: https://raw.githubusercontent.com/outofcoffee/imposter/master/plugin/openapi/src/test/resources/config/openapi3-with-examples.yaml
The only change: I added a securityScheme definition for a bearer token and configured security for all endpoints.
When you run it and look at the swagger UI, click on the "authenticate" button above the list of endpoints. The window will open but does not show any content. It should show an interface to login by providing a token.
When you look at the combined.json produced by the server, you may notice, that the components/securitySchemes definition is now included, but the letter case of the type-property has changed from lowercase to uppercase. Swagger UI does not like that. I tested it by filtering combined.json using a regular expression before it is sent by the server. When using lowercase values, all is fine.
The same problem occurs when defining parameters using the style-property. There may be other properties with the same issue that I did not use yet.
Since the OAS documentation defines those values as lowercase, I think that swagger UI is behaving correctly. See here for example: https://swagger.io/docs/specification/authentication/bearer-authentication/
I debugged the imposter java code a bit trying to find the source of the problem and I think it may be related to this file: https://github.com/outofcoffee/imposter/blob/master/core/src/main/groovy/com/gatehill/imposter/util/MapUtil.java.
Hope this helps identifying the problem.
Thanks again for this great tool!
from imposter.
Thank you for the really comprehensive bug report and description. This helped immensely in tracking down this bug. It is finally fixed in 4928932, released in v2.2.0.
from imposter.
Related Issues (20)
- Using Expression.regexify in content responses HOT 2
- Request to make Context.Request.toString() produce json HOT 1
- Add support for faker regexify and similar functions
- Let a percentage of requests fail HOT 2
- CLI tool doesn't download and extract zip files for plugins HOT 1
- [Question] Find SOAP operations HOT 1
- Use of `delay` in AWS Lambda results in empty response HOT 3
- Question - SOAP - Error on "No operations found matching body root" HOT 5
- Upgrade base image to newer version to resolve vunerabilities HOT 3
- [Question] How can I serve WSDL file with SOAP plugin ? HOT 2
- NPE while parsing a WSDL with rpc/encoded style HOT 2
- Precompiling js script files fails from docker container HOT 6
- SOAP : WSDL with includes fails parsing HOT 1
- Autoreload when using docker and config files change HOT 2
- Support for RPC style SOAP services HOT 2
- Support XML attributes in SOAP request body XPath
- Unable to format data from store as JSON in javascript script handler HOT 8
- SQS plugin
- Scheduled steps
- SOAP: WSDL with targetNamespace and messages without namespace prefix parsing issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imposter.