Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve reporting of errors caused by reference resolution #1472

Closed
vkosuri opened this issue Apr 23, 2022 · 3 comments · Fixed by #1830
Closed

Improve reporting of errors caused by reference resolution #1472

vkosuri opened this issue Apr 23, 2022 · 3 comments · Fixed by #1830
Assignees
Labels
Priority: Medium Planned for regular releases Type: Bug Errors or unexpected behavior UX: Reporting Output readability
Milestone

Comments

@vkosuri
Copy link

vkosuri commented Apr 23, 2022

Checklist
Yes

Describe the bug
open API with one of reference unable to parse failed with Keyeroor, I have pasted a concise version of how they key located in the below

test:
    properties:
        content:
            oneof:
                - ref: "#/test1contents"
                - ref: "#/test2contents"
test1Contents:
    type: object
    ..

test2Contents:
    type: object

To Reproduce
Steps to reproduce the behavior:

  1. Run this command '...'
  2. See an error

If possible, please post a minimal version of your API schema that cause this behaviour:

schemathesis  run --checks all --store-network-log test.log --code-sample-style=python --workers 2 --base-url https://10.144.73.208:5443/api/v1/ ./bip.yaml
Warning: Option `--store-network-log` is deprecated and will be removed in Schemathesis 4.0. Use `--cassette-path` instead.
=========================================================================== Schemathesis test session starts ===========================================================================
platform Linux -- Python 3.8.10, schemathesis-3.14.2, hypothesis-6.45.0, hypothesis_jsonschema-0.22.0, jsonschema-4.4.0
rootdir: /home/kosuri/gitswarm/bip/core/openapi
Hypothesis: deadline=timedelta(milliseconds=15000), database=DirectoryBasedExampleDatabase('/home/kosuri/gitswarm/bip/core/openapi/.hypothesis/examples')
Schema location: file:///home/kosuri/gitswarm/bip/core/openapi/mbip.yaml
Base URL: https://10.144.73.208:5443/api/v1
Specification version: Open API 3.0.2
Workers: 2
Collected API operations: 191

Expected behavior
Testscases should execute

Environment (please complete the following information):

  • OS: Ubuntu 20 LTS
  • Python version: 3.8
  • Schemathesis version: 3.14.2
  • Spec version: 3.0.2

