Openapi job - email format cause invalid json error

211 views
Skip to first unread message

Igor

unread,
Feb 16, 2022, 2:47:59 AM2/16/22
to OWASP ZAP User Group
Hey everyone,

I'm facing an issue while openapi job. Zap2docker is throwing:
Parsing message body failed: Invalid JSON: <json>:1:9 Expected json literal but found ident {"email":foo...@example.com,"firstName":"John Doe","lastName":"John Doe","phone":"9999999999"}

As you can see the value under the email key is passed without quotes. 

Error is thrown if openapi spec for the email is defined as follow:
"email": { "type": "string", "format": "email", <--- without this, openapi job doesn't show parsing errors "externalDocs": { "url": "http:\/\/schema.org\/email" }

Output:
Found Java version 11.0.13
Available memory: 3933 MB
Using JVM args: -Xmx983m
Job openapi set apiUrl = http://127.0.0.1:9000/api/doc/openapi.json
Job openapi set targetUrl = http://127.0.0.1:9000
Job openapi started
<--- PARSING ERRORS -->
Job openapi added 124 URLs
Job openapi finished


Did anyone of you face a similar issue?
Docker image version: owasp/zap2docker-stable
I run zap.sh with additional options: 
  • -addonupdate
  • -addoninstall ascanrulesBeta
  • -addoninstall ascanrulesAlpha
  • -addoninstall pscanrulesBeta
  • -addoninstall pscanrulesAlpha
Job definition
jobs:
- type: "openapi"
  name: "openapi" 
  parameters:

Thanks for any help!

kingthorin+owaspzap

unread,
Feb 16, 2022, 9:40:51 AM2/16/22
to OWASP ZAP User Group
Your JSON doesn't appear to be valid, the email address should be quoted.

Reply all
Reply to author
Forward
0 new messages