Comments (6)
I am not totally convinced that the reported issue is due to the code that you pointed out. Indeed, before entering the loop where the removal of the final coma happens there is an implemented check to ensure that the we have got at least one valid parameter to process: if (params != null)
.
Furethemore, I am personally able to parse swagger files containing empty parameters with no problem.
Could you please provide more information? Ideally (if possible) send me the swagger file that you are trying to parse with the swagger-parser/swurg via email so I can have a deep look into the issue.
from openapi-parser.
Example swagger file that causes the error:
{
"swagger": "2.0",
"info": {},
"host": "some.server.com:20666",
"basePath": "/http://some.server.com:20666",
"tags": [
{
"name": "analysis"
},
{
"name": "generic"
}
],
"schemes": [
"http"
],
"paths": {
"/": {
"get": {
"operationId": "get",
"parameters": [],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"type": "string"
},
"headers": {}
}
}
}
}
}
}
from openapi-parser.
Thanks, I am going to have a look at this tomorrow. But at first sight, I would say that that removing that line:
"parameters": [],
could solve the issue since I suspect the List<Parameter> params
to contain an empty Parameter
instead of null
.
/Alex
from openapi-parser.
I can't guarantee what the target site has in its swagger definition! I'd rather the plugin handle that...
from openapi-parser.
The target website still has to have a valid swagger definition!
That's the prerequisite for the plugin to work, swurg does not have to validate the swagger definition; there is already plenty of websites available for that.
As I already said, I will have a look at the issue and IF it is an exception not-handled by swurg I will fix it, otherwise you will have to obtain a properly formatted swagger file!
Swurg is not a bug free plugin and all reported issues are appreciated when properly documented.
This is an on-going project (cf. readme.md) and finding issues is quite normal.
/Alex
from openapi-parser.
It is perfectly valid for parameters
to be an empty array in the swagger definition.
Understood that this is an on-going project and that your valuable time goes into it. I appreciate it.
from openapi-parser.
Related Issues (20)
- [BUG] Gracefully Handle lack of "servers" object HOT 1
- [BUG] Can't build HTTP request for repeater and other burp tools HOT 4
- [FEATURE] Send to Organizer HOT 2
- Suggest adapting to importing JSON files exported from Metersphere
- OpenAPI parser doesn't load the swagger file HOT 7
- Feature request: Use Hackvertor tabs HOT 1
- Error: User Token doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$]
- Bypass SSL error certificate HOT 6
- OpenAPI parser doesn't load the swagger file in YAML format HOT 1
- Parsing errors on various openapi specs HOT 1
- Cannot invoke "io.swagger.v3.oas.models.OpenAPI.getServers()" because "openAPI" is null HOT 2
- Issue when loading a swagger HOT 2
- Support for JSON body types HOT 1
- parseAccept throws null pointer exception when content is not set HOT 1
- Cannot invoke "io.swagger.v3.oas.models.media.Content.entrySet()" HOT 1
- Failed to build - github CI action? HOT 3
- Extension Doesnt Load Swagger File - AD credentials dont confirm to REGEX
- [BUG] issue when importing Swagger file "Cannot invoke "io.swagger.v3.oas.models.media.Content.entrySet()" HOT 6
- [BUG] OpenAPI Spec Failing to Parse HOT 7
- How to identify the parameter value in the path url ?
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 openapi-parser.