Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

/testcases/error-type-bad-invalid-input/openapi.json
119:29 error nlgov:problem-invalid-input GET and DELETE endpoints that have parameters, and all other endpoints must be able to return a 400 response paths./invalid-response-vereist.get.responses
157:29 error nlgov:problem-invalid-input GET and DELETE endpoints that have parameters, and all other endpoints must be able to return a 400 response paths./invalid-response-vereist.put.responses
195:29 error nlgov:problem-invalid-input GET and DELETE endpoints that have parameters, and all other endpoints must be able to return a 400 response paths./invalid-response-vereist.post.responses

✖ 3 problems (3 errors, 0 warnings, 0 infos, 0 hints)
232 changes: 232 additions & 0 deletions linter/testcases/error-type-bad-invalid-input/openapi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
{
"openapi": "3.0.3",
"info": {
"title": "Baseline",
"description": "Deze OpenAPI specification bevat het minimale om aan alle regels te voldoen.",
"contact": {
"name": "Beheerder",
"url": "https://www.example.com",
"email": "mail@example.com"
},
"version": "1.0.0"
},
"servers": [
{
"url": "https://example.com/api/v1"
}
],
"security": [
{
"default": []
}
],
"tags": [
{
"name": "openapi"
},
{
"name": "resource"
}
],
"paths": {
"/openapi.json": {
"get": {
"tags": [
"openapi"
],
"description": "OpenAPI document",
"operationId": "getOpenapiJSON",
"parameters": [],
"responses": {
"200": {
"description": "OK",
"headers": {
"API-Version": {
"description": "De huidige versie van de applicatie",
"style": "simple",
"schema": {
"type": "string"
}
},
"access-control-allow-origin": {
"description": "Alle origins mogen bij deze resource",
"schema": {
"type": "string"
}
}
}
},
"400": {
"description": "OK",
"content": {
"application/problem+json": {
"schema": {
"type": "object",
"properties": {
"status": { "type": "integer" },
"title": { "type": "string" },
"detail": { "type": "string" },
"errors": {
"type": "object",
"properties": {
"in": { "type": "string" },
"location": {
"type": "object",
"properties": {
"pointer": { "type": "string" },
"name": { "type": "string" },
"index": { "type": "integer" }
}
},
"code": { "type": "string" },
"detail": { "type": "string" }
}
}
},
"required": ["status", "title", "detail", "errors"],
"additionalProperties": false
}
}
}
}
},
"security": [
{
"default": []
}
]
}
},
"/invalid-response-vereist": {
"get": {
"tags": [
"resource"
],
"description": "Resource",
"operationId": "getPropertiesCorrect",
"parameters": [
{
"name": "expand",
"in": "query",
"description": "Schakelaar om details van gekoppelde organisaties (subOIN of OINhouder) op te vragen (default false = geen details)",
"schema": {
"type": "boolean"
},
"style": "form",
"explode": true
}
],
"responses": {
"200": {
"description": "OK",
"headers": {
"API-Version": {
"description": "De huidige versie van de applicatie",
"style": "simple",
"schema": {
"type": "string"
}
}
}
}
},
"security": [
{
"default": []
}
]
},
"put": {
"tags": [
"resource"
],
"description": "Resource",
"operationId": "putPropertiesCorrect",
"parameters": [
{
"name": "expand",
"in": "query",
"description": "Schakelaar om details van gekoppelde organisaties (subOIN of OINhouder) op te vragen (default false = geen details)",
"schema": {
"type": "boolean"
},
"style": "form",
"explode": true
}
],
"responses": {
"200": {
"description": "OK",
"headers": {
"API-Version": {
"description": "De huidige versie van de applicatie",
"style": "simple",
"schema": {
"type": "string"
}
}
}
}
},
"security": [
{
"default": []
}
]
},
"post": {
"tags": [
"resource"
],
"description": "Resource",
"operationId": "postPropertiesCorrect",
"parameters": [
{
"name": "expand",
"in": "query",
"description": "Schakelaar om details van gekoppelde organisaties (subOIN of OINhouder) op te vragen (default false = geen details)",
"schema": {
"type": "boolean"
},
"style": "form",
"explode": true
}
],
"responses": {
"200": {
"description": "OK",
"headers": {
"API-Version": {
"description": "De huidige versie van de applicatie",
"style": "simple",
"schema": {
"type": "string"
}
}
}
}
},
"security": [
{
"default": []
}
]
}
}
},
"components": {
"schemas": {
},
"securitySchemes": {
"default": {
"type": "oauth2",
"flows": {
"implicit": {
"authorizationUrl": "https://test.com",
"scopes": {}
}
}
}
}
}
}
6 changes: 6 additions & 0 deletions linter/testcases/error-type-bad-request/expected-output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

/testcases/error-type-bad-request/openapi.json
133:58 error nlgov:problem-schema-members-bad-request Property "extra" is not expected to be here paths./properties-correct.get.responses[400].content.application/problem+json.schema.properties.errors.properties
254:66 error nlgov:problem-schema-members-bad-request Property "pointer2" is not expected to be here paths./properties-location-verkeerd-format.get.responses[400].content.application/problem+json.schema.properties.errors.properties.location.properties

✖ 2 problems (2 errors, 0 warnings, 0 infos, 0 hints)
Loading
Loading