Additional context

Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
Exception in thread schemathesis_1:
Traceback (most recent call last):
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/jsonschema/validators.py", line 870, in resolve_fragment
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    document = document[part]
KeyError: 'keyCertificatePEMContents'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/schemathesis/runner/impl/threadpool.py", line 109, in thread_task
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    _run_task(
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/schemathesis/runner/impl/threadpool.py", line 68, in _run_task
    self._target(*self._args, **self._kwargs)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/schemathesis/runner/impl/threadpool.py", line 109, in thread_task
    test_function = create_test(
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/schemathesis/_hypothesis.py", line 57, in create_test
    _run_task(
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/schemathesis/runner/impl/threadpool.py", line 68, in _run_task
    test_function = create_test(
    wrapped_test = add_examples(wrapped_test, operation, hook_dispatcher=hook_dispatcher)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/schemathesis/_hypothesis.py", line 57, in create_test
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/schemathesis/_hypothesis.py", line 83, in add_examples
    examples: List[Case] = [get_single_example(strategy) for strategy in operation.get_strategies_from_examples()]
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/schemathesis/_hypothesis.py", line 83, in <listcomp>
    wrapped_test = add_examples(wrapped_test, operation, hook_dispatcher=hook_dispatcher)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/schemathesis/_hypothesis.py", line 83, in add_examples
    examples: List[Case] = [get_single_example(strategy) for strategy in operation.get_strategies_from_examples()]
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/schemathesis/_hypothesis.py", line 118, in get_single_example
    examples: List[Case] = [get_single_example(strategy) for strategy in operation.get_strategies_from_examples()]
    example_generating_inner_function()
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/schemathesis/_hypothesis.py", line 83, in <listcomp>
    examples: List[Case] = [get_single_example(strategy) for strategy in operation.get_strategies_from_examples()]
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/schemathesis/_hypothesis.py", line 118, in get_single_example
    example_generating_inner_function()
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/schemathesis/_hypothesis.py", line 106, in example_generating_inner_function
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/schemathesis/_hypothesis.py", line 106, in example_generating_inner_function
    @hypothesis.settings(  # type: ignore
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/core.py", line 1239, in wrapped_test
    @hypothesis.settings(  # type: ignore
    raise the_error_hypothesis_found
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/core.py", line 1239, in wrapped_test
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/schemathesis/specs/openapi/_hypothesis.py", line 149, in get_case_strategy
    raise the_error_hypothesis_found
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/schemathesis/specs/openapi/_hypothesis.py", line 149, in get_case_strategy
    body = draw(strategy)
    body = draw(strategy)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/lazy.py", line 156, in do_draw
    return data.draw(self.wrapped_strategy)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/core.py", line 794, in do_draw
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/lazy.py", line 156, in do_draw
    return self.target(
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_from_schema.py", line 104, in error_raiser
    raise error
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/core.py", line 722, in _execute_once_for_engine
    return data.draw(self.wrapped_strategy)
    result = self.execute_once(data)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/core.py", line 661, in execute_once
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/core.py", line 794, in do_draw
    result = self.test_runner(data, run)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/executors.py", line 47, in default_new_style_executor
    return self.target(
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_from_schema.py", line 104, in error_raiser
    return function(data)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/core.py", line 619, in run
    raise error
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/core.py", line 722, in _execute_once_for_engine
    args, kwargs = data.draw(self.search_strategy)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 878, in draw
    result = self.execute_once(data)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/core.py", line 661, in execute_once
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/collections.py", line 58, in do_draw
    return tuple(data.draw(e) for e in self.element_strategies)
    result = self.test_runner(data, run)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/collections.py", line 58, in <genexpr>
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/executors.py", line 47, in default_new_style_executor
    return tuple(data.draw(e) for e in self.element_strategies)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
    return function(data)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/core.py", line 619, in run
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/strategies.py", line 823, in do_draw
    args, kwargs = data.draw(self.search_strategy)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 878, in draw
    result = self.pack(data.draw(self.mapped_strategy))
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/collections.py", line 58, in do_draw
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/lazy.py", line 156, in do_draw
    return tuple(data.draw(e) for e in self.element_strategies)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/collections.py", line 58, in <genexpr>
    return tuple(data.draw(e) for e in self.element_strategies)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
    return data.draw(self.wrapped_strategy)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/strategies.py", line 823, in do_draw
    return strategy.do_draw(self)
    result = self.pack(data.draw(self.mapped_strategy))
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/strategies.py", line 823, in do_draw
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/lazy.py", line 156, in do_draw
    result = self.pack(data.draw(self.mapped_strategy))
    return data.draw(self.wrapped_strategy)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/collections.py", line 58, in do_draw
    return tuple(data.draw(e) for e in self.element_strategies)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/collections.py", line 58, in <genexpr>
    return tuple(data.draw(e) for e in self.element_strategies)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/strategies.py", line 823, in do_draw
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/strategies.py", line 823, in do_draw
    result = self.pack(data.draw(self.mapped_strategy))
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
    result = self.pack(data.draw(self.mapped_strategy))
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/lazy.py", line 156, in do_draw
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/collections.py", line 58, in do_draw
    return data.draw(self.wrapped_strategy)
    return tuple(data.draw(e) for e in self.element_strategies)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/collections.py", line 58, in <genexpr>
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
    return tuple(data.draw(e) for e in self.element_strategies)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/core.py", line 1450, in do_draw
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/strategies.py", line 823, in do_draw
    return self.definition(data.draw, *self.args, **self.kwargs)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/schemathesis/specs/openapi/_hypothesis.py", line 149, in get_case_strategy
    result = self.pack(data.draw(self.mapped_strategy))
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
    body = draw(strategy)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/lazy.py", line 156, in do_draw
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/lazy.py", line 156, in do_draw
    return data.draw(self.wrapped_strategy)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
    return data.draw(self.wrapped_strategy)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
    return strategy.do_draw(self)
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/core.py", line 1450, in do_draw
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/core.py", line 794, in do_draw
    return self.target(
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_from_schema.py", line 104, in error_raiser
    return self.definition(data.draw, *self.args, **self.kwargs)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/schemathesis/specs/openapi/_hypothesis.py", line 149, in get_case_strategy
    raise error
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_from_schema.py", line 99, in from_schema
    body = draw(strategy)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
    return __from_schema(schema, custom_formats=custom_formats)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_from_schema.py", line 135, in __from_schema
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/lazy.py", line 156, in do_draw
    schema = resolve_all_refs(schema)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 73, in resolve_all_refs
    return data.draw(self.wrapped_strategy)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/data.py", line 874, in draw
    schema[key] = [
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 74, in <listcomp>
    return strategy.do_draw(self)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis/strategies/_internal/core.py", line 794, in do_draw
    resolve_all_refs(v, resolver=resolver) if isinstance(v, dict) else v
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 85, in resolve_all_refs
    return self.target(
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_from_schema.py", line 104, in error_raiser
    raise error
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_from_schema.py", line 99, in from_schema
    schema[key] = {
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 86, in <dictcomp>
    return __from_schema(schema, custom_formats=custom_formats)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_from_schema.py", line 135, in __from_schema
    schema = resolve_all_refs(schema)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 73, in resolve_all_refs
    k: resolve_all_refs(v, resolver=resolver) if isinstance(v, dict) else v
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 85, in resolve_all_refs
    schema[key] = [
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 74, in <listcomp>
    schema[key] = {
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 86, in <dictcomp>
    resolve_all_refs(v, resolver=resolver) if isinstance(v, dict) else v
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 85, in resolve_all_refs
    k: resolve_all_refs(v, resolver=resolver) if isinstance(v, dict) else v
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 73, in resolve_all_refs
    schema[key] = {
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 86, in <dictcomp>
    k: resolve_all_refs(v, resolver=resolver) if isinstance(v, dict) else v
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 85, in resolve_all_refs
    schema[key] = [
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 74, in <listcomp>
    schema[key] = {
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 86, in <dictcomp>
    k: resolve_all_refs(v, resolver=resolver) if isinstance(v, dict) else v
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 73, in resolve_all_refs
    resolve_all_refs(v, resolver=resolver) if isinstance(v, dict) else v
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 85, in resolve_all_refs
    schema[key] = [
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 74, in <listcomp>
    schema[key] = {
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 86, in <dictcomp>
    resolve_all_refs(v, resolver=resolver) if isinstance(v, dict) else v
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 85, in resolve_all_refs
    k: resolve_all_refs(v, resolver=resolver) if isinstance(v, dict) else v
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 85, in resolve_all_refs
    schema[key] = {
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 86, in <dictcomp>
    schema[key] = {
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 86, in <dictcomp>
    k: resolve_all_refs(v, resolver=resolver) if isinstance(v, dict) else v
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 85, in resolve_all_refs
    k: resolve_all_refs(v, resolver=resolver) if isinstance(v, dict) else v
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 78, in resolve_all_refs
    schema[key] = {
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 86, in <dictcomp>
    schema[key] = resolve_all_refs(val, resolver=resolver)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 85, in resolve_all_refs
    k: resolve_all_refs(v, resolver=resolver) if isinstance(v, dict) else v
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 78, in resolve_all_refs
    schema[key] = {
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 86, in <dictcomp>
    schema[key] = resolve_all_refs(val, resolver=resolver)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 85, in resolve_all_refs
    k: resolve_all_refs(v, resolver=resolver) if isinstance(v, dict) else v
    schema[key] = {
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 73, in resolve_all_refs
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 86, in <dictcomp>
    k: resolve_all_refs(v, resolver=resolver) if isinstance(v, dict) else v
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 73, in resolve_all_refs
    schema[key] = [
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 74, in <listcomp>
    schema[key] = [
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 74, in <listcomp>
    resolve_all_refs(v, resolver=resolver) if isinstance(v, dict) else v
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 61, in resolve_all_refs
    resolve_all_refs(v, resolver=resolver) if isinstance(v, dict) else v
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/hypothesis_jsonschema/_resolve.py", line 61, in resolve_all_refs
    with resolver.resolving(ref) as got:
  File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
    with resolver.resolving(ref) as got:
  File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/jsonschema/validators.py", line 760, in resolving
    return next(self.gen)
    url, resolved = self.resolve(ref)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/jsonschema/validators.py", line 805, in resolve
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/jsonschema/validators.py", line 760, in resolving
    return url, self._remote_cache(url)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/jsonschema/validators.py", line 820, in resolve_from_url
    return self.resolve_fragment(document, fragment)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/jsonschema/validators.py", line 872, in resolve_fragment
    raise exceptions.RefResolutionError(
    url, resolved = self.resolve(ref)
jsonschema.exceptions.RefResolutionError: Unresolvable JSON pointer: 'keyCertificatePEMContents'
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/jsonschema/validators.py", line 805, in resolve
    return url, self._remote_cache(url)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/jsonschema/validators.py", line 820, in resolve_from_url
    return self.resolve_fragment(document, fragment)
  File "/home/kosuri/gitswarm/api-venv/lib/python3.8/site-packages/jsonschema/validators.py", line 872, in resolve_fragment
    raise exceptions.RefResolutionError(
jsonschema.exceptions.RefResolutionError: Unresolvable JSON pointer: 'keyCertificatePEMContents'
@vkosuri vkosuri added Status: Needs Triage Requires initial assessment to categorize and prioritize Type: Bug Errors or unexpected behavior labels Apr 23, 2022
@Stranger6667
Copy link
Member

The error in the output states:

jsonschema.exceptions.RefResolutionError: Unresolvable JSON pointer: 'keyCertificatePEMContents'

But, your example doesn't correspond to the output as it has no such a pointer at all. Could you, please, submit a complete schema? Otherwise, it looks like the error is in the schema as the resolver can't resolve that reference.

However, the current Schemathesis output is not much helpful in this regard :(

@Stranger6667 Stranger6667 added Status: Need More Info and removed Status: Needs Triage Requires initial assessment to categorize and prioritize labels Apr 23, 2022
@vkosuri
Copy link
Author

vkosuri commented Apr 23, 2022

Thanks @Stranger6667, give me some time, I will come back

@Stranger6667 Stranger6667 added UX: Reporting Output readability Status: Needs Triage Requires initial assessment to categorize and prioritize Priority: Medium Planned for regular releases and removed Status: Need More Info Status: Needs Triage Requires initial assessment to categorize and prioritize labels Oct 11, 2023
@Stranger6667
Copy link
Member

From my assessment, it looks like the issue is with the input schema. We can improve error reporting for missing references, so the problem is clear from the output.

@Stranger6667 Stranger6667 added this to the 3.21 milestone Oct 12, 2023
@Stranger6667 Stranger6667 changed the title [BUG] YAML oneOf with reference failing with keyerror excepton Improve reporting of errors caused by reference resolution Oct 12, 2023
@Stranger6667 Stranger6667 modified the milestones: 3.21, 3.20 Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium Planned for regular releases Type: Bug Errors or unexpected behavior UX: Reporting Output readability
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants