-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug - exceptions should not be thrown when properties are generat…
…ed for sibling-hiding keywords
- Loading branch information
Showing
2 changed files
with
241 additions
and
5 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
237 changes: 237 additions & 0 deletions
237
Solutions/Corvus.Json.Specs/Features/AdditionalSchema/Draft4/unableToFindProperty.feature
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,237 @@ | ||
@draft4 | ||
|
||
Feature: Unable to find property | ||
|
||
Scenario: A schema that fails to generate | ||
Given a schema file | ||
""" | ||
{ | ||
"$comment": "https://docs.codeclimate.com/docs/advanced-configuration", | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"definitions": { | ||
"enabled": { | ||
"type": "object", | ||
"properties": { | ||
"enabled": { | ||
"title": "Enabled", | ||
"type": "boolean", | ||
"default": true | ||
} | ||
} | ||
}, | ||
"config": { | ||
"title": "Config", | ||
"type": "object" | ||
}, | ||
"threshold": { | ||
"title": "Threshold", | ||
"type": [ | ||
"integer", | ||
"null" | ||
] | ||
} | ||
}, | ||
"description": "Configuration file as an alternative for configuring your repository in the settings page.", | ||
"id": "https://json.schemastore.org/codeclimate.json", | ||
"properties": { | ||
"version": { | ||
"title": "Version", | ||
"description": "Required to adjust maintainability checks.", | ||
"type": "string", | ||
"default": "2" | ||
}, | ||
"prepare": { | ||
"title": "Prepare", | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"url": { | ||
"title": "URL", | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"path": { | ||
"title": "Path", | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"checks": { | ||
"title": "Checks", | ||
"type": "object", | ||
"properties": { | ||
"argument-count": { | ||
"title": "Argument Count", | ||
"$ref": "#/definitions/enabled", | ||
"properties": { | ||
"config": { | ||
"$ref": "#/definitions/config", | ||
"properties": { | ||
"threshold": { | ||
"$ref": "#/definitions/threshold", | ||
"default": 4 | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"complex-logic": { | ||
"title": "Complex Logic", | ||
"$ref": "#/definitions/enabled", | ||
"properties": { | ||
"config": { | ||
"$ref": "#/definitions/config", | ||
"properties": { | ||
"threshold": { | ||
"$ref": "#/definitions/threshold", | ||
"default": 4 | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"file-lines": { | ||
"title": "File Lines", | ||
"$ref": "#/definitions/enabled", | ||
"properties": { | ||
"config": { | ||
"$ref": "#/definitions/config", | ||
"properties": { | ||
"threshold": { | ||
"$ref": "#/definitions/threshold", | ||
"default": 250 | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"method-complexity": { | ||
"title": "Method Complexity", | ||
"$ref": "#/definitions/enabled", | ||
"properties": { | ||
"config": { | ||
"$ref": "#/definitions/config", | ||
"properties": { | ||
"threshold": { | ||
"$ref": "#/definitions/threshold", | ||
"default": 5 | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"method-count": { | ||
"title": "Method Count", | ||
"$ref": "#/definitions/enabled", | ||
"properties": { | ||
"config": { | ||
"$ref": "#/definitions/config", | ||
"properties": { | ||
"threshold": { | ||
"$ref": "#/definitions/threshold", | ||
"default": 20 | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"method-lines": { | ||
"title": "Method Lines", | ||
"$ref": "#/definitions/enabled", | ||
"properties": { | ||
"config": { | ||
"$ref": "#/definitions/config", | ||
"properties": { | ||
"threshold": { | ||
"$ref": "#/definitions/threshold", | ||
"default": 25 | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"nested-control-flow": { | ||
"title": "Nested Control Flow", | ||
"$ref": "#/definitions/enabled", | ||
"properties": { | ||
"config": { | ||
"$ref": "#/definitions/config", | ||
"properties": { | ||
"threshold": { | ||
"$ref": "#/definitions/threshold", | ||
"default": 4 | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"return-statements": { | ||
"title": "Return Statements", | ||
"$ref": "#/definitions/enabled", | ||
"properties": { | ||
"config": { | ||
"$ref": "#/definitions/config", | ||
"properties": { | ||
"threshold": { | ||
"$ref": "#/definitions/threshold", | ||
"default": 4 | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"similar-code": { | ||
"title": "Similar Code", | ||
"$ref": "#/definitions/enabled", | ||
"properties": { | ||
"config": { | ||
"$ref": "#/definitions/config", | ||
"properties": { | ||
"threshold": { | ||
"$ref": "#/definitions/threshold" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"identical-code": { | ||
"title": "Identical Code", | ||
"$ref": "#/definitions/enabled", | ||
"properties": { | ||
"config": { | ||
"$ref": "#/definitions/config", | ||
"properties": { | ||
"threshold": { | ||
"$ref": "#/definitions/threshold" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"plugins": { | ||
"title": "Plugins", | ||
"description": "To add a plugin to your analysis. You can find the complete list of available plugins here: https://docs.codeclimate.com/docs/list-of-engines", | ||
"type": "object", | ||
"additionalProperties": { | ||
"$ref": "#/definitions/enabled" | ||
} | ||
}, | ||
"exclude_patterns": { | ||
"title": "Exclude Patterns", | ||
"type": "array", | ||
"items": { | ||
"title": "Exclude Pattern", | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"title": "Code Climate Configuration", | ||
"type": "object" | ||
} | ||
""" | ||
When I generate the code for the schema | ||
# We only need to validate that we don't get an exception here, which is fine. |