Skip to content

Instantly share code, notes, and snippets.

@DavidBiesack
Created December 30, 2021 01:47
Show Gist options
  • Save DavidBiesack/c1ab5f3965a178ff9d0e0003fecd3997 to your computer and use it in GitHub Desktop.
Save DavidBiesack/c1ab5f3965a178ff9d0e0003fecd3997 to your computer and use it in GitHub Desktop.
audit false positive in OpenAPI Audit
{
"openapi": "3.0.0",
"info": {
"title": "audit-defect",
"version": "1.0",
"contact": {
"name": "David Biesack",
"email": "[email protected]"
},
"description": "Show how audit reports a required property `name` does not exist when in fact it exists via the `allOf` schema composition."
},
"servers": [
{
"url": "http://localhost:3000"
}
],
"paths": {
"/x": {
"get": {
"summary": "Get X",
"responses": {
"200": {
"description": "X",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/x"
}
}
}
}
},
"operationId": "getX",
"description": "Retrieve X"
}
}
},
"components": {
"schemas": {
"abstractX": {
"title": "abstractX",
"type": "object",
"description": "abstractX",
"properties": {
"name": {
"type": "string",
"description": "The name of the X."
}
}
},
"x": {
"title": "X",
"description": "X",
"type": "object",
"required": [
"name"
],
"allOf": [
{
"$ref": "#/components/schemas/abstractX"
}
]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment