-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix UnicodeDecodeError when parsing openapi spec
- Loading branch information
Showing
3 changed files
with
87 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
w3af/core/data/parsers/doc/open_api/tests/data/swagger-special-chars.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"version": "1.0.0", | ||
"title": "Swagger Petstore, special chars: ąęćźżó^żć√≤Ķńå", | ||
"description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification", | ||
"termsOfService": "http://swagger.io/terms/", | ||
"contact": { | ||
"name": "Swagger API Team" | ||
}, | ||
"license": { | ||
"name": "MIT" | ||
} | ||
}, | ||
"host": "petstore.swagger.io", | ||
"basePath": "/api", | ||
"schemes": [ | ||
"http" | ||
], | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"paths": { | ||
"/pets": { | ||
"get": { | ||
"description": "Returns all pets from the system that the user has access to", | ||
"produces": [ | ||
"application/json" | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "A list of pets.", | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/Pet" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/pets/{ąęćźżó^żć√≤Ķńå}": { | ||
"get": { | ||
"description": "Let's see if I'll return an error" | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"Pet": { | ||
"type": "object", | ||
"required": [ | ||
"id", | ||
"name" | ||
], | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int64" | ||
}, | ||
"name": { | ||
"type": "string" | ||
}, | ||
"tag": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters