Hi ZAP team, hope everyone is doing well.
ZAP is used by my organization for DAST scanning. We have some openAPI specification files (JSON format) that contain paths ending with "/**", most likely a result of auto generation by the framework tools.
While the abovementioned files are successfully validated by the Swagger editor and the Python openapi-spec-validator package, for some reason the OpenAPI extension fails to import the file with the following error:
`java.util.regex.PatternSyntaxException: Dangling meta character '*' near index n`
where n is the position of the character on the affected line in the openapi file.
I would like to know if this path format is intended to be supported by the OpenAPI addon either presently or in the future?
Do let me know if any additional information would be helpful towards your response. Thanks again!
Versions Used:
ZAP - 2.16.0
OpenAPI Extension - v44
JAVA - OpenJDK 17.0.15
Operating System: Windows (Local), Linux (Custom Docker container)
We primarily perform the import via zaproxy Python API (zap.openapi.import_file(file_path, context_id=context_id)) but also tested via UI.
Example file I used for local testing:{
"openapi": "3.0.1",
"info": {
"title": "Demo Server API",
"version": "1.0.0",
"description": "OpenAPI specification generated from the FastAPI routes in `hello.py`.\n\nRoutes:\n- GET / -> returns a simple Hello World JSON.\n- GET /items/{item_id} -> returns the item id and optional query parameter `q`."
},
"servers": [
{
"url": "
http://localhost:8000",
"description": "Local development server"
}
],
"paths": {
"/health/**": {
"get": {
"summary": "Root endpoint",
"operationId": "read_root",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"Hello": {
"type": "string",
"example": "World"
}
},
"required": ["Hello"]
}
}
}
}
}
}
},
"/items/{item_id}": {
"get": {
"summary": "Get an item by id",
"operationId": "read_item",
"parameters": [
{
"name": "item_id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int32"
},
"description": "Numeric ID of the item to get"
},
{
"name": "q",
"in": "query",
"required": false,
"schema": {
"type": "string"
},
"description": "Optional query string"
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"item_id": {
"type": "integer",
"format": "int32",
"example": 42
},
"q": {
"type": "string",
"nullable": true,
"example": "search"
}
},
"required": ["item_id"]
}
}
}
},
"404": {
"description": "Item not found"
}
}
}
}
},
"components": {}
}