-
Notifications
You must be signed in to change notification settings - Fork 58
does not work with json-schema draft4 #10
Comments
I haven't confirmed, but I think this may be an issue with the https://github.com/tmattia/json-generator project, not Pacto itself. I know json-schema supports json-4. So you can't currently use Pacto's default mechanism for generating stubs using a contract with draft4, but you could use Pacto to validate responses (from live services or alternate stubbing systems). |
Current status:
|
I'm having an issue which might be related to this. I have a swagger 2.0 contract which specifies two required int params, however, when I run the validations ( Applicable contract snippit: paths:
/add:
get:
summary: Adds two numbers
parameters:
- name: num1
in: query
required: true
type: integer
format: int32
- name: num2
in: query
required: true
type: integer
format: int32
responses:
200:
description: The result
schema:
type: integer
format: int32 Generated Pacto::Swagger Request clause:
Notice params is empty. Any ideas? I just started using Pacto, so I may just be missing something. Thanks. |
You probably found a bug... or a missing feature. I think it's a different bug but the solution to both may involve moving the json-generator project back into Pacto (it was originally part of this project) or implementing/using some other system to generate test values. I think it's a different issue because Swagger parameters are similar to json-schema but don't actually use json-schema. The "required" keyword, for example, acts different. It's actually similar to json-schema draft 3 (it's a boolean), but doesn't match json-schema draft 4 (where it's a list of key names of required properties). |
see json-schema draft 4 changelog:
http://tools.ietf.org/html/draft-fge-json-schema-validation-00#appendix-A
This is problematic:
Redefine the "required" keyword.
The text was updated successfully, but these errors were encountered: