We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
$ref
When using $ref to reference to whole yaml file, NoMethodError is thrown.
NoMethodError
RSpec example that can reproduce error: master...yckimura:ref-whole-file Failed logs: https://github.com/yckimura/openapi_parser/runs/5725197901
openapi.yaml:
openapi.yaml
openapi: 3.0.0 info: version: 1.0.0 title: OpenAPI3 Test paths: /whole_local_file: post: requestBody: required: true content: application/json: schema: $ref: schema-object.yaml responses: '200': description: correct
schema-object.yaml:
schema-object.yaml
type: object required: - name properties: name: type: string tag: type: string
Stacktrace:
NoMethodError: undefined method `any_of' for # # ./lib/openapi_parser/schema_validator.rb:98:in `validator' # ./lib/openapi_parser/schema_validator.rb:74:in `validate_schema' # ./lib/openapi_parser/schema_validator.rb:62:in `validate_data' # ./lib/openapi_parser/schema_validator.rb:45:in `validate' # ./lib/openapi_parser/schemas/media_type.rb:15:in `validate_parameter' # ./lib/openapi_parser/schemas/request_body.rb:24:in `validate_request_body' # ./lib/openapi_parser/schemas/operation.rb:25:in `validate_request_body' # ./lib/openapi_parser/request_operation.rb:52:in `validate_request_body' # ./spec/openapi_parser/concerns/findable_spec.rb:40:in `block (4 levels) in <top (required)>'
The text was updated successfully, but these errors were encountered:
I found that reference parser inherits owner's schema.
openapi_parser/lib/openapi_parser/concerns/parser.rb
Line 41 in 1e036a7
On this situation, schema-object.yaml should have paths components on top level. other props will be ignored.
paths
components
Sorry, something went wrong.
Basically it's a use case described in the OpenAPI docs so it'd be nice to have it 👍
paths: /users: $ref: '../resources/users.yaml' /users/{userId}: $ref: '../resources/users-by-id.yaml'
No branches or pull requests
When using
$ref
to reference to whole yaml file,NoMethodError
is thrown.RSpec example that can reproduce error: master...yckimura:ref-whole-file
Failed logs: https://github.com/yckimura/openapi_parser/runs/5725197901
openapi.yaml
:schema-object.yaml
:Stacktrace:
The text was updated successfully, but these errors were encountered: