You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
When I made mistake in my API Blueprint schema (hosted at apiary) and added field twice (also, apiary didn't show duplicate) in data structure which returns in an array of fixed-type in response, Dredd had thrown validation error for not valid JSON Schema draft v4 in response array items but not for field duplicate.
Simple APIB schema for bug reproduction:
# Data Structures
## Struct (object)
+ field (required)
+ field (required)
# test [GET /]
+ Response 200 (application/json)
+ Attributes (object)
+ data (required, array[Struct], fixed-type)
Thrown exception:
fail: body: JSON schema is not valid draft v4! Data does not match any schemas from "anyOf" at path "/properties/data/items"
The problem is in JSON schema generation from given APIB schema, because it adds duplicated field twice in "required array". Generated schema from Dredd details:
@basavind Thanks for filing this! That's amazing bug report. I think the problem is in how drafter is processing MSON. In my opinion it's responsibility of the parser to recognize the duplication, warn user about it and to internally provide JSON Schema with just one occurrance of the field in required. @apiaryio/adt what do you think?
Describe your problem
When I made mistake in my API Blueprint schema (hosted at apiary) and added field twice (also, apiary didn't show duplicate) in data structure which returns in an array of fixed-type in response, Dredd had thrown validation error for not valid JSON Schema draft v4 in response array items but not for field duplicate.
Simple APIB schema for bug reproduction:
Thrown exception:
The problem is in JSON schema generation from given APIB schema, because it adds duplicated field twice in "required array". Generated schema from Dredd details:
What command line options do you use?
What is in your
dredd.yml
?No config file, but with config but still reproduces
What's your
dredd --version
output?Does
dredd --level=debug
uncover something?Nothing unusual.
Can you send us failing test in a Pull Request?
Maybe yes, but not right now. And I don't know where you are testing APIB parsing and generating JSON Schema from it.
The text was updated successfully, but these errors were encountered: