PointerToNowhere error when validating CRDs #217
Sanjay-2004
started this conversation in
General
Replies: 1 comment 1 reply
-
You need to pass registry with your references to validator be able to resolve pointers https://openapi-schema-validator.readthedocs.io/en/latest/references.html#references |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have tried creating a schema and validating yaml file structures based on their datatype and I have been constantly getting the same error no matter how I try to resolve it.
The source code where I'm getting this error is here: Openapi_validation
Steps to Reproduce
pip install pyyaml openapi_schema_validator
python validate_crd.py valid_crd.yaml
Error Message:
❌ Validation Error: PointerToNowhere: '/components/schemas/CustomAttribute' does not exist within {'oneOf': [{'type': 'string', 'minLength': 0, 'maxLength': 100, 'default': '', 'pattern': '.*', 'description': 'A string value.'}, {'type': 'integer', 'minimum': 0, 'maximum': 100, 'default': 0, 'description': 'An integer value.'}, {'type': 'boolean', 'default': False, 'enum': [True, False], 'description': 'A boolean value.'}, {'type': 'array', 'items': {'oneOf': [{'type': 'string'}, {'type': 'integer'}, {'type': 'boolean'}, {'$ref': '#/components/schemas/CustomAttribute'}]}, 'default': [], 'description': 'An array of values.'}, {'type': 'object', 'properties': {'default': {'type': 'object'}, 'description': {'type': 'string'}, 'properties': {'type': 'object', 'additionalProperties': {'$ref': '#/components/schemas/CustomAttribute'}}}, 'required': ['default', 'description', 'properties']}]}
It would really help if there is any fix for this
Beta Was this translation helpful? Give feedback.
All reactions